Browse Source

refactor: erblinting

pull/1034/head
natdeanlewissoftwire 4 years ago
parent
commit
911576574f
  1. 10
      app/views/locations/check_answers.html.erb
  2. 12
      app/views/locations/index.html.erb
  3. 4
      app/views/locations/local_authority.html.erb
  4. 5
      app/views/locations/name.html.erb
  5. 2
      app/views/locations/postcode.html.erb

10
app/views/locations/check_answers.html.erb

@ -5,11 +5,11 @@
<%= govuk_back_link(
text: "Back",
href: case params[:route]
when "locations"
scheme_locations_path(@scheme)
else
:back
end,
when "locations"
scheme_locations_path(@scheme)
else
:back
end,
) %>
<% end %>

12
app/views/locations/index.html.erb

@ -50,7 +50,11 @@
<% @locations.each do |location| %>
<%= table.body do |body| %>
<%= body.row do |row| %>
<% row.cell(text: simple_format(location_cell_postcode(location, location.confirmed ? scheme_location_path(@scheme, location) : location.postcode.present? ? scheme_location_check_answers_path(@scheme, location, route: "locations") : scheme_location_postcode_path(@scheme, location)), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %>
<% row.cell(text: simple_format(location_cell_postcode(location, if location.confirmed
scheme_location_path(@scheme, location)
else
location.postcode.present? ? scheme_location_check_answers_path(@scheme, location, route: "locations") : scheme_location_postcode_path(@scheme, location)
end), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %>
<% row.cell(text: location.id) %>
<% row.cell(text: status_tag(location.status)) %>
<% end %>
@ -95,7 +99,11 @@
<%= table.body do |body| %>
<%= body.row do |row| %>
<% row.cell(text: location.id) %>
<% row.cell(text: simple_format(location_cell_postcode(location, location.confirmed ? scheme_location_path(@scheme, location) : location.postcode.present? ? scheme_location_check_answers_path(@scheme, location, route: "locations") : scheme_location_postcode_path(@scheme, location)), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %>
<% row.cell(text: simple_format(location_cell_postcode(location, if location.confirmed
scheme_location_path(@scheme, location)
else
location.postcode.present? ? scheme_location_check_answers_path(@scheme, location, route: "locations") : scheme_location_postcode_path(@scheme, location)
end), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %>
<% row.cell(text: location.units) %>
<% row.cell do %>
<span><%= simple_format(location.type_of_unit) %></span>

4
app/views/locations/local_authority.html.erb

@ -8,7 +8,7 @@
scheme_location_check_answers_path(@scheme, @location, route: params[:route])
else
scheme_location_postcode_path(@scheme, @location, route: params[:route], referrer: params[:referrer])
end
end,
) %>
<% end %>
@ -27,7 +27,7 @@
"data-controller": %w[conditional-filter accessible-autocomplete] %>
<div class="govuk-button-group">
<% if params[:referrer] == "check_answers" || params[:referrer] == "check_local_authority"%>
<% if params[:referrer] == "check_answers" || params[:referrer] == "check_local_authority" %>
<%= f.govuk_submit "Save changes" %>
<%= govuk_button_link_to "Cancel", scheme_location_check_answers_path(@scheme, @location, route: params[:route]), secondary: true %>
<% else %>

5
app/views/locations/name.html.erb

@ -3,9 +3,10 @@
<% content_for :before_content do %>
<%= govuk_back_link(
text: "Back",
href: if params[:referrer] == "check_answers"
href: case params[:referrer]
when "check_answers"
scheme_location_check_answers_path(@scheme, @location, route: params[:route])
elsif params[:referrer] == "details"
when "details"
scheme_location_path(@scheme, @location)
else
scheme_location_postcode_path(@scheme, @location, route: params[:route])

2
app/views/locations/postcode.html.erb

@ -7,7 +7,7 @@
scheme_location_check_answers_path(@scheme, @location, route: params[:route])
else
scheme_locations_path(@scheme)
end
end,
) %>
<% end %>

Loading…
Cancel
Save