You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
2.3 KiB
57 lines
2.3 KiB
<% item_label = format_label(@pagy.count, "location") %> |
|
<% title = format_title(@searched, @scheme.service_name, current_user, item_label, @pagy.count, nil) %> |
|
<% content_for :title, title %> |
|
|
|
<% content_for :before_content do %> |
|
<%= govuk_back_link( |
|
text: "Back", |
|
href: "/schemes/#{@scheme.id}", |
|
) %> |
|
<% end %> |
|
|
|
<%= render partial: "organisations/headings", locals: { main: @scheme.service_name, sub: nil } %> |
|
|
|
<%= render SubNavigationComponent.new(items: scheme_items(request.path, @scheme.id, "Locations")) %> |
|
|
|
<%= render SearchComponent.new(current_user:, search_label: "Search by location name or postcode", value: @searched) %> |
|
|
|
<%= govuk_section_break(visible: true, size: "m") %> |
|
|
|
<%= govuk_table do |table| %> |
|
<%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %> |
|
<%= render(SearchResultCaptionComponent.new(searched: @searched, count: @pagy.count, item_label:, total_count: @total_count, item: "locations", path: request.path)) %> |
|
<% end %> |
|
<%= table.head do |head| %> |
|
<%= head.row do |row| %> |
|
<% row.cell(header: true, text: "Code", html_attributes: { |
|
scope: "col", |
|
}) %> |
|
<% row.cell(header: true, text: "Postcode", html_attributes: { |
|
scope: "col", |
|
}) %> |
|
<% row.cell(header: true, text: "Units", html_attributes: { |
|
scope: "col", |
|
}) %> |
|
<% row.cell(header: true, text: "Common unit type", html_attributes: { |
|
scope: "col", |
|
}) %> |
|
<% row.cell(header: true, text: "Mobility type", html_attributes: { |
|
scope: "col", |
|
}) %> |
|
<% end %> |
|
<% end %> |
|
<% @locations.each do |location| %> |
|
<%= table.body do |body| %> |
|
<%= body.row do |row| %> |
|
<% row.cell(text: location.id) %> |
|
<% row.cell(text: simple_format(location_cell(location, "/schemes/#{@scheme.id}/locations/#{location.id}/edit-name"), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %> |
|
<% row.cell(text: location.units) %> |
|
<% row.cell(text: simple_format("<span>#{location.type_of_unit}</span>")) %> |
|
<% row.cell(text: location.mobility_type) %> |
|
<% end %> |
|
<% end %> |
|
<% end %> |
|
<% end %> |
|
<%= govuk_button_link_to "Add a location", new_location_path(id: @scheme.id), secondary: true %> |
|
|
|
<%== render partial: "pagy/nav", locals: { pagy: @pagy, item_name: "locations" } %>
|
|
|