From 765705e95c1cb0e4b4bb69a4dfa31258c3d1b3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Braghi=C8=99?= Date: Wed, 8 Jan 2025 15:57:40 +0000 Subject: [PATCH] Update the methodology page template post #55 --- .../templates/pages/methodology_page.html | 143 ++++++++---------- 1 file changed, 64 insertions(+), 79 deletions(-) diff --git a/cms/jinja2/templates/pages/methodology_page.html b/cms/jinja2/templates/pages/methodology_page.html index 866140f5..67bde90c 100644 --- a/cms/jinja2/templates/pages/methodology_page.html +++ b/cms/jinja2/templates/pages/methodology_page.html @@ -6,38 +6,38 @@ {% from "components/table-of-contents/_macro.njk" import onsTableOfContents %} {% block header_area %} -
+
{% include "templates/components/navigation/breadcrumbs.html" %}

{{ _("Methodology") }}

-
+
-

+

{{ page.title }}

-
{{ page.summary|richtext() }}
+
{{ page.summary|richtext() }}
{% block release_meta %} -
+
- {{ _("Published") }}: + {{ _("Published") }}: {{ page.publication_date|date("DATE_FORMAT") }}
{% if page.last_revised_date %}
- {{ _("Last revised") }}: + {{ _("Last revised") }}: {{ page.last_revised_date|date("DATE_FORMAT")}}
{% endif %} {% if page.contact_details %}
- {{ _("Contact") }}: + {{ _("Contact") }}: {{ page.contact_details.name }}
{% endif %} @@ -47,84 +47,69 @@

{% endblock %} {% block main %} -
-
-
- {% with toc_title=_("Contents"), toc_aria_label=_("Sections in this page") %} - {# fmt:off #} - {{- - onsTableOfContents({ - "title": toc_title, - "ariaLabel": toc_aria_label, - "itemsList": table_of_contents - }) - }} - {# fmt:on #} - {% endwith %} -
- -
- {# TODO: is the below comment and code still relevant? Can't find the variable in that file #} - {# if there are no contact details on the page, we don't want the last - streamfield block to have a bottom margin. last_flush is used in stream_block.html #} - {% if page.contact_details %} - {% set last_flush = False %} - {% else %} - {% set last_flush = True %} - {% endif %} - - {% include_block page.content %} - - {% if related_publications %} +
+
+ {% with toc_title=_("Contents"), toc_aria_label=_("Sections in this page") %} {# fmt:off #} {{- - onsRelatedContent({ - "ariaLabel": _('Related publications'), - "rows": [{ - "id": 'related-content', - "title": _('Related publications'), - "itemsList": related_publications - }] + onsTableOfContents({ + "title": toc_title, + "ariaLabel": toc_aria_label, + "itemsList": table_of_contents }) - -}} + }} {# fmt:on #} - {% endif %} + {% endwith %} +
- {% if page.show_cite_this_page %} -
-

{{ _("Cite this methodology") }}

-

- {%- set cite_link -%} - {{ page.title }} - {% endset %} - {% set latest_date = page.last_revised_date if page.last_revised_date else page.publication_date %} - {% trans trimmed latest_date_formatted = latest_date|date("DATE_FORMAT"), cite_link=cite_link %} - Office for National Statistics (ONS), last revised {{ latest_date_formatted }}, ONS website, methodology, {{ cite_link }} - {% endtrans %} -

-
- {% endif %} +
+ {# TODO: is the below comment and code still relevant? Can't find the variable in that file #} + {# if there are no contact details on the page, we don't want the last + streamfield block to have a bottom margin. last_flush is used in stream_block.html #} + {% if page.contact_details %} + {% set last_flush = False %} + {% else %} + {% set last_flush = True %} + {% endif %} - {% if page.contact_details %} -
-

{{ _("Contact details") }}

+ {% include_block page.content %} - {% call onsTextIndent() %} -

- Name: {{ page.contact_details.name }} -

-

- Email: {{ page.contact_details.email }} -

- {% if page.contact_details.phone %} -

- Telephone: {{ page.contact_details.phone }} -

- {% endif %} - {% endcall %} -
- {% endif %} -
+ {% if related_publications %} + {# fmt:off #} + {{- + onsRelatedContent({ + "ariaLabel": _('Related publications'), + "rows": [{ + "id": 'related-content', + "title": _('Related publications'), + "itemsList": related_publications + }], + "classes": "spacing" + }) + -}} + {# fmt:on #} + {% endif %} + + {% if page.show_cite_this_page %} +
+

{{ _("Cite this methodology") }}

+

+ {%- set cite_link -%} + {{ page.title }} + {% endset %} + {% set latest_date = page.last_revised_date if page.last_revised_date else page.publication_date %} + {% trans trimmed latest_date_formatted = latest_date|date("DATE_FORMAT"), cite_link=cite_link %} + Office for National Statistics (ONS), last revised {{ latest_date_formatted }}, ONS website, methodology, {{ cite_link }} + {% endtrans %} +

+
+ {% endif %} + + {% if page.contact_details %} + {% with contact_details = page.contact_details%} + {% include "templates/components/contact_details/contact_details.html" %} + {% endwith %} + {% endif %}
{% endblock %}