From b3a5941e22c24d27b65f5ac5c5a98e45ed674e22 Mon Sep 17 00:00:00 2001 From: Christian Medders - Bixal <88721460+clmedders@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:36:31 -0400 Subject: [PATCH] Vote-2957: No Online Registration (#1054) * add placeholder for no online reg * Updating twig template * Update to config for new field --- ..._content.state_display_content.default.yml | 29 +++++++++----- ..._content.state_display_content.default.yml | 8 ++++ ...y_content.field_no_online_registration.yml | 21 ++++++++++ ...k_content.field_no_online_registration.yml | 19 ++++++++++ .../node/node--state-territory.html.twig | 38 +++++++++---------- 5 files changed, 85 insertions(+), 30 deletions(-) create mode 100644 config/sync/field.field.block_content.state_display_content.field_no_online_registration.yml create mode 100644 config/sync/field.storage.block_content.field_no_online_registration.yml diff --git a/config/sync/core.entity_form_display.block_content.state_display_content.default.yml b/config/sync/core.entity_form_display.block_content.state_display_content.default.yml index 1cad9e3e8..5194c8126 100644 --- a/config/sync/core.entity_form_display.block_content.state_display_content.default.yml +++ b/config/sync/core.entity_form_display.block_content.state_display_content.default.yml @@ -11,6 +11,7 @@ dependencies: - field.field.block_content.state_display_content.field_in_person_registration - field.field.block_content.state_display_content.field_mail_registration - field.field.block_content.state_display_content.field_military_and_overseas_regi + - field.field.block_content.state_display_content.field_no_online_registration - field.field.block_content.state_display_content.field_nvrf_details - field.field.block_content.state_display_content.field_online_registration - field.field.block_content.state_display_content.field_registration_intro @@ -45,13 +46,13 @@ content: third_party_settings: { } field_election_date: type: datetime_default - weight: 10 + weight: 11 region: content settings: { } third_party_settings: { } field_election_text: type: text_textarea - weight: 11 + weight: 12 region: content settings: rows: 3 @@ -62,7 +63,7 @@ content: hide_guidelines: '0' field_in_person_registration: type: vote_fields_state_content - weight: 7 + weight: 8 region: content settings: form_subfield_display: @@ -72,7 +73,7 @@ content: third_party_settings: { } field_mail_registration: type: vote_fields_state_content - weight: 5 + weight: 6 region: content settings: form_subfield_display: @@ -82,7 +83,7 @@ content: third_party_settings: { } field_military_and_overseas_regi: type: vote_fields_state_content - weight: 8 + weight: 9 region: content settings: form_subfield_display: @@ -90,9 +91,19 @@ content: text: text link_text: 0 third_party_settings: { } + field_no_online_registration: + type: vote_fields_state_content + weight: 5 + region: content + settings: + form_subfield_display: + - heading + - text + - link_text + third_party_settings: { } field_nvrf_details: type: vote_fields_state_content - weight: 6 + weight: 7 region: content settings: form_subfield_display: @@ -122,7 +133,7 @@ content: third_party_settings: { } field_registration_not_needed: type: vote_fields_state_content - weight: 9 + weight: 10 region: content settings: form_subfield_display: @@ -140,13 +151,13 @@ content: third_party_settings: { } langcode: type: language_select - weight: 13 + weight: 14 region: content settings: include_locked: true third_party_settings: { } translation: - weight: 12 + weight: 13 region: content settings: { } third_party_settings: { } diff --git a/config/sync/core.entity_view_display.block_content.state_display_content.default.yml b/config/sync/core.entity_view_display.block_content.state_display_content.default.yml index 4ef0d7b58..58b7b987b 100644 --- a/config/sync/core.entity_view_display.block_content.state_display_content.default.yml +++ b/config/sync/core.entity_view_display.block_content.state_display_content.default.yml @@ -11,6 +11,7 @@ dependencies: - field.field.block_content.state_display_content.field_in_person_registration - field.field.block_content.state_display_content.field_mail_registration - field.field.block_content.state_display_content.field_military_and_overseas_regi + - field.field.block_content.state_display_content.field_no_online_registration - field.field.block_content.state_display_content.field_nvrf_details - field.field.block_content.state_display_content.field_online_registration - field.field.block_content.state_display_content.field_registration_intro @@ -76,6 +77,13 @@ content: third_party_settings: { } weight: 8 region: content + field_no_online_registration: + type: vote_fields_state_content_default + label: above + settings: { } + third_party_settings: { } + weight: 12 + region: content field_nvrf_details: type: vote_fields_state_content_default label: above diff --git a/config/sync/field.field.block_content.state_display_content.field_no_online_registration.yml b/config/sync/field.field.block_content.state_display_content.field_no_online_registration.yml new file mode 100644 index 000000000..6749065fd --- /dev/null +++ b/config/sync/field.field.block_content.state_display_content.field_no_online_registration.yml @@ -0,0 +1,21 @@ +uuid: 398183c8-0c7a-4960-aaf6-d3bb2caa3f9c +langcode: en +status: true +dependencies: + config: + - block_content.type.state_display_content + - field.storage.block_content.field_no_online_registration + module: + - vote_fields +id: block_content.state_display_content.field_no_online_registration +field_name: field_no_online_registration +entity_type: block_content +bundle: state_display_content +label: 'No Online registration' +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: vote_fields_state_content diff --git a/config/sync/field.storage.block_content.field_no_online_registration.yml b/config/sync/field.storage.block_content.field_no_online_registration.yml new file mode 100644 index 000000000..beefc4179 --- /dev/null +++ b/config/sync/field.storage.block_content.field_no_online_registration.yml @@ -0,0 +1,19 @@ +uuid: fb15b55f-486c-41b1-9c7b-5296239c2e10 +langcode: en +status: true +dependencies: + module: + - block_content + - vote_fields +id: block_content.field_no_online_registration +field_name: field_no_online_registration +entity_type: block_content +type: vote_fields_state_content +settings: { } +module: vote_fields +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false 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 16533c730..41135a01d 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 @@ -62,13 +62,8 @@ {% set check_registration = state_display_content.field_check_registration.0 | default([]) | merge(content.field_check_registration.0 | default([])) %} {% set election_date = state_display_content.field_election_date.0 | default([]) | merge(content.field_election_date.0 | default([])) %} {% set election_text = state_display_content.field_election_text.0 | default([]) | merge(content.field_election_text.0 | default([])) %} +{% set no_online_registration = state_display_content.field_no_online_registration.0 | default([]) | merge(content.field_no_online_registration.0 | default([])) %} -{# Registration types #} -{% set registration_types = content.field_registration_type | field_value | column('#markup') %} -{% set has_in_person = "in-person" in registration_types %} -{% set has_mail = "by-mail" in registration_types %} -{% set has_online = "online" in registration_types %} -{% set not_needed = "not-needed" in registration_types %}