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

Feature/vote 3149/state page data analytics #1126

Merged
4 changes: 4 additions & 0 deletions config/sync/editor.editor.simple_html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ settings:
- italic
- link
- bulletedList
- sourceEditing
plugins:
ckeditor5_list:
properties:
reversed: false
startIndex: false
multiBlock: true
ckeditor5_sourceEditing:
allowed_tags:
- '<a data-state-ext>'
editor_advanced_link_link:
enabled_attributes:
- aria-label
Expand Down
2 changes: 1 addition & 1 deletion config/sync/filter.format.simple_html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ filters:
status: true
weight: -10
settings:
allowed_html: '<br> <p> <strong> <em> <a href aria-label title class target="_blank" rel> <ul> <ol> <li>'
allowed_html: '<br> <p> <a data-state-ext href aria-label title class target="_blank" rel> <strong> <em> <ul> <ol> <li>'
filter_html_help: true
filter_html_nofollow: false
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
*
#}

{% if link_url %}
{% if link.url and link.title %}
{% set link_markup %}
<a href={{ link_url }}>{{ link_text }}</a>
{{ link(link.title, link.url, create_attribute().setAttribute(data.label, data.value)) }}
{% endset %}
{% endif %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
<div class="vote-info-card__button">
{% include '@votegov/component/button.html.twig' with {
'href': link.url,
'label': link.title
'label': link.title,
'data_label': data.label,
'data': data.value,
} %}
</div>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{# setting link text to be in inline hyper link #}
{% if registration_not_needed.link_text %}
{% set link_markup %}
<a href="{{ more_info_link }}">{{ registration_not_needed.link_text | render | trim | t({'@state_name': title_english}) }}</a>
<a href="{{ more_info_link }}" data-state-ext="state-website-no-registration">{{ registration_not_needed.link_text | render | trim | t({'@state_name': title_english}) }}</a>
{% endset %}
{% endif %}
{# setting body text to have palceholder for both state name and link #}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,14 @@
{% include '@votegov/component/call-out-box.html.twig' with {
'heading': check_registration.heading,
'text': check_registration.text | render | trim,
'link_text': check_registration.link_text | render | trim | t({'@state_name': title_english}),
'link_url': confirm_registration_link
'link': {
'url': confirm_registration_link,
'title': check_registration.link_text | render | trim | t({'@state_name': title_english}),
},
'data': {
'label' : 'data-state-ext',
'value': 'confirm-registration',
},
} %}
{% endif %}
</aside>
Expand All @@ -109,8 +115,14 @@
{% include '@votegov/component/call-out-box.html.twig' with {
'heading': check_registration.heading,
'text': check_registration.text | render | trim,
'link_text': check_registration.link_text | render | trim | t({'@state_name': title_english}),
'link_url': confirm_registration_link
'link': {
'url': confirm_registration_link,
'title': check_registration.link_text | render | trim | t({'@state_name': title_english}),
},
'data': {
'label' : 'data-state-ext',
'value': 'confirm-registration',
},
} %}
{% endif %}

Expand All @@ -135,6 +147,10 @@
'link': {
'url': registration_link,
'title': link_title,
},
'data' : {
'label': 'data-state-ext',
'value': 'online-registration'
}
} %}
{% endif %}
Expand Down Expand Up @@ -170,7 +186,7 @@
{{ mail_registration.text }}

{% if state_mail_pdf_link and mail_registration.link_text %}
<p>{{ link(mail_registration.link_text, state_mail_pdf_link) }}</p>
<p>{{ link(mail_registration.link_text, state_mail_pdf_link, create_attribute().setAttribute('data-state-ext', 'state-mail-registration')) }}</p>
{% endif %}
{% endset %}

Expand Down Expand Up @@ -210,6 +226,10 @@
'link': {
'url': more_info_link,
'title': link_title,
},
'data' : {
'label': 'data-state-ext',
'value': 'in-person-registration'
}
} %}
{% endif %}
Expand Down