Skip to content

Commit

Permalink
fix old paths in eu old controller (#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
celuchmarek authored Apr 27, 2024
1 parent 9aba17b commit a9de1eb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ class Apps::EpVoteAppOld::ApplicationFormsController < ApplicationController
def show
@metadata.og.title = 'Voľby do Európskeho parlamentu'

@application_form = Apps::EpVoteApp::ApplicationForm.new(
@application_form = Apps::EpVoteAppOld::ApplicationForm.new(
step: 'start'
)
render 'start'
end

def create
@application_form = Apps::EpVoteApp::ApplicationForm.new(form_params)
@application_form = Apps::EpVoteAppOld::ApplicationForm.new(form_params)
@application_form.run(self)
end

Expand All @@ -21,7 +21,7 @@ def end
private

def form_params
params.require(:apps_ep_vote_app_application_form).permit(
params.require(:apps_ep_vote_app_old_application_form).permit(
:step,
:place,
:sk_citizen,
Expand All @@ -40,8 +40,8 @@ def set_metadata
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"
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}
</style>

<%= javascript_include_tag 'apps/ep_vote_app/libs.js', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'apps/ep_vote_app_old/libs.js', 'data-turbolinks-track': 'reload' %>
<script>
var municipalities = [];
var municipalityEmails = {};
Expand Down Expand Up @@ -84,8 +84,8 @@

accessibleAutocomplete({
element: document.getElementById('municipality-field'),
id: 'apps_ep_vote_app_application_form_municipality',
name: 'apps_ep_vote_app_application_form[municipality]',
id: 'apps_ep_vote_app_old_application_form_municipality',
name: 'apps_ep_vote_app_old_application_form[municipality]',
displayMenu: 'overlay',
showAllValues: true,
autoselect: true,
Expand Down Expand Up @@ -124,7 +124,7 @@
return 'Obec sa nenašla.'
},
onConfirm: function (value) {
document.querySelector('#apps_ep_vote_app_application_form_municipality_email').value = municipalityEmails[value] ? municipalityEmails[value] : '';
document.querySelector('#apps_ep_vote_app_old_application_form_municipality_email').value = municipalityEmails[value] ? municipalityEmails[value] : '';
}
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</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_ep_vote_app_application_forms_path %>.
<li>A potom <%= link_to 'pokračujte ďalej', end_apps_ep_vote_app_old_application_forms_path %>.
</li>
</ol>

Expand Down

0 comments on commit a9de1eb

Please sign in to comment.