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-2822 add checkbox to enable NVRF link #977

Merged
merged 1 commit into from
Sep 18, 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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies:
- field.field.block_content.registration_form_selector.field_description
- field.field.block_content.registration_form_selector.field_digital_form_link_label
- field.field.block_content.registration_form_selector.field_digital_form_paragraph
- field.field.block_content.registration_form_selector.field_enable_digital_form_link
- field.field.block_content.registration_form_selector.field_heading
- field.field.block_content.registration_form_selector.field_registration_form_link
- field.field.block_content.registration_form_selector.field_submit_button_label
Expand All @@ -21,6 +22,7 @@ third_party_settings:
children:
- field_digital_form_paragraph
- field_digital_form_link_label
- field_enable_digital_form_link
label: 'Digital form'
region: content
parent_name: ''
Expand Down Expand Up @@ -90,6 +92,13 @@ content:
rows: 5
placeholder: ''
third_party_settings: { }
field_enable_digital_form_link:
type: boolean_checkbox
weight: 11
region: content
settings:
display_label: true
third_party_settings: { }
field_heading:
type: string_textfield
weight: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies:
- field.field.block_content.registration_form_selector.field_description
- field.field.block_content.registration_form_selector.field_digital_form_link_label
- field.field.block_content.registration_form_selector.field_digital_form_paragraph
- field.field.block_content.registration_form_selector.field_enable_digital_form_link
- field.field.block_content.registration_form_selector.field_heading
- field.field.block_content.registration_form_selector.field_registration_form_link
- field.field.block_content.registration_form_selector.field_submit_button_label
Expand Down Expand Up @@ -50,6 +51,16 @@ content:
third_party_settings: { }
weight: 8
region: content
field_enable_digital_form_link:
type: boolean
label: hidden
settings:
format: boolean
format_custom_false: ''
format_custom_true: ''
third_party_settings: { }
weight: 10
region: content
field_heading:
type: string
label: hidden
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ field_name: field_digital_form_link_label
entity_type: block_content
bundle: registration_form_selector
label: 'Digital form link label'
description: 'Entering a value in this field triggers the digital form page to be generated on the public site.'
description: ''
required: false
translatable: true
default_value: { }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
uuid: de568db6-d383-421a-801a-886cc5ba331a
langcode: es
status: true
dependencies:
config:
- block_content.type.registration_form_selector
- field.storage.block_content.field_enable_digital_form_link
id: block_content.registration_form_selector.field_enable_digital_form_link
field_name: field_enable_digital_form_link
entity_type: block_content
bundle: registration_form_selector
label: 'Enable digital form link'
description: 'Selecting this option launches the digital form to the public.'
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
uuid: 4ffc187c-ed58-45f2-bb27-f679508d87b7
langcode: es
status: true
dependencies:
module:
- block_content
id: block_content.field_enable_digital_form_link
field_name: field_enable_digital_form_link
entity_type: block_content
type: boolean
settings: { }
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

<h2>{{ content.field_heading | field_value | render | replace({"@state_name": currentnode.getTitle()}) | raw }}</h2>

{% if (elements['#block_content'].field_enable_digital_form_link.value == 1) %}
{{ content.field_digital_form_paragraph | field_value }}

{% if content.field_digital_form_link_label | render %}
Expand All @@ -31,6 +32,7 @@
} %}
</p>
{% endif %}
{% endif %}

<form class="usa-form" method="get" id="register_form_download" data-test="nvrfForm">
<p>{{ content.field_description | field_value }}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

{% if label %}
{% if href %}
<div>{{ link(label, href, create_attribute().addClass(classes).setAttribute(data_label, data)) }}</div>
{{ link(label, href, create_attribute().addClass(classes).setAttribute(data_label, data)) }}
{% else %}
<button{{ create_attribute().addClass(classes).setAttribute('type', 'button').setAttribute('id', (id | clean_id)) }}>{{ label }}</button>
{% endif %}
Expand Down
2 changes: 2 additions & 0 deletions web/themes/custom/votegov/templates/component/hero.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@
</div>
{% endif %}
{% if link_href %}
<div>
{% include '@votegov/component/button.html.twig' with {
'href': link_href,
'label': link_label,
'secondary': true
} %}
</div>
{% endif %}
</div>
</div>
Expand Down