Browse Source

feat: only make scheme details and locations pages 2/3 scale if feature toggle on

pull/987/head
Sam Seed 4 years ago
parent
commit
b813a3cd99
  1. 28
      app/views/locations/index.html.erb
  2. 8
      app/views/schemes/show.html.erb

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

@ -11,9 +11,10 @@
<%= render partial: "organisations/headings", locals: { main: @scheme.service_name, sub: nil } %>
<div class="govuk-grid-row">
<% if FeatureToggle.new_locations_table_layout_enabled? %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop">
<% if FeatureToggle.new_locations_table_layout_enabled? %>
<% end %>
<%= render SubNavigationComponent.new(items: scheme_items(request.path, @scheme.id, "Locations")) %>
<h2 class="govuk-visually-hidden">Locations</h2>
@ -21,7 +22,14 @@
<%= render SearchComponent.new(current_user:, search_label: "Search by location name or postcode", value: @searched) %>
<%= govuk_section_break(visible: true, size: "m") %>
<% if FeatureToggle.new_locations_table_layout_enabled? %>
</div>
</div>
<% end %>
<% if FeatureToggle.new_locations_table_layout_enabled? %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop">
<%= 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)) %>
@ -50,16 +58,10 @@
<% end %>
<% end %>
<%= govuk_button_link_to "Add a location", new_scheme_location_path(@scheme), secondary: true %>
</div>
</div>
<% else %>
<%= render SubNavigationComponent.new(items: scheme_items(request.path, @scheme.id, "Locations")) %>
<h2 class="govuk-visually-hidden">Locations</h2>
<%= render SearchComponent.new(current_user:, search_label: "Search by location name or postcode", value: @searched) %>
<%= govuk_section_break(visible: true, size: "m") %>
<% else %>
<%= 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)) %>
@ -105,8 +107,6 @@
<% end %>
<%= govuk_button_link_to "Add a location", new_scheme_location_path(@scheme), secondary: true %>
<% end %>
</div>
</div>
<% end %>
<%== render partial: "pagy/nav", locals: { pagy: @pagy, item_name: "locations" } %>

8
app/views/schemes/show.html.erb

@ -10,8 +10,10 @@
<%= render partial: "organisations/headings", locals: { main: @scheme.service_name, sub: nil } %>
<div class="govuk-grid-row">
<% if FeatureToggle.new_locations_table_layout_enabled? %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop">
<% end %>
<%= render SubNavigationComponent.new(items: scheme_items(request.path, @scheme.id, "Locations")) %>
<h2 class="govuk-visually-hidden">Scheme</h2>
@ -27,8 +29,10 @@
<% end %>
<% end %>
<% if FeatureToggle.new_locations_table_layout_enabled? %>
</div>
</div>
</div>
<% end %>
<% if FeatureToggle.scheme_toggle_enabled? %>
<% if @scheme.active? || @scheme.reactivating_soon? %>

Loading…
Cancel
Save