|
|
|
|
@ -15,18 +15,29 @@
|
|
|
|
|
|
|
|
|
|
<%= govuk_summary_list do |summary_list| %> |
|
|
|
|
<% display_location_attributes(@location).each do |attr| %> |
|
|
|
|
<%= summary_list.row do |row| %> |
|
|
|
|
<% row.key { attr[:name] } %> |
|
|
|
|
<% row.value { attr[:attribute].eql?("status") ? status_tag_from_resource(@location) : details_html(attr) } %> |
|
|
|
|
<% if LocationPolicy.new(current_user, @location).update? %> |
|
|
|
|
<% row.action(text: "Change", href: scheme_location_postcode_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "postcode" && current_user.support? %> |
|
|
|
|
<% row.action(text: "Change", href: scheme_location_name_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "name" %> |
|
|
|
|
<% row.action(text: "Change", href: scheme_location_units_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "units" && current_user.support? %> |
|
|
|
|
<% row.action(text: "Change", href: scheme_location_type_of_unit_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "type_of_unit" && current_user.support? %> |
|
|
|
|
<% row.action(text: "Change", href: scheme_location_mobility_standards_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "mobility_standards" && current_user.support? %> |
|
|
|
|
<% unless attr[:attribute].eql?("local_authority") && @location.is_la_inferred %> |
|
|
|
|
<%= summary_list.row do |row| %> |
|
|
|
|
<% row.key { attr[:name] } %> |
|
|
|
|
<% if attr[:attribute].eql?("status") %> |
|
|
|
|
<%= row.value { status_tag_from_resource(@location) } %> |
|
|
|
|
<% elsif attr[:attribute].eql?("postcode") && @location.is_la_inferred %> |
|
|
|
|
<% row.value do %> |
|
|
|
|
<%= details_html(attr) %> |
|
|
|
|
<span class="govuk-!-font-weight-regular app-!-colour-muted"><%= formatted_local_authority_timeline(@location) %></span> |
|
|
|
|
<% end %> |
|
|
|
|
<% else %> |
|
|
|
|
<%= row.value { details_html(attr) } %> |
|
|
|
|
<% end %> |
|
|
|
|
<% if LocationPolicy.new(current_user, @location).update? %> |
|
|
|
|
<% row.action(text: "Change", href: scheme_location_postcode_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "postcode" && current_user.support? %> |
|
|
|
|
<% row.action(text: "Change", href: scheme_location_name_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "name" %> |
|
|
|
|
<% row.action(text: "Change", href: scheme_location_units_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "units" && current_user.support? %> |
|
|
|
|
<% row.action(text: "Change", href: scheme_location_type_of_unit_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "type_of_unit" && current_user.support? %> |
|
|
|
|
<% row.action(text: "Change", href: scheme_location_mobility_standards_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "mobility_standards" && current_user.support? %> |
|
|
|
|
<% end %> |
|
|
|
|
<% end %> |
|
|
|
|
<% end %> |
|
|
|
|
<% end %> |
|
|
|
|
<% end %> |
|
|
|
|
<% end %> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|