From 1ba53edd3e6db034d601bf26e7f64c20916353b1 Mon Sep 17 00:00:00 2001 From: Zuzana Date: Sat, 7 Oct 2023 17:18:34 +0200 Subject: [PATCH] added Go Back button to pages where missing --- .../apps/parliament_vote_app/application_form.rb | 15 ++++++++++++--- .../application_forms/delivery.html.erb | 1 + .../application_forms/permanent_resident.erb | 1 + .../application_forms/sk_citizen.html.erb | 1 + db/seeds.rb | 1 - 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/models/apps/parliament_vote_app/application_form.rb b/app/models/apps/parliament_vote_app/application_form.rb index 228d3cc2..0f52e4ef 100644 --- a/app/models/apps/parliament_vote_app/application_form.rb +++ b/app/models/apps/parliament_vote_app/application_form.rb @@ -220,7 +220,10 @@ def run(listener) end private def sk_citizen_step(listener) - if valid?(:sk_citizen) + if go_back? + self.step = 'start' + listener.render :start + elsif valid?(:sk_citizen) case sk_citizen when 'yes' self.step = 'permanent_resident' @@ -234,7 +237,10 @@ def run(listener) end private def permanent_resident_step(listener) - if valid?(:permanent_resident) + if go_back? + self.step = 'sk_citizen' + listener.render :sk_citizen + elsif valid?(:permanent_resident) case permanent_resident when 'yes' self.step = 'place' @@ -269,7 +275,10 @@ def run(listener) # Home flow private def delivery_step(listener) - if valid?(:delivery) + if go_back? + self.step = 'place' + listener.render :place + elsif valid?(:delivery) case delivery when 'post' self.step = 'identity' diff --git a/app/views/apps/parliament_vote_app/application_forms/delivery.html.erb b/app/views/apps/parliament_vote_app/application_forms/delivery.html.erb index e5dba084..c12958e2 100644 --- a/app/views/apps/parliament_vote_app/application_forms/delivery.html.erb +++ b/app/views/apps/parliament_vote_app/application_forms/delivery.html.erb @@ -10,6 +10,7 @@ <%= render 'apps/parliament_vote_app/application_forms/subscribe' %> <% else %> <%= form_for @application_form, :builder => AppFormBuilder, url: request.original_url do |f| %> + <%= render 'apps/parliament_vote_app/application_forms/back', form: f %> <%= render 'components/error_summary', form: @application_form %> <%= f.hidden_field :step %> <%= f.hidden_field :sk_citizen %> diff --git a/app/views/apps/parliament_vote_app/application_forms/permanent_resident.erb b/app/views/apps/parliament_vote_app/application_forms/permanent_resident.erb index 05269977..f2ebf44d 100644 --- a/app/views/apps/parliament_vote_app/application_forms/permanent_resident.erb +++ b/app/views/apps/parliament_vote_app/application_forms/permanent_resident.erb @@ -4,6 +4,7 @@
<%= form_for @application_form, :builder => AppFormBuilder, url: request.original_url do |f| %> + <%= render 'apps/parliament_vote_app/application_forms/back', form: f %> <%= render 'components/error_summary', form: @application_form %> <%= f.hidden_field :step %> <%= f.radios :permanent_resident, 'Máte trvalý pobyt na Slovensku?' do %> diff --git a/app/views/apps/parliament_vote_app/application_forms/sk_citizen.html.erb b/app/views/apps/parliament_vote_app/application_forms/sk_citizen.html.erb index 37355fa2..e00a87aa 100644 --- a/app/views/apps/parliament_vote_app/application_forms/sk_citizen.html.erb +++ b/app/views/apps/parliament_vote_app/application_forms/sk_citizen.html.erb @@ -4,6 +4,7 @@
<%= form_for @application_form, :builder => AppFormBuilder, url: request.original_url do |f| %> + <%= render 'apps/parliament_vote_app/application_forms/back', form: f %> <%= render 'components/error_summary', form: @application_form %> <%= f.hidden_field :step %> <%= f.radios :sk_citizen, 'Ste občan Slovenskej republiky?', inline: true do %> diff --git a/db/seeds.rb b/db/seeds.rb index 52ae2d71..7ba0fd5e 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -23,7 +23,6 @@ position: 1, title: "Založenie živnosti", slug: "zalozenie-zivnosti", - short_description: "empty", description: "

Založenie živnosti: krok po kroku

Zistite, čo treba vybaviť na založenie živnosti.

Založenie živnosti zvyčajne trvá 5 až 10 pracovných dní.

",