Skip to content

Commit

Permalink
update vote preukaz
Browse files Browse the repository at this point in the history
  • Loading branch information
celuchmarek committed Aug 7, 2023
1 parent 8626167 commit c2c8879
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,34 @@

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-xl">Zaslanie žiadosti na úrad</h1>
<h1 class="govuk-heading-xl">Pošlite žiadosť na úrad</h1>

<% if @application_form.municipality_email.present? %>
Otvorte
<%= mail_to @application_form.municipality_email, 'pripravenú žiadosť v emailovom klientovi'.html_safe,
target: '_blank',
body: @application_form.from_slovakia_authorized_person_email_body,
subject: 'Žiadosť o hlasovací preukaz do parlamentých volieb.'
%>
alebo ju manuálne
<a href="#" onclick="document.getElementById('conditional-manual').style.display = 'block'; return false;">skopírujte</a>.
<% end %>
<div id="conditional-manual"<% if @application_form.municipality_email.present? %> style="display: none;"<% end %>>
<p class="govuk-body-l">Skopírujte text žiadosti a pošlite ho na emailovú adresu obce.</p>
<div class="govuk-form-group">
<textarea onclick="this.focus();this.select();" rows="8" class="govuk-textarea"><%= @application_form.from_slovakia_authorized_person_email_body %></textarea>
</div>
</div>

<%= render 'municipality_email_warning' %>

<h3 class="govuk-heading-l">Pokyny</h3>
<ol class="govuk-list govuk-list--number govuk-!-font-size-24">
<li class="govuk-!-margin-bottom-4">
<% if @application_form.municipality_email.present? %>
Otvorte
<%= mail_to @application_form.municipality_email, 'pripravenú žiadosť v emailovom klientovi'.html_safe,
target: '_blank',
body: @application_form.from_slovakia_authorized_person_email_body,
subject: 'Žiadosť o hlasovací preukaz do parlamentých volieb.'
%>
alebo ju manuálne
<a href="#" onclick="document.getElementById('conditional-manual').style.display = 'block'; return false;">skopírujte</a>.
<% end %>
<div id="conditional-manual"<% if @application_form.municipality_email.present? %> style="display: none;"<% end %>>
<p class="govuk-body govuk-!-margin-top-5">Skopírujte text žiadosti.</p>
<div class="govuk-form-group">
<textarea onclick="this.focus();this.select();" rows="8" class="govuk-textarea"><%= @application_form.from_slovakia_authorized_person_email_body %></textarea>
</div>
</div>
</li>
<li class="govuk-!-margin-bottom-4">
Odošlite na emailovú adresu obce<% if @application_form.municipality_email.present? %> <strong><%= @application_form.municipality_email %></strong><% end %>.
</li>
<li>
A potom <%= link_to 'pokračujte ďalej', end_apps_parliament_vote_app_application_forms_url %>.
</li>
</ol>
<div class="govuk-checkboxes__item">
<input class="govuk-checkboxes__input" id="waste" name="waste" type="checkbox" value="carcasses" onchange="document.getElementById('nextButton').disabled = !this.checked;">
<label class="govuk-label govuk-checkboxes__label" for="waste">Poslal/a som žiadosť na úrad</label>
</div>

<%= form_with url: end_apps_parliament_vote_app_application_forms_url, method: :get, local: true do |form| %>
<%= form.submit 'Pokračovať', id: 'nextButton', class: 'govuk-button govuk-!-margin-top-5', disabled: true %>
<% end %>
</div>
</div>
54 changes: 26 additions & 28 deletions app/views/apps/parliament_vote_app/application_forms/send.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,34 @@

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-xl">Zaslanie žiadosti na úrad</h1>
<h1 class="govuk-heading-xl">Pošlite žiadosť na úrad</h1>

<% if @application_form.municipality_email.present? %>
Otvorte
<%= mail_to @application_form.municipality_email, 'pripravenú žiadosť v emailovom klientovi'.html_safe,
target: '_blank',
body: @application_form.from_slovakia_email_body,
subject: 'Žiadosť o hlasovací preukaz do parlamentých volieb.'
%>
alebo ju manuálne
<a href="#" onclick="document.getElementById('conditional-manual').style.display = 'block'; return false;">skopírujte</a>.
<% end %>
<div id="conditional-manual"<% if @application_form.municipality_email.present? %> style="display: none;"<% end %>>
<p class="govuk-body-l">Skopírujte text žiadosti a pošlite ho na emailovú adresu obce.</p>
<div class="govuk-form-group">
<textarea onclick="this.focus();this.select();" rows="8" class="govuk-textarea"><%= @application_form.from_slovakia_email_body %></textarea>
</div>
</div>

<%= render 'municipality_email_warning' %>

<h2 class="govuk-heading-l">Pokyny</h2>
<ol class="govuk-list govuk-list--number govuk-!-font-size-24">
<li class="govuk-!-margin-bottom-4">
<% if @application_form.municipality_email.present? %>
Ak máte na zariadení emailového klienta,
<%= mail_to @application_form.municipality_email, 'kliknutím tu priamo otvorte pripravenú žiadosť. '.html_safe,
target: '_blank',
body: @application_form.from_slovakia_email_body,
subject: 'Žiadosť o hlasovací preukaz do parlamentných volieb.'
%>
Alternatívne kliknutím
<a href="#" onclick="document.getElementById('conditional-manual').style.display = 'block'; return false;">tu žiadosť zobrazte</a> a manuálne ju skopírujte do tela emailu.
<% end %>
<div id="conditional-manual"<% if @application_form.municipality_email.present? %> style="display: none;"<% end %>>
<p class="govuk-body govuk-!-margin-top-5">Skopírujte text žiadosti.</p>
<div class="govuk-form-group">
<textarea onclick="this.focus();this.select();" rows="8" class="govuk-textarea"><%= @application_form.from_slovakia_email_body %></textarea>
</div>
</div>
</li>
<li class="govuk-!-margin-bottom-4">
Odošlite na emailovú adresu obce<% if @application_form.municipality_email.present? %> <strong><%= @application_form.municipality_email %></strong><% end %>.
</li>
<li>
A potom <%= link_to 'pokračujte ďalej', end_apps_parliament_vote_app_application_forms_url %>.
</li>
</ol>
<div class="govuk-checkboxes__item">
<input class="govuk-checkboxes__input" id="waste" name="waste" type="checkbox" value="carcasses" onchange="document.getElementById('nextButton').disabled = !this.checked;">
<label class="govuk-label govuk-checkboxes__label" for="waste">Poslal/a som žiadosť na úrad</label>
</div>

<%= form_with url: end_apps_parliament_vote_app_application_forms_url, method: :get, local: true do |form| %>
<%= form.submit 'Pokračovať', id: 'nextButton', class: 'govuk-button govuk-!-margin-top-5', disabled: true %>
<% end %>
</div>
</div>
146 changes: 73 additions & 73 deletions spec/features/apps/parliament_vote_app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,54 +25,56 @@ def start

expect(page).to have_content('Potrebujete požiadať o hlasovací preukaz')
expect(page).to have_content('Aby ste mohli v deň volieb voliť mimo vášho trvalého bydliska, musíte požiadať vašu obec o vydanie hlasovacieho preukazu – osobne alebo elektronicky. Hlasovací preukaz vás oprávňuje voliť z ktoréhokoľvek volebného okrsku v SR.')
expect(page).to have_content('Obce potrebné informácie k žiadostiam v súčastnosti ešte len zverejňujú, ak nám však necháte email, dáme Vám vedieť, keď už bude možné o hlasovací preukaz požiadať. Posledný termín na zaslanie žiadosti je 8. septembra.')
expect(page).to have_content('Ako prevezmete hlasovací preukaz?')
expect(page).to have_content('Poštou')
expect(page).to have_content('Vyzdvihne ho za mňa iná osoba')
expect(page).to have_content('Osobne na úrade')
end

# TODO: /app/views/apps/parliament_vote_app/application_forms/delivery.html.erb:13 "else"
# scenario 'As a citizen I want to request voting permit personally after the deadline' do
# travel_to Apps::ParliamentVoteApp::ApplicationForm::PICKUP_DEADLINE_DATE + 1.day
# start
# choose 'Áno'
# click_button 'Pokračovať'
scenario 'As a citizen I want to request voting permit personally after the deadline' do
travel_to Apps::ParliamentVoteApp::ApplicationForm::PICKUP_DEADLINE_DATE + 1.day
start
choose 'Áno'
click_button 'Pokračovať'

# choose 'Áno'
# click_button 'Pokračovať'
choose 'Áno'
click_button 'Pokračovať'

# choose 'Na Slovensku, mimo trvalého bydliska'
# click_button 'Pokračovať'
choose 'Na Slovensku, mimo trvalého bydliska'
click_button 'Pokračovať'

# expect(page).to have_field('Osobne na úrade', disabled: true)
# end
expect(page).to have_field('Osobne na úrade', disabled: true)
end

# scenario 'As a citizen I want to request voting permit by authorized person after the deadline' do
# travel_to Apps::ParliamentVoteApp::ApplicationForm::PICKUP_DEADLINE_DATE + 1.day
# start
# choose 'Áno'
# click_button 'Pokračovať'
scenario 'As a citizen I want to request voting permit by authorized person after the deadline' do
travel_to Apps::ParliamentVoteApp::ApplicationForm::PICKUP_DEADLINE_DATE + 1.day
start
choose 'Áno'
click_button 'Pokračovať'

# choose 'Áno'
# click_button 'Pokračovať'
choose 'Áno'
click_button 'Pokračovať'

# choose 'Na Slovensku, mimo trvalého bydliska'
# click_button 'Pokračovať'
choose 'Na Slovensku, mimo trvalého bydliska'
click_button 'Pokračovať'

# expect(page).to have_field('Vyzdvihne ho za mňa iná osoba', disabled: true)
# end
expect(page).to have_field('Vyzdvihne ho za mňa iná osoba', disabled: true)
end

# scenario 'As a citizen I want to request voting permit by post after the deadline' do
# travel_to Apps::ParliamentVoteApp::ApplicationForm::DELIVERY_BY_POST_DEADLINE_DATE + 1.day
# start
# choose 'Áno'
# click_button 'Pokračovať'
scenario 'As a citizen I want to request voting permit by post after the deadline' do
travel_to Apps::ParliamentVoteApp::ApplicationForm::DELIVERY_BY_POST_DEADLINE_DATE + 1.day
start
choose 'Áno'
click_button 'Pokračovať'

# choose 'Áno'
# click_button 'Pokračovať'
choose 'Áno'
click_button 'Pokračovať'

# choose 'Na Slovensku, mimo trvalého bydliska'
# click_button 'Pokračovať'
choose 'Na Slovensku, mimo trvalého bydliska'
click_button 'Pokračovať'

# expect(page).to have_field('Poštou', disabled: true)
# end
expect(page).to have_field('Poštou', disabled: true)
end

scenario 'As a pernament citizen with I want to vote by post after the deadline' do
travel_to Apps::ParliamentVoteApp::ApplicationForm::VOTE_BY_POST_DEADLINE_DATE + 1.day
Expand Down Expand Up @@ -101,55 +103,53 @@ def start
expect(page).to have_content('Termín na zaslanie žiadosti o voľbu poštou uplynul 9. augusta')
end

# # TODO: /app/views/apps/parliament_vote_app/application_forms/delivery.html.erb:13 "else"
# scenario 'As a citizen I want to request voting permit personally' do
# start
# choose 'Áno'
# click_button 'Pokračovať'
scenario 'As a citizen I want to request voting permit personally' do
start
choose 'Áno'
click_button 'Pokračovať'

# choose 'Áno'
# click_button 'Pokračovať'
choose 'Áno'
click_button 'Pokračovať'

# choose 'Na Slovensku, mimo trvalého bydliska'
# click_button 'Pokračovať'
choose 'Na Slovensku, mimo trvalého bydliska'
click_button 'Pokračovať'

# choose 'Osobne'
# click_button 'Pokračovať'
choose 'Osobne'
click_button 'Pokračovať'

# expect(page).to have_content('Prevzatie hlasovacieho preukazu osobne')
# end
expect(page).to have_content('Prevzatie hlasovacieho preukazu osobne')
end

# scenario 'As a citizen I want to request voting permit via authorized person' do
# start
# choose 'Áno'
# click_button 'Pokračovať'
scenario 'As a citizen I want to request voting permit via authorized person' do
start
choose 'Áno'
click_button 'Pokračovať'

# choose 'Áno'
# click_button 'Pokračovať'
choose 'Áno'
click_button 'Pokračovať'

# choose 'Na Slovensku, mimo trvalého bydliska'
# click_button 'Pokračovať'
choose 'Na Slovensku, mimo trvalého bydliska'
click_button 'Pokračovať'

# choose 'Vyzdvihne ho za mňa iná osoba'
# click_button 'Pokračovať'
choose 'Vyzdvihne ho za mňa iná osoba'
click_button 'Pokračovať'

# fill_in 'Meno, priezvisko, titul', with: 'Ferko Mrkva', class: 'person'
# fill_in 'Rodné číslo', with: '123', class: 'person'
# fill_in 'Ulica', with: 'Pupavova 31'
# fill_in 'PSČ', with: '456'
# fill_in 'Obec', with: 'Bratislava - Karlova ves'
# fill_in 'Meno, priezvisko, titul', with: 'Jarko Mrkva', class: 'authorized-person'
# fill_in 'Číslo občianskeho preukazu', with: '567', class: 'authorized-person'
# click_button 'Pokračovať'
fill_in 'Meno, priezvisko, titul', with: 'Ferko Mrkva', class: 'person'
fill_in 'Rodné číslo', with: '123', class: 'person'
fill_in 'Ulica', with: 'Pupavova 31'
fill_in 'PSČ', with: '456'
fill_in 'Obec', with: 'Bratislava - Karlova ves'
fill_in 'Meno, priezvisko, titul', with: 'Jarko Mrkva', class: 'authorized-person'
fill_in 'Číslo občianskeho preukazu', with: '567', class: 'authorized-person'
click_button 'Pokračovať'

# expect(page).to have_content('Meno: Ferko Mrkva')
# expect(page).to have_content('Rodné číslo: 123')
# expect(page).to have_content('Trvalý pobyt: Pupavova 31, 456 Bratislava - Karlova ves')
# expect(page).to have_content('Preukaz vyzdvihne splnomocnená osoba: Meno: Jarko Mrkva Číslo občianskeho preukazu: 567')
expect(page).to have_content('Meno: Ferko Mrkva')
expect(page).to have_content('Rodné číslo: 123')
expect(page).to have_content('Trvalý pobyt: Pupavova 31, 456 Bratislava - Karlova ves')
expect(page).to have_content('Preukaz vyzdvihne splnomocnená osoba: Meno: Jarko Mrkva Číslo občianskeho preukazu: 567')

# click_link 'pokračujte ďalej'
# expect(page).to have_content('Gratulujeme')
# end
check 'Poslal/a som žiadosť na úrad'
end

scenario 'As a citizen I want to vote at home address' do
start
Expand Down

0 comments on commit c2c8879

Please sign in to comment.