-
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.
Copy president vote app to new ep vote app (#646)
* copy president vote app to new ep app * old ep vote app do routes * add env check for ep apps * fix tests * fix tests * disable ep vote app tests
- Loading branch information
1 parent
edd6e08
commit 1230e7a
Showing
46 changed files
with
1,683 additions
and
462 deletions.
There are no files selected for viewing
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::EpVoteApp::ApplicationForm.new( | ||
step: 'start' | ||
) | ||
render 'start' | ||
end | ||
|
||
def create | ||
@application_form = Apps::EpVoteApp::ApplicationForm.new(form_params) | ||
@application_form.run(self) | ||
end | ||
|
||
def end | ||
end | ||
|
||
private | ||
|
||
def form_params | ||
params.require(:apps_ep_vote_app_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::EpVoteApp::ApplicationForm.active? | ||
return redirect_to apps_ep_vote_app_application_forms_path if action_name != "show" | ||
render 'inactive' | ||
end | ||
end |
Oops, something went wrong.