Browse Source
* Rename org filter * Ensure filters work when ID is passed * UI init * Lint * Fix filter nesting * Reduce width * Set checked status of filters correctly * Test filter presence * Add filter test * Rubocop * Tweak styles for autocomplete within filter Co-authored-by: Paul Robert Lloyd <me+git@paulrobertlloyd.com>pull/619/head
15 changed files with 195 additions and 21 deletions
@ -1,8 +1,18 @@ |
|||||||
<%= f.govuk_radio_buttons_fieldset category.to_sym, legend: { text: label, size: "s" }, small: true, form_group: { classes: "app-filter__group" } do %> |
<%= f.govuk_radio_buttons_fieldset category.to_sym, legend: { text: label, size: "s" }, small: true, form_group: { classes: "app-filter__group" } do %> |
||||||
<% options.map do |key, option| %> |
<% options.map do |key, option| %> |
||||||
<%= f.govuk_radio_button category, key.to_s, |
<%= f.govuk_radio_button category, key.to_s, |
||||||
label: { text: option }, |
label: { text: option[:label] }, |
||||||
checked: filter_selected?(category, key), |
checked: filter_selected?(category, key), |
||||||
size: "s" %> |
size: "s" do %> |
||||||
|
<% if option[:conditional_filter] %> |
||||||
|
<%= render partial: "filters/#{option[:conditional_filter][:type]}_filter", locals: { |
||||||
|
f:, |
||||||
|
collection: option[:conditional_filter][:options], |
||||||
|
category: option[:conditional_filter][:category], |
||||||
|
label: option[:conditional_filter][:label], |
||||||
|
secondary: true, |
||||||
|
} %> |
||||||
|
<% end %> |
||||||
|
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
|
@ -0,0 +1,7 @@ |
|||||||
|
<%= f.govuk_collection_select category.to_sym, |
||||||
|
collection, |
||||||
|
:id, |
||||||
|
:name, |
||||||
|
label: { hidden: secondary }, |
||||||
|
options: { disabled: [""], selected: selected_option(category) }, |
||||||
|
"data-controller": "accessible-autocomplete" %> |
Loading…
Reference in new issue