diff --git a/app/views/locations/index.html.erb b/app/views/locations/index.html.erb index 9fffd4974..b971cb9bd 100644 --- a/app/views/locations/index.html.erb +++ b/app/views/locations/index.html.erb @@ -11,17 +11,25 @@ <%= render partial: "organisations/headings", locals: { main: @scheme.service_name, sub: nil } %> -
-
- <% if FeatureToggle.new_locations_table_layout_enabled? %> - <%= render SubNavigationComponent.new(items: scheme_items(request.path, @scheme.id, "Locations")) %> +<% if FeatureToggle.new_locations_table_layout_enabled? %> +
+
+<% end %> + <%= render SubNavigationComponent.new(items: scheme_items(request.path, @scheme.id, "Locations")) %> -

Locations

+

Locations

- <%= render SearchComponent.new(current_user:, search_label: "Search by location name or postcode", value: @searched) %> + <%= render SearchComponent.new(current_user:, search_label: "Search by location name or postcode", value: @searched) %> - <%= govuk_section_break(visible: true, size: "m") %> + <%= govuk_section_break(visible: true, size: "m") %> +<% if FeatureToggle.new_locations_table_layout_enabled? %> +
+
+<% end %> +<% if FeatureToggle.new_locations_table_layout_enabled? %> +
+
<%= 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,63 +58,55 @@ <% end %> <% end %> <%= govuk_button_link_to "Add a location", new_scheme_location_path(@scheme), secondary: true %> +
+
- <% else %> - <%= render SubNavigationComponent.new(items: scheme_items(request.path, @scheme.id, "Locations")) %> - -

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", - }) %> - <% row.cell(header: true, text: "Local authority", html_attributes: { - scope: "col", - }) %> - <% row.cell(header: true, text: "Available from", 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_postcode(location, scheme_location_path(@scheme, location)), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %> - <% row.cell(text: location.units) %> - <% row.cell(text: simple_format("#{location.type_of_unit}")) %> - <% row.cell(text: location.mobility_type) %> - <% row.cell(text: simple_format(location_cell_location_admin_district(location, "#{scheme_location_path(@scheme, location)}/edit-local-authority"), wrapper_tag: "div")) %> - <% row.cell(text: location.startdate&.to_formatted_s(:govuk_date)) %> - <% end %> +<% 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)) %> + <% 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", + }) %> + <% row.cell(header: true, text: "Local authority", html_attributes: { + scope: "col", + }) %> + <% row.cell(header: true, text: "Available from", 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_postcode(location, scheme_location_path(@scheme, location)), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %> + <% row.cell(text: location.units) %> + <% row.cell(text: simple_format("#{location.type_of_unit}")) %> + <% row.cell(text: location.mobility_type) %> + <% row.cell(text: simple_format(location_cell_location_admin_district(location, "#{scheme_location_path(@scheme, location)}/edit-local-authority"), wrapper_tag: "div")) %> + <% row.cell(text: location.startdate&.to_formatted_s(:govuk_date)) %> <% end %> - <% end %> <% end %> - <%= govuk_button_link_to "Add a location", new_scheme_location_path(@scheme), secondary: true %> - <% end %> -
-
+ <% end %> + <%= govuk_button_link_to "Add a location", new_scheme_location_path(@scheme), secondary: true %> + +<% end %> <%== render partial: "pagy/nav", locals: { pagy: @pagy, item_name: "locations" } %> diff --git a/app/views/schemes/show.html.erb b/app/views/schemes/show.html.erb index ffdb81a10..8de58c210 100644 --- a/app/views/schemes/show.html.erb +++ b/app/views/schemes/show.html.erb @@ -10,25 +10,29 @@ <%= render partial: "organisations/headings", locals: { main: @scheme.service_name, sub: nil } %> -
-
- <%= render SubNavigationComponent.new(items: scheme_items(request.path, @scheme.id, "Locations")) %> +<% if FeatureToggle.new_locations_table_layout_enabled? %> +
+
+<% end %> + <%= render SubNavigationComponent.new(items: scheme_items(request.path, @scheme.id, "Locations")) %> -

Scheme

+

Scheme

- <%= govuk_summary_list do |summary_list| %> - <% display_scheme_attributes(@scheme).each do |attr| %> - <% next if current_user.data_coordinator? && attr[:name] == ("Housing stock owned by") %> - <%= summary_list.row do |row| %> - <% row.key { attr[:name].eql?("Registered under Care Standards Act 2000") ? "Registered under Care Standards Act 2000" : attr[:name].to_s.humanize } %> - <% row.value { attr[:name].eql?("Status") ? status_tag(attr[:value]) : details_html(attr) } %> - <% row.action(text: "Change", href: scheme_edit_name_path(scheme_id: @scheme.id)) if attr[:edit] %> + <%= govuk_summary_list do |summary_list| %> + <% display_scheme_attributes(@scheme).each do |attr| %> + <% next if current_user.data_coordinator? && attr[:name] == ("Housing stock owned by") %> + <%= summary_list.row do |row| %> + <% row.key { attr[:name].eql?("Registered under Care Standards Act 2000") ? "Registered under Care Standards Act 2000" : attr[:name].to_s.humanize } %> + <% row.value { attr[:name].eql?("Status") ? status_tag(attr[:value]) : details_html(attr) } %> + <% row.action(text: "Change", href: scheme_edit_name_path(scheme_id: @scheme.id)) if attr[:edit] %> + <% end %> <% end %> <% end %> - <% end %> +<% if FeatureToggle.new_locations_table_layout_enabled? %> +
-
+<% end %> <% if FeatureToggle.scheme_toggle_enabled? %> <% if @scheme.active? || @scheme.reactivating_soon? %> @@ -36,4 +40,4 @@ <% else %> <%= govuk_button_link_to "Reactivate this scheme", scheme_new_reactivation_path(@scheme) %> <% end %> -<% end %> \ No newline at end of file +<% end %>