|
|
|
@ -18,14 +18,16 @@ |
|
|
|
<% next if %w[location_code status].include? attr[:attribute] %> |
|
|
|
<% next if %w[location_code status].include? attr[:attribute] %> |
|
|
|
<%= summary_list.row do |row| %> |
|
|
|
<%= summary_list.row do |row| %> |
|
|
|
<% row.key { attr[:name] } %> |
|
|
|
<% row.key { attr[:name] } %> |
|
|
|
<% row.value { |
|
|
|
<%= row.value do %> |
|
|
|
if attr[:attribute].eql?("status") |
|
|
|
<% case attr[:attribute] |
|
|
|
|
|
|
|
when "status" |
|
|
|
status_tag(attr[:value]) |
|
|
|
status_tag(attr[:value]) |
|
|
|
elsif attr[:attribute].eql?("availability") |
|
|
|
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 %> |
|
|
|
<% row.action(text: "Change", href: location_edit_path(@location, attr[:attribute])) unless attr[:name] == "Status" %> |
|
|
|
<% row.action(text: "Change", href: location_edit_path(@location, attr[:attribute])) unless attr[:name] == "Status" %> |
|
|
|
<% end %> |
|
|
|
<% end %> |
|
|
|
<% end %> |
|
|
|
<% end %> |
|
|
|
|