-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add is number validation to vote app * fix syntax * fix: go back button (#622) * added Go Back button to pages where missing * fix: test in spec/features/apps/parliament_vote_app_spec.rb * add ux tweaks and rewords based on ux recommendations * add president_vote_app * udpate date calculation in president vote app * change president election app email addresses sheet * disable birth number validation * use checkboxes instead of radios on place selection * update president app after testing * minor wording update * add minor text hint to place selection * revert unwanted changes * rm email client button from auth person send * add tests and refactor a bit * rm unused code * magically fix parliament vote app tests * make checkbox labels clickable * fix conditionally revealing address option --------- Co-authored-by: zuzana <zuza.har@gmail.com>
- Loading branch information
1 parent
4d9e19e
commit 45eb0cc
Showing
35 changed files
with
1,548 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
app/controllers/apps/president_vote_app/application_forms_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
class Apps::PresidentVoteApp::ApplicationFormsController < ApplicationController | ||
helper FormatDaysHelper | ||
before_action :set_metadata, :check_inactive_president_application | ||
before_action :disable_feedback, only: [:show, :delivery, :create] | ||
|
||
def show | ||
render_step('start') | ||
end | ||
|
||
def delivery | ||
return render_self if request.post? | ||
render_step('delivery') | ||
end | ||
|
||
def permanent_resident | ||
return render_self if request.post? | ||
render_step('permanent_resident') | ||
end | ||
|
||
def create | ||
render_self | ||
end | ||
|
||
private def render_self | ||
@application_form = Apps::PresidentVoteApp::ApplicationForm.new(form_params) | ||
@application_form.run(self) | ||
end | ||
|
||
private def render_step(step) | ||
@application_form = Apps::PresidentVoteApp::ApplicationForm.new(step: step) | ||
render step | ||
end | ||
|
||
private def form_params | ||
params.require(:apps_president_vote_app_application_form).permit( | ||
:step, | ||
:place_first_round, | ||
:place_second_round, | ||
:sk_citizen, | ||
:delivery, | ||
:full_name, :pin, :nationality, :maiden_name, | ||
:authorized_person_full_name, :authorized_person_pin, | ||
:street, :pobox, :municipality, | ||
:same_delivery_address, | ||
:delivery_street, :delivery_pobox, :delivery_municipality, :delivery_country, | ||
:municipality_email, | ||
:municipality_email_verified, | ||
:permanent_resident, | ||
:back | ||
) | ||
end | ||
|
||
private def set_metadata | ||
@metadata.og.title = 'Žiadosť o hlasovací preukaz' | ||
@metadata.og.image = 'facebook_share_2020.png' | ||
@metadata.og.description = 'Aj keď budete počas volieb mimo trvalého pobytu, voliť sa dá. Stačí požiadať.' | ||
end | ||
|
||
private def check_inactive_president_application | ||
return if Apps::PresidentVoteApp::ApplicationForm.active? | ||
return redirect_to apps_president_vote_app_application_forms_path if action_name != "show" | ||
render 'inactive' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.