-
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.
Merge branch 'master' into feature/eid-login
- Loading branch information
Showing
49 changed files
with
1,692 additions
and
471 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
51 changes: 34 additions & 17 deletions
51
app/controllers/apps/ep_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
47 changes: 47 additions & 0 deletions
47
app/controllers/apps/ep_vote_app_old/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,47 @@ | ||
class Apps::EpVoteAppOld::ApplicationFormsController < ApplicationController | ||
before_action :set_metadata, :check_inactive_eu_application | ||
|
||
def show | ||
@metadata.og.title = 'Voľby do Európskeho parlamentu' | ||
|
||
@application_form = Apps::EpVoteAppOld::ApplicationForm.new( | ||
step: 'start' | ||
) | ||
render 'start' | ||
end | ||
|
||
def create | ||
@application_form = Apps::EpVoteAppOld::ApplicationForm.new(form_params) | ||
@application_form.run(self) | ||
end | ||
|
||
def end | ||
end | ||
|
||
private | ||
|
||
def form_params | ||
params.require(:apps_ep_vote_app_old_application_form).permit( | ||
:step, | ||
:place, | ||
:sk_citizen, | ||
:delivery, | ||
:full_name, :pin, :nationality, | ||
:street, :pobox, :municipality, | ||
:same_delivery_address, | ||
:delivery_street, :delivery_pobox, :delivery_municipality, :delivery_country, | ||
:municipality_email | ||
) | ||
end | ||
|
||
def set_metadata | ||
@metadata.og.image = 'og-ep-vote-app.png' | ||
@metadata.og.description = 'Zistite kde a ako môžete voliť. Vybavte si hlasovací preukaz.' | ||
end | ||
|
||
def check_inactive_eu_application | ||
return if Apps::EpVoteAppOld::ApplicationForm.active? | ||
return redirect_to apps_ep_vote_app_old_application_forms_path if action_name != "show" | ||
render 'inactive' | ||
end | ||
end |
Oops, something went wrong.