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-2882 display intro or not needed state content #1023

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
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
105 changes: 74 additions & 31 deletions config/sync/core.entity_view_display.node.state_territory.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ dependencies:
- link
- options
- user
- vote_fields
id: node.state_territory.full
targetEntityType: node
bundle: state_territory
Expand All @@ -64,7 +65,7 @@ content:
content_moderation_control:
settings: { }
third_party_settings: { }
weight: 0
weight: 1
region: content
field_accepts_nvrf:
type: boolean
Expand All @@ -74,7 +75,14 @@ content:
format_custom_false: ''
format_custom_true: ''
third_party_settings: { }
weight: 20
weight: 21
region: content
field_check_registration:
type: vote_fields_state_content_default
label: hidden
settings: { }
third_party_settings: { }
weight: 25
region: content
field_confirm_registration_link:
type: link
Expand All @@ -86,7 +94,7 @@ content:
rel: '0'
target: '0'
third_party_settings: { }
weight: 14
weight: 15
region: content
field_election_homepage_link:
type: link
Expand All @@ -98,39 +106,39 @@ content:
rel: '0'
target: '0'
third_party_settings: { }
weight: 1
weight: 2
region: content
field_g_in_person_deadline:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 13
weight: 14
region: content
field_g_mail_postmarked_deadline:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 9
weight: 10
region: content
field_g_mail_received_deadline:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 11
weight: 12
region: content
field_g_online_deadline:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 7
weight: 8
region: content
field_in_person_deadline:
type: double_field_unformatted_list
Expand All @@ -152,15 +160,22 @@ content:
scale: 2
inline: true
third_party_settings: { }
weight: 12
weight: 13
region: content
field_in_person_registration:
type: vote_fields_state_content_default
label: hidden
settings: { }
third_party_settings: { }
weight: 27
region: content
field_in_state_name:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 21
weight: 22
region: content
field_is_state:
type: boolean
Expand All @@ -170,7 +185,7 @@ content:
format_custom_false: ''
format_custom_true: ''
third_party_settings: { }
weight: 18
weight: 19
region: content
field_mail_postmarked_deadline:
type: datetime_default
Expand All @@ -179,7 +194,7 @@ content:
timezone_override: ''
format_type: long_date
third_party_settings: { }
weight: 8
weight: 9
region: content
field_mail_received_deadline:
type: datetime_default
Expand All @@ -188,7 +203,14 @@ content:
timezone_override: ''
format_type: long_date
third_party_settings: { }
weight: 10
weight: 11
region: content
field_mail_registration:
type: vote_fields_state_content_default
label: hidden
settings: { }
third_party_settings: { }
weight: 28
region: content
field_media:
type: entity_reference_entity_view
Expand All @@ -199,6 +221,13 @@ content:
third_party_settings: { }
weight: 0
region: content
field_military_and_overseas_regi:
type: vote_fields_state_content_default
label: hidden
settings: { }
third_party_settings: { }
weight: 29
region: content
field_more_info_link:
type: link
label: hidden
Expand All @@ -209,15 +238,15 @@ content:
rel: '0'
target: '0'
third_party_settings: { }
weight: 5
weight: 6
region: content
field_of_state_name:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 22
weight: 23
region: content
field_online_deadline:
type: double_field_unformatted_list
Expand All @@ -239,7 +268,14 @@ content:
scale: 2
inline: true
third_party_settings: { }
weight: 6
weight: 7
region: content
field_online_registration:
type: vote_fields_state_content_default
label: hidden
settings: { }
third_party_settings: { }
weight: 30
region: content
field_override_confirm_reg_link:
type: link
Expand All @@ -251,7 +287,7 @@ content:
rel: '0'
target: '0'
third_party_settings: { }
weight: 15
weight: 16
region: content
field_override_election_hp_link:
type: link
Expand All @@ -263,7 +299,7 @@ content:
rel: '0'
target: '0'
third_party_settings: { }
weight: 2
weight: 3
region: content
field_override_more_info_link:
type: link
Expand All @@ -275,7 +311,7 @@ content:
rel: '0'
target: '0'
third_party_settings: { }
weight: 16
weight: 17
region: content
field_override_registration_link:
type: link
Expand All @@ -287,7 +323,14 @@ content:
rel: '0'
target: '0'
third_party_settings: { }
weight: 4
weight: 5
region: content
field_registration_intro:
type: vote_fields_state_content_default
label: hidden
settings: { }
third_party_settings: { }
weight: 26
region: content
field_registration_link:
type: link
Expand All @@ -299,22 +342,29 @@ content:
rel: '0'
target: '0'
third_party_settings: { }
weight: 3
weight: 4
region: content
field_registration_not_needed:
type: vote_fields_state_content_default
label: hidden
settings: { }
third_party_settings: { }
weight: 31
region: content
field_registration_type:
type: list_key
label: hidden
settings: { }
third_party_settings: { }
weight: 17
weight: 18
region: content
field_state_abbreviation:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 19
weight: 20
region: content
field_updated_date:
type: datetime_default
Expand All @@ -323,30 +373,23 @@ content:
timezone_override: ''
format_type: revision_date
third_party_settings: { }
weight: 23
weight: 24
region: content
hidden:
body: true
field_address_location_inst: true
field_check_registration: true
field_content_version: true
field_identification_inst: true
field_in_person_registration: true
field_mail_registration: true
field_mail_registration_link: true
field_mailing_address_inst: true
field_metatags: true
field_military_and_overseas_regi: true
field_nvrf_fields: true
field_nvrf_last_updated_date: true
field_online_registration: true
field_override_mail_reg_link: true
field_pdf_pages: true
field_personal_information_inst: true
field_political_party_inst: true
field_reg_eligibility_desc: true
field_registration_intro: true
field_registration_not_needed: true
langcode: true
links: true
published_at: true
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ id: node.state_territory.field_registration_not_needed
field_name: field_registration_not_needed
entity_type: node
bundle: state_territory
label: 'Registration not needed'
label: 'Registration not needed (override)'
description: ''
required: false
translatable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,18 @@ public function viewElements(FieldItemListInterface $items, $langcode): array {

if ($item->heading) {
$element[$delta]['heading'] = [
'#type' => 'item',
'#title' => $this->t('Heading'),
'#markup' => $item->heading,
];
}

if ($item->text) {
$element[$delta]['text'] = [
'#type' => 'item',
'#title' => $this->t('Text'),
'#markup' => $item->text,
];
}

if ($item->link_text) {
$element[$delta]['link_text'] = [
'#type' => 'item',
'#title' => $this->t('Link text'),
'#markup' => $item->link_text,
];
}
Expand Down
23 changes: 23 additions & 0 deletions web/themes/custom/votegov/templates/component/info-card.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
{#
/**
* @file
* Default theme implementation of info card component.
*
* Component template variables:
* - heading: string (required)
* - body: string
* - link.url: string
* - link.title: string
* - footer: string
*
* Usage example:
* {% include '@votegov/component/info-card.html.twig' with {
* 'heading': var_title,
* 'body': var_body,
* 'link': {
* 'url': 'var_url',
* 'title': 'var_text',
* }
* } %}
*
#}
<div class="vote-info-card">
<h2 class="vote-info-card__header">
{{ heading }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
#}

{% block content %}
{% set registration_intro = state_display_content.field_registration_intro.0 | merge(content.field_registration_intro.0 | default([])) %}
{% if registration_intro is not empty %}
<h2>{{ registration_intro.heading }}</h2>
{{ registration_intro.text }}
{% endif %}

{# How to register to vote #}
<h2>{{ 'How to register and update your registration' | t({ '@state_name': state_name }) }}</h2>
{# registration link, more info link #}
Expand Down
Loading