Add explicit links to git history for policies

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).
This commit is contained in:
Magnus Hagander
2020-08-12 17:52:52 +02:00
parent bb1f5a36e2
commit 8e7e52101c
12 changed files with 29 additions and 12 deletions

View 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))

View 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>

View 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>

View 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>

View 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>

View 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

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>