Browse Source

refactor: erblinting

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

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>

2
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 %>

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