From 9989468564ce7b045ab6b06f3fb95b9553644316 Mon Sep 17 00:00:00 2001 From: christian medders Date: Tue, 29 Oct 2024 14:55:14 -0400 Subject: [PATCH 1/2] Vote-3051: update to not needed template --- ...ode--state-territory--not-needed.html.twig | 59 +++++++------------ 1 file changed, 21 insertions(+), 38 deletions(-) diff --git a/web/themes/custom/votegov/templates/node/node--state-territory--not-needed.html.twig b/web/themes/custom/votegov/templates/node/node--state-territory--not-needed.html.twig index 4129ce295..abcaff16f 100644 --- a/web/themes/custom/votegov/templates/node/node--state-territory--not-needed.html.twig +++ b/web/themes/custom/votegov/templates/node/node--state-territory--not-needed.html.twig @@ -7,48 +7,31 @@ #} {% block aside %} -{# keep empty for not needed #} + {# keep empty for not needed #} {% endblock %} {% block content %} - {% if registration_not_needed is not empty %} -

{{ registration_not_needed.heading }}

+ {% if registration_not_needed is not empty %} + {# setting link text to be in inline hyper link #} + {% if registration_not_needed.link_text %} + {% set link_markup %} + {{ registration_not_needed.link_text | render | trim | t({'@state_name': title_english}) }} + {% endset %} + {% endif %} + {# setting body text to have palceholder for both state name and link #} + {% set body = registration_not_needed.text['#markup']| t({'@state_name': title_english, '@link': {'#markup': link_markup } | render}) %} - {{ registration_not_needed.text }} + {% include '@votegov/component/info-card.html.twig' with { + 'heading': registration_not_needed.heading, + 'body': body, + } %} - {% if more_info_link and registration_not_needed.link_text %} -

- {% include '@votegov/component/button.html.twig' with { - 'label': registration_not_needed.link_text, - 'href': more_info_link - } %} -

- {% endif %} + {% endif %} + {% if military_overseas_registration is not empty %} + {% include '@votegov/component/info-card.html.twig' with { + 'heading': military_overseas_registration.heading, + 'body': military_overseas_registration.text, + } %} + {% endif %} - {% if military_overseas_registration is not empty %} - {{ military_overseas_registration }} - {% endif %} - {% endif %} - - {# JSON Schema #} - {# Commenting this out until we have a chance to review and improve #} -{# #} {% endblock %} From 96fb326a7b25712a3f6989826d68d90c5e95196e Mon Sep 17 00:00:00 2001 From: christian medders Date: Tue, 29 Oct 2024 14:58:22 -0400 Subject: [PATCH 2/2] Vote-3051: adding update date to tempalte --- .../templates/node/node--state-territory.html.twig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/themes/custom/votegov/templates/node/node--state-territory.html.twig b/web/themes/custom/votegov/templates/node/node--state-territory.html.twig index 4588235a6..c8d91d8c0 100644 --- a/web/themes/custom/votegov/templates/node/node--state-territory.html.twig +++ b/web/themes/custom/votegov/templates/node/node--state-territory.html.twig @@ -221,5 +221,13 @@ } %} {% endif %} {% endblock %} + + {# Checking if updated date is set and then render the field #} + {% if content.field_updated_date | field_value is not empty %} +

+ {# Striptags and raw filters were added to accomodate Navajo date formats. #} + {{'Last updated:' | t }} {{ content.field_updated_date | render | replace(t_numbers[language].numbers | default([])) | striptags('') | raw }} +

+ {% endif %}