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| %>
<% row.key { attr[:name] } %>
<%= row.value do %>
<% case attr[:attribute]
when "status"
status_tag(attr[:value])
when "availability"
<% if attr[:attribute] == "availability"
details_html(name: "Availability", value: @location.startdate.present? ? @location.startdate.to_formatted_s(:govuk_date) : nil, attribute: "startdate")
else
details_html(attr)
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 %>

Loading…
Cancel
Save