|
30 | 30 | - if @organisation.school_group? |
31 | 31 | .govuk-grid-column-one-third-at-desktop class="govuk-!-margin-bottom-4" |
32 | 32 | - if @organisation.local_authority? |
33 | | - = govuk_link_to t("jobs.dashboard.add_or_remove_schools"), edit_publishers_publisher_preference_path(@publisher_preference), class: "govuk-link--no-visited-state" |
| 33 | + = govuk_button_link_to t("jobs.dashboard.add_or_remove_schools"), edit_publishers_publisher_preference_path(@publisher_preference) |
34 | 34 |
|
35 | 35 | div class="govuk-!-margin-top-2" |
36 | 36 | = form_for @filter_form, as: "", url: organisation_jobs_with_type_path(type: @selected_type), method: :get, html: { data: { controller: "form", "hide-submit": true } } do |f| |
37 | 37 | = filters(submit_button: f.govuk_submit(t("buttons.apply_filters")), |
38 | | - filters: { total_count: @selected_organisation_ids.size }, |
| 38 | + filters: { total_count: @selected_organisation_ids.size + @selected_job_roles.size }, |
39 | 39 | clear_filters_link: { text: t("shared.filter_group.clear_all_filters"), url: organisation_jobs_with_type_path(type: @selected_type) }, |
40 | 40 | options: { remove_filter_links: true }, |
41 | 41 | html_attributes: { tabindex: "-1" }) do |filters_component| |
42 | | - - if @selected_organisation_ids.any? |
| 42 | + - if @selected_organisation_ids.any? || @selected_job_roles.any? |
43 | 43 | - filters_component.with_remove_filter_links do |rb| |
44 | | - - rb.with_group(key: "organisation_ids", |
45 | | - selected: @selected_organisation_ids, |
46 | | - options: @organisation_options, |
47 | | - value_method: :id, |
48 | | - selected_method: :name, |
49 | | - remove_filter_link: { url_helper: :organisation_jobs_with_type_path, params: { "type" => @selected_type, "organisation_ids" => @selected_organisation_ids } }) |
| 44 | + - if @selected_organisation_ids.any? |
| 45 | + - rb.with_group(key: "organisation_ids", |
| 46 | + selected: @selected_organisation_ids, |
| 47 | + options: @organisation_options, |
| 48 | + value_method: :id, |
| 49 | + selected_method: :name, |
| 50 | + remove_filter_link: { url_helper: :organisation_jobs_with_type_path, params: { "type" => @selected_type, "organisation_ids" => @selected_organisation_ids, "job_roles" => @selected_job_roles } }) |
| 51 | + - if @selected_job_roles.any? |
| 52 | + - rb.with_group(key: "job_roles", |
| 53 | + selected: @selected_job_roles, |
| 54 | + options: @job_role_options, |
| 55 | + value_method: :id, |
| 56 | + selected_method: :label, |
| 57 | + remove_filter_link: { url_helper: :organisation_jobs_with_type_path, params: { "type" => @selected_type, "organisation_ids" => @selected_organisation_ids, "job_roles" => @selected_job_roles } }) |
50 | 58 |
|
51 | 59 | - filters_component.with_group key: "locations", |
52 | | - component: f.govuk_collection_check_boxes(:organisation_ids, @organisation_options, :id, :label, small: true, legend: { text: "Locations", tag: "h2" }, hint: nil, form_group: { data: { action: "change->form#submitListener" } }) |
| 60 | + component: searchable_collection(collection: f.govuk_collection_check_boxes(:organisation_ids, @organisation_options, :id, :label, small: true, legend: { text: "Locations", tag: "h2" }, hint: (@organisation.local_authority? ? { text: t("jobs.dashboard.location_filter_hint") } : nil), form_group: { data: { action: "change->form#submitListener" } }), |
| 61 | + collection_count: @organisation_options.count, |
| 62 | + options: { scrollable: true }, |
| 63 | + text: { aria_label: "Locations", placeholder: t("helpers.hint.publishers_vacancy_filter_form.organisation_ids_placeholder") }) |
| 64 | + |
| 65 | + - filters_component.with_group key: "job_roles", |
| 66 | + component: searchable_collection(collection: f.govuk_collection_check_boxes(:job_roles, @job_role_options, :id, :label, small: true, legend: { text: "Job roles", tag: "h2" }, hint: nil, form_group: { data: { action: "change->form#submitListener" } }), |
| 67 | + collection_count: @job_role_options.count, |
| 68 | + options: { scrollable: true }, |
| 69 | + text: { aria_label: "Job roles", placeholder: t("helpers.hint.publishers_vacancy_filter_form.job_roles_placeholder") }) |
53 | 70 |
|
54 | 71 | .help-guide--desktop class="govuk-!-margin-top-4" |
55 | 72 | h2.govuk-heading-m = t("jobs.dashboard.how_to_accept_job_applications_guide.title") |
|
0 commit comments