Merge pull request #4115 from alphagov/make-page-update-dates-consistent

Make ‘last updated’ section consistent
This commit is contained in:
karlchillmaid
2022-01-05 18:06:40 +00:00
committed by GitHub
7 changed files with 83 additions and 10 deletions

View File

@@ -0,0 +1,43 @@
.content-metadata {
@include govuk-font(16);
@include govuk-clearfix;
@include govuk-responsive-margin(5, "bottom");
color: $govuk-text-colour;
margin-top: 15px;
.content-metadata__term,
.content-metadata__definition {
line-height: 1.4;
}
.content-metadata__term {
margin-top: .5em;
@include govuk-media-query($from: tablet) {
box-sizing: border-box;
float: left;
clear: left;
padding-right: govuk-spacing(1);
margin-top: 0;
}
}
.content-metadata__definition {
margin: 0;
@include govuk-media-query($from: tablet) {
&:not(:last-of-type) {
margin-bottom: govuk-spacing(1);
}
}
}
.content-metadata__suffix {
margin-top: 0.628em;
margin-bottom: 0;
@include govuk-media-query($from: tablet) {
margin-top: 6px;
}
}
}

View File

@@ -72,6 +72,7 @@ $path: '/static/images/';
@import 'components/loading-indicator';
@import 'components/area-list';
@import 'components/broadcast-message';
@import 'components/content-metadata';
@import 'views/dashboard';
@import 'views/users';

View File

@@ -0,0 +1,13 @@
{% macro content_metadata(data, suffix=False) %}
<div class="content-metadata">
<dl>
{% for key, value in data.items() %}
<dt class="content-metadata__term">{{ key }}</dt>
<dd class="content-metadata__definition">{{ value }}</dd>
{% endfor %}
</dl>
{% if suffix %}
<p class="content-metadata__suffix">{{ suffix }}</p>
{% endif %}
</div>
{% endmacro %}

View File

@@ -1,5 +1,6 @@
{% extends "content_template.html" %}
{% from "components/service-link.html" import service_link %}
{% from "components/content-metadata.html" import content_metadata %}
{% block per_page_title %}
Accessibility statement
@@ -9,6 +10,14 @@
<h1 class="heading-large">Accessibility statement</h1>
{{ content_metadata(
data={
"Published": "23 September 2020",
"Last updated": "27 October 2021"
},
suffix="We review this page every 3 months"
) }}
<p class="govuk-body">
This accessibility statement applies to the www.notifications.service.gov.uk domain. It does not apply to the <a class="govuk-link govuk-link--no-visited-state" href="https://docs.notifications.service.gov.uk">GOV.UK Notify API documentation subdomain</a>.
</p>
@@ -204,8 +213,4 @@
<p class="govuk-body">
We decided which pages to test based on the most common tasks that GOV.UK Notify users need to complete. We also tested a sample of pages with common user interface components.
</p>
<p class="govuk-body">
This statement was prepared on 23 September 2020. It was last reviewed on 27 October 2021.
</p>
{% endblock %}

View File

@@ -1,4 +1,5 @@
{% extends "withoutnav_template.html" %}
{% from "components/content-metadata.html" import content_metadata %}
{% block per_page_title %}
Privacy notice: how we use your data
@@ -10,7 +11,11 @@
<div class="govuk-grid-column-two-thirds">
<h1 class="heading-large">Privacy notice: how we use your data</h1>
<p class="govuk-body">Last update: 1 October 2021</p>
{{ content_metadata(
data={
"Last updated": "1 October 2021"
}
) }}
<h2 class="heading-medium">Who we are</h2>

View File

@@ -1,5 +1,6 @@
{% from "components/table.html" import mapping_table, row, text_field, edit_field, field with context %}
{% extends "content_template.html" %}
{% from "components/table.html" import mapping_table, row, text_field, edit_field, field with context %}
{% from "components/content-metadata.html" import content_metadata %}
{% block per_page_title %}
Roadmap
@@ -9,9 +10,15 @@
<h1 class="heading-large">Roadmap</h1>
{{ content_metadata(
data={
"Last updated": "30 November 2021"
},
suffix="We review this page every 3 months"
) }}
<p class="govuk-body">The GOV.UK Notify roadmap shows what were working on and some of the <a class="govuk-link govuk-link--no-visited-state" href="#things-we-have-done">things weve done</a>.</p>
<p class="govuk-body">The roadmap is only a guide. It does not cover everything we do, and some things may change.</p>
<div class="govuk-inset-text">We review this page every 3 months. It was last updated on 30 November 2021.</div>
<p class="govuk-body">You can <a class="govuk-link govuk-link--no-visited-state" href="{{url_for('.support')}}">contact us</a> if you have any questions about the roadmap or suggestions for new features.</p>
<h2 class="heading-medium">Things were working on</h2>

View File

@@ -15,10 +15,9 @@ def test_last_review_date():
raw_diff = statement_diff.stdout.decode('utf-8')
today = datetime.now().strftime('%d %B %Y')
with open(statement_file_path, 'r') as statement_file:
current_review_date = re.search((r'This statement was prepared on 23 September 2020\. '
r'It was last reviewed on (\d{1,2} [A-Z]{1}[a-z]+ \d{4})'),
current_review_date = re.search((r'"Last updated": "(\d{1,2} [A-Z]{1}[a-z]+ \d{4})"'),
statement_file.read()).group(1)
# guard against changes that don't need to update the review date
if current_review_date != today:
assert 'This statement was prepared on 23 September 2020. It was last reviewed on' in raw_diff
assert '"Last updated": "' in raw_diff