Browse Source

refactor: remove redundant logic

pull/1034/head
natdeanlewissoftwire 4 years ago
parent
commit
e515667d81
  1. 7
      app/views/locations/check_answers.html.erb

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

@ -24,16 +24,13 @@
<%= summary_list.row do |row| %> <%= summary_list.row do |row| %>
<% row.key { attr[:name] } %> <% row.key { attr[:name] } %>
<%= row.value do %> <%= row.value do %>
<% case attr[:attribute] <% if attr[:attribute] == "availability"
when "status"
status_tag(attr[:value])
when "availability"
details_html(name: "Availability", value: @location.startdate.present? ? @location.startdate.to_formatted_s(:govuk_date) : nil, attribute: "startdate") details_html(name: "Availability", value: @location.startdate.present? ? @location.startdate.to_formatted_s(:govuk_date) : nil, attribute: "startdate")
else else
details_html(attr) details_html(attr)
end %> end %>
<% end %> <% end %>
<% row.action(text: action_text_helper(attr, @location), href: location_edit_path(@location, attr[:attribute])) unless attr[:attribute] == "status" %> <% row.action(text: action_text_helper(attr, @location), href: location_edit_path(@location, attr[:attribute]))%>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>

Loading…
Cancel
Save