{{ 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 %} 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 d026fb7a7..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 @@ -117,7 +117,7 @@ {# Election Date #} {% if (election_date is not empty) and (election_text is not empty) %} {% set election_date_text = election_text['#text'] | t({'@date': election_date | render }) %} - {{ election_date_text }} +{{ nvrf_details.heading }}
{% endif %} - {{ nvrf_details.text }} + {{ nvrf_details.text['#markup'] | t({'@state_name': title_english}) }} {% if nvrf_details.link_text %} {# Set path to form dynamically using page route. #} @@ -167,7 +169,7 @@ {% set mail_body %} {{ mail_registration.text }} - {% if state_mail_pdf_link %} + {% if state_mail_pdf_link and mail_registration.link_text %}{{ link(mail_registration.link_text, state_mail_pdf_link) }}
{% endif %} {% endset %} @@ -177,11 +179,13 @@ 'body': mail_body | render | trim | t({'@state_mail_deadline': bymail_deadline ,'@state_name': title_english}), 'footer': mail_footer } %} - {# No mail registration content #} +{# No mail registration content #} {% else %} {% if not has_mail and (no_mail_registration is not empty) %} {% set no_mail_body = no_mail_registration.text['#markup'] | t({'@state_name': title_english}) %} - {% set no_mail_link_title = no_mail_registration.link_text['#markup'] | t({'@state_name': title_english }) %} + {% if no_mail_registration.link_text %} + {% set no_mail_link_title = no_mail_registration.link_text['#markup'] | t({'@state_name': title_english }) %} + {% endif %} {% include '@votegov/component/info-card.html.twig' with { 'heading': no_mail_registration.heading, @@ -197,7 +201,9 @@ {% if has_in_person and (inperson_registration is not empty) %} {% set body = inperson_registration.text['#markup'] | t({'@state_in-person_deadline': inperson_deadline | render }) %} - {% set link_title = inperson_registration.link_text['#markup'] | t({'@state_name': title_english }) %} + {% if inperson_registration.link_text %} + {% set link_title = inperson_registration.link_text['#markup'] | t({'@state_name': title_english }) %} + {% endif %} {% include '@votegov/component/info-card.html.twig' with { 'heading': inperson_registration.heading, 'body': body, @@ -215,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 %}