Add explicit links to git history for policies
authorMagnus Hagander <magnus@hagander.net>
Wed, 12 Aug 2020 15:52:52 +0000 (17:52 +0200)
committerMagnus Hagander <magnus@hagander.net>
Wed, 12 Aug 2020 15:52:52 +0000 (17:52 +0200)
We don't do this for all pages, but specifically for policies that
already included the "Last update", it's friendly to have a link to the
full set of changes.

We still lave the "Last updated" field as manually updated, because we
don't want to update that one if we just fix a typo or similar, it
should be reserved for when we make acstual content updates to a policy.

This creates and uses a specific template tag to automate the creation
of the links (that can of course be used elsewhere as well if needed).

12 files changed:
pgweb/core/templatetags/pgfilters.py
templates/pages/about/policies/coc.html
templates/pages/about/policies/coc_committee.html
templates/pages/about/policies/funds-group.html
templates/pages/about/policies/news-and-events.html
templates/pages/about/policies/planet-postgresql.html
templates/pages/about/policies/privacy.html
templates/pages/about/policies/project-name.html
templates/pages/about/policies/services-and-hosting.html
templates/pages/about/policies/sponsorship.html
templates/pages/about/policies/trademarks.html
templates/pages/about/policies/twitter.html

index 3ff4c4efca03110550e52aab58ff91fbba07e936..4fa2d89d3b6f573524e0d4a218a8224d1aa66b71 100644 (file)
@@ -1,5 +1,6 @@
 from django.template.defaultfilters import stringfilter
 from django import template
+from django.utils.safestring import mark_safe
 import json
 
 
@@ -80,3 +81,8 @@ def release_notes_pg_minor_version(minor_version, major_version):
     if str(major_version) in ['0', '1']:
         return str(minor_version)[2:4]
     return minor_version
+
+
+@register.simple_tag(takes_context=True)
+def git_changes_link(context):
+    return mark_safe('<a href="https://git.postgresql.org/gitweb/?p=pgweb.git;a=history;f=templates/{}">View</a> change history.'.format(context.template_name))
index 829289f30ad14d4b71f036e17122a5d27d441648..c9b709d2c5c3fe322fe57b6b79117af2473cd744 100644 (file)
@@ -1,4 +1,5 @@
 {%extends "base/page.html"%}
+{%load pgfilters%}
 {%block title%}Code of Conduct{%endblock%}
 {%block contents%}
 
@@ -6,7 +7,7 @@
   <div class="col-lg-9">
     <h1>Code of Conduct <i class="fas fa-gavel"></i></h1>
 
-    <p><em>Last updated: August 18, 2018</em></p>
+    <p><em>Last updated: August 18, 2018. {%git_changes_link%}</em></p>
 
 
     <h2>Introduction</h2>
index 26d5f7da8ddf22459e652c41c0945da37f09eeeb..7b0f6c6aa072cb8908a4babdf4cc007ecd08243f 100644 (file)
@@ -1,10 +1,11 @@
 {%extends "base/page.html"%}
+{%load pgfilters%}
 {%block title%}Code of Conduct Committee{%endblock%}
 {%block contents%}
 
 <h1>Code of Conduct Committee <i class="fas fa-users"></i></h1>
 
-<p><i>Last updated: October 17, 2019</i></p>
+<p><i>Last updated: October 17, 2019. {%git_changes_link%}</i></p>
 
 <h3>Contact</h3>
 
index 56d3b7220712c679e57249cd11cc9d589abcb813..196f423a5491b1d61a0a4dfbc8e62a057bfb1658 100644 (file)
@@ -1,10 +1,11 @@
 {%extends "base/page.html"%}
+{%load pgfilters%}
 {%block title%}Funds Group{%endblock%}
 
 {%block contents%}
 <h1>PostgreSQL Funds Group <i class="far fa-money-bill-alt"></i></h1>
 
-<p><em>Last updated: March 1, 2019</em></p>
+<p><em>Last updated: March 1, 2019. {%git_changes_link%}</em></p>
 
 <h2 id="charter">Charter</h2>
 
index cb7b422f18d0d2ff21604af4d875c482f4c07fd5..a8dc6331b96d2432ae1ff895257fb3dac8de0d11 100644 (file)
@@ -1,10 +1,11 @@
 {%extends "base/page.html"%}
+{%load pgfilters%}
 {%block title%}News and Events Approval Policy{%endblock%}
 {%block contents%}
 
 <h1>News and Events Approval Policy <i class="fas fa-gavel"></i></h1>
 
-<p><em>Last updated: March 29, 2018</em></p>
+<p><em>Last updated: March 29, 2018. {%git_changes_link%}</em></p>
 
 <h2>Policies for Approving News &amp; Events &amp; pgsql-announce</h2>
 
index b9436d4a33b2dd71e82be87387b7f2e8a5d075db..523f6d7662d2fc6839270f6a52e9a32c965e8b33 100644 (file)
@@ -1,10 +1,11 @@
 {%extends "base/page.html"%}
+{%load pgfilters%}
 {%block title%}Planet PostgreSQL{%endblock%}
 {%block contents%}
 
 <h1>Planet PostgreSQL <i class="fas fa-gavel"></i></h1>
 
-<p><em>Last updated: October 12, 2016</em></p>
+<p><em>Last updated: October 12, 2016. {%git_changes_link%}</em></p>
 
 <p><a href="https://planet.postgresql.org/">Planet PostgreSQL</a> is a blog
     aggregation service run by the PostgreSQL community. In addition to the main
index 75046b35405fbd4b41caba5f5367e750a0784bd4..26fe176646b23a735ad0b8dc3c6b95b84b35293d 100644 (file)
@@ -1,9 +1,10 @@
 {%extends "base/page.html"%}
+{%load pgfilters%}
 {%block title%}Privacy Policy{%endblock%}
 {%block contents%}
 <h1>Privacy Policy <i class="fas fa-gavel"></i></h1>
 
-<p><em>Last updated: December 10, 2012</em></p>
+<p><em>Last updated: December 10, 2012. {%git_changes_link%}</em></p>
 
 <p>When you visit our website, our servers automatically log your IP address
     and/or host name.</p>
index 8e2c0745e70a7c7de1901c6941670049331882f4..1e7115d806efa1fd44363ee03a8da5fa46451d4f 100644 (file)
@@ -1,10 +1,11 @@
 {%extends "base/page.html"%}
+{%load pgfilters%}
 {%block title%}Project Name{%endblock%}
 {%block contents%}
 
 <h1>Project Name <i class="fas fa-gavel"></i></h1>
 
-<p><em>Last updated: July 5, 2018</em></p>
+<p><em>Last updated: July 5, 2018. {%git_changes_link%}</em></p>
 
 <h2>"PostgreSQL" versus "Postgres"</h2>
 
index bcb5cf2299f0d42f42c8aebc503463276f393450..08387b1d2812dd4f05c800726f9f3260ca05fc3c 100644 (file)
@@ -1,11 +1,12 @@
 {%extends "base/page.html"%}
+{%load pgfilters%}
 {%block title%}Professional Services and Hosting Approval Policy{%endblock%}
 {%block contents%}
 
 <h1>Professional Services and Hosting Approval Policy <i class="fas fa-gavel">
     </i></h1>
 
-<p><em>Last updated: May 19, 2012</em></p>
+<p><em>Last updated: May 19, 2012. {%git_changes_link%}</em></p>
 
 <h2>Policies for Approving Professional Services and Hosting Services</h2>
 
index d5a8e10211cfe333a70e8c7727722d752e132b12..fae86bad9efdf8b7d8d674bbdefe7dc667374ff6 100644 (file)
@@ -1,10 +1,11 @@
 {%extends "base/page.html"%}
+{%load pgfilters%}
 {%block title%}Sponsoring{%endblock%}
 {%block contents%}
 
 <h1>PostgreSQL Sponsorship <i class="fas fa-gavel"></i></h1>
 
-<p><em>Last updated: June 1, 2018</em></p>
+<p><em>Last updated: June 1, 2018. {%git_changes_link%}</em></p>
 
 <h2>Sponsorship levels</h2>
 
index 96307b6a876733fe7621ebdf7945412dee660130..f4d8d6d6882dc80f034f58fb2fb71805a033ed7d 100644 (file)
@@ -1,10 +1,11 @@
 {%extends "base/page.html"%}
-{%block title%}Trademark Policy{%endblock%}
+{%load pgfilters%}
+'{%block title%}Trademark Policy{%endblock%}
 {%block contents%}
 
 <h1>Trademark Policy <i class="fas fa-gavel"></i></h1>
 
-<p><em>Last updated: August 28, 2018</em></p>
+<p><em>Last updated: August 28, 2018. {%git_changes_link%}</em></p>
 
 <h2>Policy</h2>
 
index b17c2e4537809c7162fcd5aeef7f38495eb00913..8743bfcf158fb72ecbe391ffd20d2f0b8603df06 100644 (file)
@@ -1,10 +1,11 @@
 {%extends "base/page.html"%}
+{%load pgfilters%}
 {%block title%}@postgresql Twitter Account Policy{%endblock%}
 {%block contents%}
 
 <h1>@postgresql Twitter Account Policy <i class="fas fa-gavel"></i></h1>
 
-<p><em>Last updated: January 19, 2018</em></p>
+<p><em>Last updated: January 19, 2018. {%git_changes_link%}</em></p>
 
 <p>This policy applies to the manual use of the @postgresql Twitter account.</p>