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

RTV Staging changes before and after gem update #715

Open
wants to merge 19 commits into
base: production
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions app/assets/stylesheets/nvra.scss
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ span.smaller_prompt {
h4 {
text-transform:uppercase;
font-size:.7 * $fs;
line-height: 1.8;
a {
text-transform:none;
}
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/abrs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def state_online_redirect
@abr.update_attributes(:finish_with_state=>true)
render :html => "<html><body><script>parent.location.href='#{@abr.home_state_oabr_url}';</script></body></html>".html_safe
end

def update
@abr = Abr.find_by_uid(params[:id])
set_up_locale
Expand Down
2 changes: 1 addition & 1 deletion app/mailers/notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def partner_terms_of_use(partner)
@privacy_url = "https://www.rockthevote.org/about-rock-the-vote/privacy-policy/"
@partner_signup_url = "https://docs.google.com/forms/d/e/1FAIpQLSck6XJO2SQeSIenDpuHgNBUop9ENtvsGhMWLFYQDsy-VgO8pg/viewform"
@partner_tool_faqs = "https://www.rockthevote.org/programs-and-partner-resources/tech-for-civic-engagement/partner-ovr-tool-faqs/partner-ovr-tool-faqs/"
mail(subject: "Rock the Vote Terms of Use",
mail(subject: "Welcome to Rock the Vote",
from: RockyConf.from_address,
to: partner.email,
date: Time.now.to_s(:db))
Expand Down
5 changes: 5 additions & 0 deletions app/services/v5/state_requirements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def self.find(query)
state = find_state(query)
locale = get_locale(state, query[:lang])

# Instantiate StateCustomization with the state object
state_customization = StateCustomization.new(state)

validate_participation(state, locale)
validate_age(state, query[:date_of_birth], locale)

Expand All @@ -51,6 +54,8 @@ def self.find(query)
:sos_address => state.registrar_address,
:sos_phone => state.registrar_phone,
:sos_url => state.registrar_url,
:online_registration_url => state_customization.online_reg_url(nil),
:online_registration_enabled => state_customization.redirect_to_online_reg_url(nil),
:sub_18_msg => locale.sub_18 }
end

Expand Down
2 changes: 1 addition & 1 deletion app/validators/mi_registrant_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def validate(reg)

def validate_age(reg)
return if reg.date_of_birth.blank?
earliest_date = Date.today - 17.years - 6.months
earliest_date = Date.today - 16.years
if reg.date_of_birth > earliest_date
reg.errors.add(:date_of_birth, :too_young)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- existing_locale = src_url.match(/(\?|&)locale=([^&]*)/)&.captures&.last || I18n.locale
- src_url = src_url.gsub(/(\?|&)locale=[^&]*/, '') # Remove any existing locale parameter
- src_url += src_url.include?('?') ? "&locale=#{existing_locale}" : "?locale=#{existing_locale}" # Append the new locale
%iframe#dynamicLocaleIframe{border: '0', height: "575px", "ALLOWTRANSPARENCY": true, frameborder: "no", style: 'border:none !important; margin:0; padding:0; width:100%;', src: src_url }
%iframe#dynamicLocaleIframe{border: '0', height: "575px", "ALLOWTRANSPARENCY": true, frameborder: "no", style: 'border:none !important; margin:40px 0 0 0; padding:0; width:100%;', src: src_url }

:javascript
document.addEventListener('DOMContentLoaded', function () {
Expand Down
16 changes: 11 additions & 5 deletions app/views/abrs/step_2_abr_everyone_gets_ballot.html.haml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
-# STATENAME Automatically mails all registered voters a ballot
- abbrev = @abr.i18n_key
%h2{role: "heading", "aria-level": 2}= t("states.custom.#{abbrev}.abr.everyone_gets_ballot.header_1", state_name: @abr.home_state_name, default:t("txt.abr.everyone_gets_ballot.header_1", state_name: @abr.home_state_name)).html_safe

-# If you are registered to vote in STATE NAME you do not need to request...
.state-instructions
= t("states.custom.#{abbrev}.abr.everyone_gets_ballot.instructions_1", state_name: @abr.home_state_name, url: new_catalist_lookup_path(partner: @abr.partner_id, email: @abr.email, zip: @abr.zip), default: t("txt.abr.everyone_gets_ballot.instructions_1", state_name: @abr.home_state_name, url: new_catalist_lookup_path(partner: @abr.partner_id, email: @abr.email, zip: @abr.zip))).html_safe

%h2{role: "heading", "aria-level": 2}= t("txt.abr.everyone_gets_ballot.header_2").html_safe
-# questions and next steps
-#%h2{role: "heading", "aria-level": 2}= t("txt.abr.everyone_gets_ballot.header_2").html_safe

.state-instructions
= t("states.custom.#{abbrev}.abr.everyone_gets_ballot.instructions_2", registration_url: new_registrant_path(partner: @abr.partner, email_address: @abr.email, home_zip_code: @abr.zip)).html_safe
-# custom from state instructions_2
-#.state-instructions
-# = t("states.custom.#{abbrev}.abr.everyone_gets_ballot.instructions_2", registration_url: new_registrant_path(partner: @abr.partner, email_address: @abr.email, home_zip_code: @abr.zip)).html_safe

%h2{role: "heading", "aria-level": 2}= t("txt.abr.everyone_gets_ballot.header_3").html_safe
-# Don't Forget to Vote!
-#%h2{role: "heading", "aria-level": 2}= t("txt.abr.everyone_gets_ballot.header_3").html_safe

-# custom from state instructions 3 (deadlines for delivering your ballot)
.state-instructions
= t("states.custom.#{abbrev}.abr.everyone_gets_ballot.instructions_3").html_safe

Expand All @@ -20,7 +26,7 @@
#finish_page_iframe
- src_url = @abr_finish_iframe_url
- src_url = src_url.split('?')[0] # Remove all existing query parameters
%iframe#dynamicLocaleIframe{border: '0', height: "575px", "ALLOWTRANSPARENCY": true, frameborder: "no", style: 'border:none !important; margin:0; padding:0; width:100%;', src: src_url }
%iframe#dynamicLocaleIframe{border: '0', height: "575px", "ALLOWTRANSPARENCY": true, frameborder: "no", style: 'border:none !important; margin:40px 0 0 0; padding:0; width:100%;', src: src_url }

:javascript
document.addEventListener('DOMContentLoaded', function () {
Expand Down
37 changes: 31 additions & 6 deletions app/views/abrs/step_2_abr_splash_page_general.html.haml
Original file line number Diff line number Diff line change
@@ -1,18 +1,43 @@
- abbrev = @abr.i18n_key

%h2{role: "heading", "aria-level": 2, id: "abr_splash_header_1"}= t("txt.abr.splash.header_1", state_name: @abr.home_state_name).html_safe
-# The following header is coming from:
-# = t("txt.abr.splash.header_1", state_name: @abr.home_state_name)

.state-instructions
= t("states.custom.#{abbrev}.abr.splash.instructions_1", state_name: @abr.home_state_name, lookup_url: new_catalist_lookup_path(partner: @abr.partner_id, email: @abr.email, zip: @abr.zip), registration_url: new_registrant_path(partner: @abr.partner, email_address: @abr.email, home_zip_code: @abr.zip)).html_safe
- instructions_1 = t("txt.abr.splash.instructions_1", state_name: @abr.home_state_name, lookup_url: new_catalist_lookup_path(partner: @abr.partner_id, email: @abr.email, zip: @abr.zip), registration_url: new_registrant_path(partner: @abr.partner, email_address: @abr.email, home_zip_code: @abr.zip))
= instructions_1.html_safe

- if @abr.home_state_oabr_url.present?
%a{ href: @abr.home_state_oabr_url, style: "word-wrap: break-word; overflow-wrap: break-word; display: inline-block;" }= @abr.home_state_oabr_url
- else
%p No URL available at this time.

%h2{role: "heading", "aria-level": 2, id: "abr_splash_header_2"}= t("txt.abr.splash.header_2").html_safe

-# The following instructions are coming from:
-# = t("states.custom.#{abbrev}.abr.splash.instructions_1", state_name: @abr.home_state_name, lookup_url: new_catalist_lookup_path(partner: @abr.partner_id, email: @abr.email, zip: @abr.zip), registration_url: new_registrant_path(partner: @abr.partner, email_address: @abr.email, home_zip_code: @abr.zip))

-#%h2{role: "heading", "aria-level": 2, id: "abr_splash_header_2"}= t("txt.abr.splash.header_2").html_safe
-# The following header is coming from:
-# = t("txt.abr.splash.header_2")

.state-instructions
= t("states.custom.#{abbrev}.abr.splash.instructions_2", state_name: @abr.home_state_name, registration_url: new_registrant_path(partner: @abr.partner, email_address: @abr.email, home_zip_code: @abr.zip)).html_safe
- instructions_2 = t("states.custom.#{abbrev}.abr.splash.instructions_2", state_name: @abr.home_state_name, registration_url: new_registrant_path(partner: @abr.partner, email_address: @abr.email, home_zip_code: @abr.zip))
= instructions_2.html_safe
-# The following instructions are coming from:
-# = t("states.custom.#{abbrev}.abr.splash.instructions_2", state_name: @abr.home_state_name, registration_url: new_registrant_path(partner: @abr.partner, email_address: @abr.email, home_zip_code: @abr.zip))

%h2{role: "heading", "aria-level": 2, id: "abr_splash_header_3"}= t("txt.abr.splash.header_3").html_safe
-# Don't Forget to Vote!
-#%h2{role: "heading", "aria-level": 2, id: "abr_splash_header_3"}= t("txt.abr.splash.header_3").html_safe
-# The following header is coming from:
-# = t("txt.abr.splash.header_3")

.state-instructions
= t("states.custom.#{abbrev}.abr.splash.instructions_3", state_name: @abr.home_state_name, registration_url: new_registrant_path(partner: @abr.partner, email_address: @abr.email, home_zip_code: @abr.zip)).html_safe
- instructions_3 = t("states.custom.#{abbrev}.abr.splash.instructions_3", state_name: @abr.home_state_name, registration_url: new_registrant_path(partner: @abr.partner, email_address: @abr.email, home_zip_code: @abr.zip))
= instructions_3.html_safe
-# The following instructions are coming from:
-# = t("states.custom.#{abbrev}.abr.splash.instructions_3", state_name: @abr.home_state_name, registration_url: new_registrant_path(partner: @abr.partner, email_address: @abr.email, home_zip_code: @abr.zip))


-# #finish_page_iframe
-# %iframe{border: '0', height: "575px", "ALLOWTRANSPARENCY": true, frameborder: "no", style: 'border:none !important; margin:0; padding:0; width:100%;', src: @abr_finish_iframe_url }
Expand All @@ -22,7 +47,7 @@
- existing_locale = src_url.match(/(\?|&)locale=([^&]*)/)&.captures&.last || I18n.locale
- src_url = src_url.gsub(/(\?|&)locale=[^&]*/, '') # Remove any existing locale parameter
- src_url += src_url.include?('?') ? "&locale=#{existing_locale}" : "?locale=#{existing_locale}" # Append the new locale
%iframe#dynamicLocaleIframe{border: '0', height: "575px", "ALLOWTRANSPARENCY": true, frameborder: "no", style: 'border:none !important; margin:0; padding:0; width:100%;', src: src_url }
%iframe#dynamicLocaleIframe{border: '0', height: "575px", "ALLOWTRANSPARENCY": true, frameborder: "no", style: 'border:none !important; margin:40px 0 0 0; padding:0; width:100%;', src: src_url }

:javascript
document.addEventListener('DOMContentLoaded', function () {
Expand Down
4 changes: 3 additions & 1 deletion app/views/notifier/chaser.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
:cancel_reminders_url =>@cancel_reminders_url,
:registrar_phone=> @registrar_phone,
:registrar_url=>@registrar_url,
:rtv_link=>@rtv_link, :locale => @locale
:rtv_link=>@rtv_link,
:rtv_url=>Nokogiri::HTML(@rtv_link).css('a').first['href'],
:locale => @locale
).html_safe %>
</div>
10 changes: 5 additions & 5 deletions app/views/notifier/partner_terms_of_use.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<div style="max-width: 700px; margin: 0 auto;">
<p>Hi <%= @name %>,</p>
<p>
Thank you for signing up for a Rock the Vote civic technology tool! We're so glad to have you join our community of companies, nonprofits, and activists nationwide who use Rock the Vote's platform to register voters.
Thank you for signing up for Rock the Vote's civic technology tools! We're so glad to have you join our community of companies, nonprofits, and activists nationwide who use Rock the Vote's platform to register and mobilize voters.
</p>
<p>
Please read Rock the Vote's <a href="<%= @tou_url %>">Terms of Use</a> which outlines important information about our <a href="<%= @privacy_url %>">Privacy Policy</a>, restrictions on digital advertising, custom branding, and more. Rock the Vote reserves the right to discontinue access to your tool if there is a breach to our Terms of Use.
</p>
<p>
To learn more about how to use your civic technology tools, please read our <a href="<%= @partner_tool_faqs %>">Partner FAQs</a>. Thank you for your partnership in this important work! If you have any questions, please don't hesitate to reach out.
Our team will reach out soon with information on how to access your tools and Partner Portal. Thank you for your partnership in this important work!
</p>
<p></p>
<p>
- Rock the Vote
</p>
<p>
Note: Your civic technology partnership agreement contains important information about our Terms of Use. Rock the Vote reserves the right to discontinue access to your tool if there is a breach to the terms of your agreement.
</p>
</div>
3 changes: 2 additions & 1 deletion app/views/registrants/_race_and_party.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
</li>
</ul>
<% end %>
<% if @state_parties && @state_parties.any? %>

<% if @registrant.home_state_abbrev != "NC" && @state_parties && @state_parties.any? %>
<ul class="flat party-dropdown">
<li class='registrant-form__party__line'>
<h3><%= form.label :party %><%- if @registrant.requires_party? %><span class='required'>*<span class='required--text' style='display:none;'><%= I18n.t('required') %></span></span><%- end %></h3>
Expand Down
4 changes: 2 additions & 2 deletions app/views/registrants/registrant_pdf.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@
%p= @registrant.registration_deadline.to_s.html_safe
%tr
%td.other_block
%h4.title= I18n.t('pdf.nvra.page1.other_block', :instructions_url=>@registrant_instructions_link).to_s.html_safe
- if [email protected]_state_pdf_other_instructions.blank?
.state_instructions
%p= @registrant.home_state_pdf_other_instructions.to_s.html_safe
%h4.title= I18n.t('pdf.nvra.page1.other_block', :instructions_url=>@registrant_instructions_link).to_s.html_safe
- if @for_printer
%p= I18n.t('pdf.nvra.page1.ep_hotline').to_s.html_safe
%h3.bottom_title= I18n.t('pdf.nvra.page1.bottom_block.title' ).to_s.html_safe
%p= I18n.t('pdf.nvra.page1.bottom_block.paragraph1' ).to_s.html_safe
%p= I18n.t('pdf.nvra.page1.bottom_block.paragraph2' ).to_s.html_safe
%p= I18n.t('pdf.nvra.page1.bottom_block.paragraph3' ).to_s.html_safe
%p{ style: "margin-left: 40px;" }= I18n.t('pdf.nvra.page1.bottom_block.paragraph3').to_s.html_safe
%p= I18n.t('pdf.nvra.page1.bottom_block.paragraph4' ).to_s.html_safe

.page#page_2
Expand Down
17 changes: 11 additions & 6 deletions config/locales/email/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,17 @@ en:
subject: You can still register to vote
body:
main: |-
Hey%{registrant_first_name_with_space},<br><br>
I noticed that you didn’t finish filling out your online voter registration form. Registering with %{registrant_rtv_and_partner_name}'s online tool takes less time than it takes to...<br>
Snap your friends<br> Learn the latest TikTok dance<br> Listen to a Beyoncé song<br><br>
We want you to be part of our vast community of empowered voters. Amplify your voice today by finishing the registration process and making sure you are ready for the next election!<br><br>
%{registrant_rtv_and_partner_name}<br><br>
%{rtv_link}
We noticed that you didn't finish your voter registration application, and we
want to make sure your voice is heard in upcoming elections.<br><br>
Registering to vote takes less time than it takes to...<br><br>
Post on Instagram<br>
Watch a TikTok video<br>
Stream your favorite song<br><br>
<a href="%{rtv_url}">Complete your voter registration application now →</a><br><br>
We want you to be part of our vast community of empowered voters.
<a href="%{rtv_url}">Finish the registration process today</a> and make sure
you’re ready for the next election!<br><br>
%{registrant_rtv_and_partner_name}<br>
thank_you_external:
subject: Thanks for beginning the voter registration process
body:
Expand Down
6 changes: 3 additions & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ en:
requested_duplicate_dln_today: Have you applied for a duplicate driver’s license
or state ID today?
confirm_us_citizen: I am a United States citizen.
confirm_will_be_18: I am at least 17.5 years old and will vote only after
confirm_will_be_18: I am at least 16 years old and will vote only after
I am 18.
is_30_day_resident: I am a Michigan resident and will vote only after I have
lived in my city or township for at least 30 days.
Expand Down Expand Up @@ -771,8 +771,8 @@ en:
email_invalid: Email is not valid.
password_blank: Password can not be blank.
password_invalid: Login/password combination is not valid.
not_active: Your account is not active. Please contact <a href="mailto:[email protected]">[email protected]</a>
to re-activate your account.
not_active: This account is not active. Accounts are deactivated after 90 days of inactivity or if your licensing agreement has lapsed. Please contact <a href="mailto:[email protected]">[email protected]</a>
to reactivate your account.
not_confirmed: Your account is not confirmed.
not_approved: Your account is not approved.
no_authentication_details: You did not provide any details for authentication.
Expand Down
40 changes: 24 additions & 16 deletions config/locales/pdf/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,35 @@ en:
title: ! 'SUBMIT YOUR COMPLETED, SIGNED FORM TO:'
deadline_block:
title: ! 'MAIL-IN REGISTRATION DEADLINE:'
other_block: You must read %{instructions_url} for complete general and state-specific
instructions, including eligibility requirements.
other_block: |-
YOU MUST READ<br>
<a href="https://www.eac.gov/voters/national-mail-voter-registration-form">
https://www.eac.gov/voters/national-mail-voter-registration-form</a><br>
FOR COMPLETE GENERAL AND STATE-SPECIFIC INSTRUCTIONS, INCLUDING ELIGIBILITY
REQUIREMENTS.
ep_hotline: ! '<strong>QUESTIONS?</strong><br/>
ELECTION PROTECTION HOTLINE:<br/>
(866) OUR-VOTE — (866) 687-8683'
bottom_block:
title: FIRST TIME VOTERS WHO REGISTER BY MAIL
paragraph1: ! 'If you are registering to vote for the first time in your
jurisdiction and are mailing this registration application, Federal law
requires you to show proof of identification the first time you vote.
Proof of identification includes: A current and valid photo identification
or a current utility bill, bank statement, government check, paycheck,
or government document that shows your name and address.'
paragraph2: Voters may be exempt from this requirement if they submit a
copy of this identification with their mail in voter registration form.
paragraph3: ! 'If you wish to submit a copy, please keep the following in
mind: Your state may have additional identification requirements which
may mandate you show identification at the polling place even if you meet
the Federal proof of identification.'
paragraph4: Do not submit original documents with this application, only
copies.
paragraph1: |-
<b>Please note that your state may have additional voter ID requirements, in
addition to what's described below.</b>
paragraph2: |-
If you are voting for the first time in your state and registered by mail,
federal law may require you to show proof of identification the first time you
vote in a federal election.  This proof of identification includes showing the
following (or if voting a mail ballot, including a COPY of the following):
paragraph3: |-
- A current and valid photo identification; OR <br>
- A current utility bill, bank statement, government check, <br>
paycheck or government document that shows your name and address.
paragraph4: |-
Federal law does not require you to show proof of identification at the
polling location or when voting a mail ballot if (1) you provided a copy of
one of the above with your National Mail Voter Registration Form; or (2) your
voter registration form has been validated by an election official; or (3) you
are entitled by federal law to vote by absentee ballot.
page2:
title: Voter Registration Application
subtitle: Before completing this form, review the General, Application, and
Expand Down
Loading