|
|
@ -13,24 +13,24 @@ |
|
|
|
<div class="app-filter__content"> |
|
|
|
<div class="app-filter__content"> |
|
|
|
<div class="govuk-form-group app-filter__group"> |
|
|
|
<div class="govuk-form-group app-filter__group"> |
|
|
|
<%= form_with url: "/logs", html: { method: :get } do |f| %> |
|
|
|
<%= form_with url: "/logs", html: { method: :get } do |f| %> |
|
|
|
<%= f.govuk_check_boxes_fieldset :status, legend: { text: "Status", size: "s"} do %> |
|
|
|
<%= f.govuk_check_boxes_fieldset :year, legend: { text: "Collection year", size: "s"} do %> |
|
|
|
<div class="govuk-checkboxes govuk-checkboxes--small" data-module="govuk-checkboxes"> |
|
|
|
<div class="govuk-checkboxes govuk-checkboxes--small" data-module="govuk-checkboxes"> |
|
|
|
<% statuses = status_filters %> |
|
|
|
<% years = {"2021": "2021/22", "2022": "2022/23"} %> |
|
|
|
<% statuses.map do |key, option| %> |
|
|
|
<% years.map do |key, option| %> |
|
|
|
<%= f.govuk_check_box "status", "#{key}", |
|
|
|
<%= f.govuk_check_box "year", "#{key}", |
|
|
|
label: { text: option }, |
|
|
|
label: { text: option }, |
|
|
|
checked: filter_selected?("status", key), |
|
|
|
checked: filter_selected?("year", key), |
|
|
|
size: "s" %> |
|
|
|
size: "s" %> |
|
|
|
<% end %> |
|
|
|
<% end %> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<% end %> |
|
|
|
<% end %> |
|
|
|
<%= f.govuk_check_boxes_fieldset :year, legend: { text: "Year", size: "s"} do %> |
|
|
|
<%= f.govuk_check_boxes_fieldset :status, legend: { text: "Status", size: "s"} do %> |
|
|
|
<div class="govuk-checkboxes govuk-checkboxes--small" data-module="govuk-checkboxes"> |
|
|
|
<div class="govuk-checkboxes govuk-checkboxes--small" data-module="govuk-checkboxes"> |
|
|
|
<% years = {"2021": "2021", "2022": "2022"} %> |
|
|
|
<% statuses = status_filters %> |
|
|
|
<% years.map do |key, option| %> |
|
|
|
<% statuses.map do |key, option| %> |
|
|
|
<%= f.govuk_check_box "year", "#{key}", |
|
|
|
<%= f.govuk_check_box "status", "#{key}", |
|
|
|
label: { text: option }, |
|
|
|
label: { text: option }, |
|
|
|
checked: filter_selected?("year", key), |
|
|
|
checked: filter_selected?("status", key), |
|
|
|
size: "s" %> |
|
|
|
size: "s" %> |
|
|
|
<% end %> |
|
|
|
<% end %> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|