Browse Source

Move back link to before_content

pull/21/head
baarkerlounger 4 years ago
parent
commit
ab28996e83
  1. 2
      app/views/form/questions/previous_housing_situation.html.erb
  2. 2
      app/views/form/questions/tenant_age.html.erb
  3. 8
      app/views/form/questions/tenant_code.html.erb
  4. 2
      app/views/form/questions/tenant_gender.html.erb
  5. 2
      spec/features/case_log_spec.rb

2
app/views/form/questions/previous_housing_situation.html.erb

@ -25,9 +25,11 @@
] %> ] %>
<% previous_question = Form.previous_question("previous_housing_situation") %> <% previous_question = Form.previous_question("previous_housing_situation") %>
<% content_for :before_content do %>
<%= govuk_back_link href: "/case_logs/#{case_log_id}/#{previous_question}" do %> <%= govuk_back_link href: "/case_logs/#{case_log_id}/#{previous_question}" do %>
Back Back
<% end %> <% end %>
<% end %>
<%= turbo_frame_tag "case_log_form", target: "_top" do %> <%= turbo_frame_tag "case_log_form", target: "_top" do %>
<%= form_with action: '/case_logs', method: "next_question", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> <%= form_with action: '/case_logs', method: "next_question", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>

2
app/views/form/questions/tenant_age.html.erb

@ -1,7 +1,9 @@
<% previous_question = Form.previous_question("tenant_age") %> <% previous_question = Form.previous_question("tenant_age") %>
<% content_for :before_content do %>
<%= govuk_back_link href: "/case_logs/#{case_log_id}/#{previous_question}" do %> <%= govuk_back_link href: "/case_logs/#{case_log_id}/#{previous_question}" do %>
Back Back
<% end %> <% end %>
<% end %>
<%= turbo_frame_tag "case_log_form", target: "_top" do %> <%= turbo_frame_tag "case_log_form", target: "_top" do %>
<%= form_with action: '/case_logs', method: "next_question", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> <%= form_with action: '/case_logs', method: "next_question", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>

8
app/views/form/questions/tenant_code.html.erb

@ -1,5 +1,11 @@
<% previous_question = Form.previous_question("tenant_code") %>
<% content_for :before_content do %>
<%= govuk_back_link href: "/case_logs/#{case_log_id}/#{previous_question}" do %>
Back
<% end %>
<% end %>
<%= turbo_frame_tag "case_log_form", target: "_top" do %> <%= turbo_frame_tag "case_log_form", target: "_top" do %>
<%= render GovukComponent::BackLinkComponent.new(href: "/case_logs/#{case_log_id}", text: 'Back') do %><% end %>
<%= form_with action: '/case_logs', method: "next_question", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> <%= form_with action: '/case_logs', method: "next_question", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<%= f.govuk_text_field :tenant_code, <%= f.govuk_text_field :tenant_code,
hint: { text: "More detail" }, hint: { text: "More detail" },

2
app/views/form/questions/tenant_gender.html.erb

@ -6,9 +6,11 @@
] %> ] %>
<% previous_question = Form.previous_question("tenant_gender") %> <% previous_question = Form.previous_question("tenant_gender") %>
<% content_for :before_content do %>
<%= govuk_back_link href: "/case_logs/#{case_log_id}/#{previous_question}" do %> <%= govuk_back_link href: "/case_logs/#{case_log_id}/#{previous_question}" do %>
Back Back
<% end %> <% end %>
<% end %>
<%= turbo_frame_tag "case_log_form", target: "_top" do %> <%= turbo_frame_tag "case_log_form", target: "_top" do %>
<%= form_with action: '/case_logs', method: "next_question", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> <%= form_with action: '/case_logs', method: "next_question", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>

2
spec/features/case_log_spec.rb

@ -38,7 +38,6 @@ RSpec.describe "Test Features" do
expect(page).to have_field("tenant-age-field") expect(page).to have_field("tenant-age-field")
end end
end end
end
describe "Back link directs correctly" do describe "Back link directs correctly" do
it "go back to tasklist page from tenant code" do it "go back to tasklist page from tenant code" do
@ -54,3 +53,4 @@ RSpec.describe "Test Features" do
end end
end end
end end
end

Loading…
Cancel
Save