Browse Source

Remove grid layout from locations index

pull/723/head
Paul Robert Lloyd 3 years ago
parent
commit
eda37d2d35
  1. 62
      app/views/locations/index.html.erb

62
app/views/locations/index.html.erb

@ -10,40 +10,36 @@
<% location_caption = @scheme.locations.count.eql?(1) ? "1 location" : "#{@scheme.locations.count} locations" %> <% location_caption = @scheme.locations.count.eql?(1) ? "1 location" : "#{@scheme.locations.count} locations" %>
<%= render SubNavigationComponent.new(items: scheme_items(request.path, @scheme.id, location_caption)) %> <%= render SubNavigationComponent.new(items: scheme_items(request.path, @scheme.id, location_caption)) %>
<div class="govuk-grid-row"> <%= govuk_table do |table| %>
<div class="govuk-grid-column-three-quarters"> <%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %>
<%= govuk_table do |table| %> <strong><%= @scheme.locations.count %></strong> <%= @scheme.locations.count.eql?(1) ? "location" : "locations" %>.
<%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %> <% end %>
<strong><%= @scheme.locations.count %></strong> <%= @scheme.locations.count.eql?(1) ? "location" : "locations" %>. <%= table.head do |head| %>
<% end %> <%= head.row do |row| %>
<%= table.head do |head| %> <% row.cell(header: true, text: "Code", html_attributes: {
<%= head.row do |row| %> scope: "col",
<% 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: "Postcode", html_attributes: { }) %>
scope: "col", <% row.cell(header: true, text: "Units", 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: "Common unit type", html_attributes: { }) %>
scope: "col", <% end %>
}) %> <% end %>
<% end %> <% @locations.each do |location| %>
<% end %> <%= table.body do |body| %>
<% @locations.each do |location| %> <%= body.row do |row| %>
<%= table.body do |body| %> <% row.cell(text: location.id) %>
<%= body.row do |row| %> <% 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.id) %> <% row.cell(text: location.total_units) %>
<% 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: simple_format("<span>#{location.type_of_unit}</span>#{location.wheelchair_adaptation == 'Yes' ? "\n<span class=\"govuk-!-font-weight-regular app-!-colour-muted\">With wheelchair adaptations</span>" : ''}")) %>
<% row.cell(text: location.total_units) %>
<% row.cell(text: simple_format("<span>#{location.type_of_unit}</span>#{location.wheelchair_adaptation == 'Yes' ? "\n<span class=\"govuk-!-font-weight-regular app-!-colour-muted\">With wheelchair adaptations</span>" : ''}")) %>
<% end %>
<% end %>
<% end %> <% end %>
<% end %> <% end %>
</div> <% end %>
</div> <% end %>
<%== render partial: "pagy/nav", locals: { pagy: @pagy, item_name: "locations" } %> <%== render partial: "pagy/nav", locals: { pagy: @pagy, item_name: "locations" } %>

Loading…
Cancel
Save