Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VOTE 3157 Add render filter to the state mail deadline #1125

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
{% if content.field_mail_postmarked_deadline | render %}
{% set postmarked_deadline = 'Must be postmarked by @date' | t({'@date': content.field_mail_postmarked_deadline.0 | render}) %}
{% else %}
{% set postmarked_deadline = content.field_g_mail_postmarked_deadline | field_value %}
{% set postmarked_deadline = content.field_g_mail_postmarked_deadline | field_value | render %}
{% endif %}

{# Set received deadline with fallback #}
{% if content.field_mail_received_deadline | render %}
{% set received_deadline = 'Must be received by @date' | t({'@date': content.field_mail_received_deadline.0 | render}) %}
{% else %}
{% set received_deadline = content.field_g_mail_received_deadline | field_value %}
{% set received_deadline = content.field_g_mail_received_deadline | field_value | render %}
{% endif %}

{# Set the deadline with fallback, prioritizing postmarked deadline. #}
Expand Down Expand Up @@ -114,7 +114,7 @@
} %}
{% endif %}

{# Election Date #}
{# 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 }) %}
<div class="vote-date--election">{{ election_date_text }}</div>
Expand Down Expand Up @@ -176,7 +176,7 @@

{% include '@votegov/component/info-card.html.twig' with {
'heading': mail_registration.heading,
'body': mail_body | render | trim | t({'@state_mail_deadline': bymail_deadline ,'@state_name': title_english}),
'body': mail_body | render | trim | t({'@state_mail_deadline': bymail_deadline,'@state_name': title_english}),
'footer': mail_footer
} %}
{# No mail registration content #}
Expand Down