|
|
|
@ -3,13 +3,21 @@ |
|
|
|
<div class="app-filter__header"> |
|
|
|
<div class="app-filter__header"> |
|
|
|
<h2 class="govuk-heading-m">Filters</h2> |
|
|
|
<h2 class="govuk-heading-m">Filters</h2> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="app-filter__content"> |
|
|
|
<div class="app-filter__content"> |
|
|
|
<%= form_with html: { method: :get } do |f| %> |
|
|
|
<%= form_with html: { method: :get } do |f| %> |
|
|
|
<% years = { "2021": "2021/22", "2022": "2022/23" } %> |
|
|
|
<% years = { "2021": "2021/22", "2022": "2022/23" } %> |
|
|
|
<% all_or_yours = { "all": { label: "All" }, "yours": { label: "Yours" } } %> |
|
|
|
<% all_or_yours = { "all": { label: "All" }, "yours": { label: "Yours" } } %> |
|
|
|
|
|
|
|
<% bulk_upload_options = (@session_filters["bulk_upload_id"] || []).reject(&:blank?).index_with { |_bulk_upload_id| "With logs from bulk upload" } %> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<% if bulk_upload_options.present? %> |
|
|
|
|
|
|
|
<%= render partial: "filters/checkbox_filter", locals: { f: f, options: bulk_upload_options, label: "Bulk upload", category: "bulk_upload_id" } %> |
|
|
|
|
|
|
|
<% end %> |
|
|
|
|
|
|
|
|
|
|
|
<%= render partial: "filters/checkbox_filter", locals: { f: f, options: years, label: "Collection year", category: "years" } %> |
|
|
|
<%= render partial: "filters/checkbox_filter", locals: { f: f, options: years, label: "Collection year", category: "years" } %> |
|
|
|
<%= render partial: "filters/checkbox_filter", locals: { f: f, options: status_filters, label: "Status", category: "status" } %> |
|
|
|
<%= render partial: "filters/checkbox_filter", locals: { f: f, options: status_filters, label: "Status", category: "status" } %> |
|
|
|
<%= render partial: "filters/radio_filter", locals: { f: f, options: all_or_yours, label: "Logs", category: "user", } %> |
|
|
|
<%= render partial: "filters/radio_filter", locals: { f: f, options: all_or_yours, label: "Logs", category: "user" } %> |
|
|
|
|
|
|
|
|
|
|
|
<% if (@current_user.support? || @current_user.organisation.has_managing_agents?) && request.path == "/lettings-logs" %> |
|
|
|
<% if (@current_user.support? || @current_user.organisation.has_managing_agents?) && request.path == "/lettings-logs" %> |
|
|
|
<%= render partial: "filters/radio_filter", locals: { |
|
|
|
<%= render partial: "filters/radio_filter", locals: { |
|
|
|
f: f, |
|
|
|
f: f, |
|
|
|
@ -21,14 +29,15 @@ |
|
|
|
type: "select", |
|
|
|
type: "select", |
|
|
|
label: "Organisation", |
|
|
|
label: "Organisation", |
|
|
|
category: "organisation", |
|
|
|
category: "organisation", |
|
|
|
options: organisations_filter_options(@current_user) |
|
|
|
options: organisations_filter_options(@current_user), |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
label: "Organisation", |
|
|
|
label: "Organisation", |
|
|
|
category: "organisation_select" |
|
|
|
category: "organisation_select", |
|
|
|
} %> |
|
|
|
} %> |
|
|
|
<% end %> |
|
|
|
<% end %> |
|
|
|
|
|
|
|
|
|
|
|
<%= f.govuk_submit "Apply filters", class: "govuk-!-margin-bottom-0" %> |
|
|
|
<%= f.govuk_submit "Apply filters", class: "govuk-!-margin-bottom-0" %> |
|
|
|
<% end %> |
|
|
|
<% end %> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|