Browse Source

CLDC-3066: Show filters button bug (#2748)

* Add show filters toggle to user and scheme pages

* Adjust spacing between buttons to match show filters button
pull/2749/head^2
Manny Dinssa 2 months ago committed by GitHub
parent
commit
ee3018b944
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      app/components/create_log_actions_component.html.erb
  2. 10
      app/views/logs/_create_for_org_actions.html.erb
  3. 4
      app/views/organisations/schemes.html.erb
  4. 8
      app/views/organisations/users.html.erb
  5. 10
      app/views/schemes/index.html.erb
  6. 4
      app/views/users/index.html.erb

2
app/components/create_log_actions_component.html.erb

@ -1,6 +1,6 @@
<% if display_actions? %>
<div class="govuk-button-group app-filter-toggle govuk-!-margin-bottom-6">
<%= govuk_button_to create_button_copy, create_button_href, class: "govuk-!-margin-right-6" %>
<%= govuk_button_to create_button_copy, create_button_href, class: "govuk-!-margin-right-3" %>
<% unless user.support? %>
<%= govuk_button_link_to upload_button_copy, upload_button_href, secondary: true %>
<% end %>

10
app/views/logs/_create_for_org_actions.html.erb

@ -1,13 +1,13 @@
<div class="govuk-button-group app-filter-toggle">
<div class="govuk-button-group app-filter-toggle govuk-!-margin-bottom-6">
<% if @organisation.data_protection_confirmed? %>
<% if current_page?(controller: 'organisations', action: 'lettings_logs') %>
<%= govuk_button_to "Create a new lettings log", lettings_logs_path(lettings_log: { owning_organisation_id: @organisation.id }, method: :post), class: "govuk-!-margin-right-6" %>
<%= govuk_button_link_to "Upload lettings logs in bulk", bulk_upload_lettings_log_path(id: "start", organisation_id: @organisation.id), secondary: true, class: "govuk-!-margin-right-6" %>
<%= govuk_button_to "Create a new lettings log", lettings_logs_path(lettings_log: { owning_organisation_id: @organisation.id }, method: :post), class: "govuk-!-margin-right-3" %>
<%= govuk_button_link_to "Upload lettings logs in bulk", bulk_upload_lettings_log_path(id: "start", organisation_id: @organisation.id), secondary: true, class: "govuk-!-margin-right-3" %>
<%= govuk_button_link_to "View lettings bulk uploads", bulk_uploads_lettings_logs_path(organisation_id: @organisation.id, clear_old_filters: true), secondary: true %>
<% end %>
<% if current_page?(controller: 'organisations', action: 'sales_logs') %>
<%= govuk_button_to "Create a new sales log", sales_logs_path(sales_log: { owning_organisation_id: @organisation.id }, method: :post), class: "govuk-!-margin-right-6" %>
<%= govuk_button_link_to "Upload sales logs in bulk", bulk_upload_sales_log_path(id: "start", organisation_id: @organisation.id), secondary: true, class: "govuk-!-margin-right-6" %>
<%= govuk_button_to "Create a new sales log", sales_logs_path(sales_log: { owning_organisation_id: @organisation.id }, method: :post), class: "govuk-!-margin-right-3" %>
<%= govuk_button_link_to "Upload sales logs in bulk", bulk_upload_sales_log_path(id: "start", organisation_id: @organisation.id), secondary: true, class: "govuk-!-margin-right-3" %>
<%= govuk_button_link_to "View sales bulk uploads", bulk_uploads_sales_logs_path(organisation_id: @organisation.id, clear_old_filters: true), secondary: true %>
<% end %>
<% end %>

4
app/views/organisations/schemes.html.erb

@ -23,7 +23,9 @@
<div class="app-filter-layout" data-controller="filter-layout">
<% if SchemePolicy.new(current_user, nil).create? %>
<%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %>
<div class="govuk-button-group app-filter-toggle govuk-!-margin-bottom-6">
<%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %>
</div>
<% end %>
<%= govuk_details(

8
app/views/organisations/users.html.erb

@ -12,10 +12,12 @@
<h2 class="govuk-visually-hidden">Users</h2>
<% end %>
<% if current_user.data_coordinator? || current_user.support? %>
<%= govuk_button_link_to "Invite user", new_user_path(organisation_id: @organisation.id), html: { method: :get } %>
<% end %>
<div class="app-filter-layout" data-controller="filter-layout">
<div class="govuk-button-group app-filter-toggle govuk-!-margin-bottom-6">
<% if current_user.data_coordinator? || current_user.support? %>
<%= govuk_button_link_to "Invite user", new_user_path(organisation_id: @organisation.id), html: { method: :get } %>
<% end %>
</div>
<%= render partial: "users/user_filters" %>
<div class="app-filter-layout__content">

10
app/views/schemes/index.html.erb

@ -5,12 +5,12 @@
<%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Supported housing schemes", sub: nil } : { main: "Supported housing schemes", sub: current_user.organisation.name } %>
<% if SchemePolicy.new(current_user, nil).create? %>
<div class="govuk-button-group govuk-!-margin-bottom-6">
<%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %>
</div>
<% end %>
<div class="app-filter-layout" data-controller="filter-layout">
<% if SchemePolicy.new(current_user, nil).create? %>
<div class="govuk-button-group app-filter-toggle govuk-!-margin-bottom-6">
<%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %>
</div>
<% end %>
<%= render partial: "schemes/scheme_filters" %>
<div class="app-filter-layout__content">
<%= render SearchComponent.new(current_user:, search_label: "Search by postcode, scheme name, scheme code or location name", value: @searched) %>

4
app/views/users/index.html.erb

@ -5,12 +5,12 @@
<%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Users", sub: nil } : { main: "Users", sub: current_user.organisation.name } %>
<div class="app-filter-layout" data-controller="filter-layout">
<% if current_user.data_coordinator? || current_user.support? %>
<div class="govuk-button-group govuk-!-margin-bottom-6">
<div class="govuk-button-group app-filter-toggle govuk-!-margin-bottom-6">
<%= govuk_button_link_to "Invite user", new_user_path, html: { method: :get } %>
</div>
<% end %>
<div class="app-filter-layout" data-controller="filter-layout">
<%= render partial: "users/user_filters" %>
<div class="app-filter-layout__content">
<%= render SearchComponent.new(current_user:, search_label: "Search by name or email address", value: @searched) %>

Loading…
Cancel
Save