|
13 | 13 | .govuk-grid-row |
14 | 14 | - if @frameworks.present? |
15 | 15 | = form_tag(admin_frameworks_path, method: :get, enforce_utf8: false, remote: :true, id: 'framework_status_filter') do |
| 16 | + = hidden_field_tag :filters_applied, '1' |
16 | 17 | .govuk-grid-column-one-quarter |
17 | 18 | #accordion-with-summary-sections.ccs-accordion.ccs-accordion--clean{"data-module" => "govuk-accordion", :class => 'govuk-!-margin-top-7'} |
18 | 19 | .govuk-accordion__section.ccs-accordion__section--clean.govuk-form-group.govuk-form-group--enclosure.ccs-form-group--enclosure--tight |
|
25 | 26 | .govuk-form-group |
26 | 27 | %fieldset.govuk-fieldset |
27 | 28 | %legend.govuk-fieldset__legend.govuk-fieldset__legend--m |
| 29 | + - if params[:filters_applied].present? |
| 30 | + - selected_statuses = Array(params[:framework_status]) |
| 31 | + - else |
| 32 | + - selected_statuses = %w[published new] |
| 33 | +
|
28 | 34 | .govuk-checkboxes{id: 'framework_status_checkboxes'} |
29 | 35 | .govuk-checkboxes__item.govuk-checkboxes__item--small |
30 | | - = check_box_tag('framework_status[]', 'New', false, |
| 36 | + = check_box_tag('framework_status[]', 'New', |
| 37 | + selected_statuses.include?('new'), |
31 | 38 | id: 'framework_status_new', |
32 | 39 | class: 'govuk-checkboxes__input govuk-checkboxes__input--small') |
33 | 40 | = label_tag "framework_status_new", "New", class: 'govuk-checkboxes__label' |
34 | 41 | .govuk-checkboxes__item.govuk-checkboxes__item--small |
35 | | - = check_box_tag('framework_status[]', 'Published', false, |
| 42 | + = check_box_tag('framework_status[]', 'Published', |
| 43 | + selected_statuses.include?('published'), |
36 | 44 | id: 'framework_status_published', |
37 | 45 | class: 'govuk-checkboxes__input govuk-checkboxes__input--small') |
38 | 46 | = label_tag "framework_status_published", "Published", class: 'govuk-checkboxes__label' |
| 47 | + .govuk-checkboxes__item.govuk-checkboxes__item--small |
| 48 | + = check_box_tag('framework_status[]', 'Archived', |
| 49 | + selected_statuses.include?('archived'), |
| 50 | + id: 'framework_status_archived', |
| 51 | + class: 'govuk-checkboxes__input govuk-checkboxes__input--small') |
| 52 | + = label_tag "framework_status_archived", "Archived", class: 'govuk-checkboxes__label' |
39 | 53 | %noscript |
40 | 54 | = surround "  ".html_safe do |
41 | 55 | = submit_tag "Submit", id: 'framework-status-filter-submit', data: { 'prevent-double-click': true }, class: 'govuk-button' |
|
0 commit comments