Skip to content

Commit

Permalink
added Go Back button to pages where missing
Browse files Browse the repository at this point in the history
  • Loading branch information
zuzana committed Oct 7, 2023
1 parent 514c266 commit 1ba53ed
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
15 changes: 12 additions & 3 deletions app/models/apps/parliament_vote_app/application_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= 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 %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= 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 %>
Expand Down
1 change: 0 additions & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
position: 1,
title: "Založenie živnosti",
slug: "zalozenie-zivnosti",
short_description: "empty",
description: "<h1>Založenie živnosti: krok po kroku</h1>
<p>Zistite, čo treba vybaviť na založenie živnosti.</p>
<p>Založenie živnosti zvyčajne trvá 5 až 10 pracovných dní.</p>",
Expand Down

0 comments on commit 1ba53ed

Please sign in to comment.