From dca62be96aef93918ae8a71cdab9858d411bbfeb Mon Sep 17 00:00:00 2001 From: Zarino Zappia Date: Tue, 19 Nov 2024 17:07:56 +0000 Subject: [PATCH] [Scorecards] More ovbvious styling for active advanced filters on homepage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rather than having an element that reads out which advanced filters are active (which we’d already temporarily hidden because we were worried it was just too much clutter) and a "reset" button, this commit introduces very obvious styling for advanced filter ` to look like an "active" button. +.form-select-show-modifications:has(option ~ option[selected]) { + background-color: $primary; + background-image: url("../img/bootstrap/form-select-indicator-white.svg"); + color: color-contrast($primary); +} diff --git a/scoring/templates/scoring/includes/advanced-filter.html b/scoring/templates/scoring/includes/advanced-filter.html index b443ea012..842a79440 100644 --- a/scoring/templates/scoring/includes/advanced-filter.html +++ b/scoring/templates/scoring/includes/advanced-filter.html @@ -1,40 +1,5 @@ +

Advanced filters

-
-

Current active filters

- {% if filter_descs %} -
- {% if 'county' in filter_params and filter_params.county != "" %} - County: {{ filter_params.county }} - {% endif %} - - {% if 'region' in filter_params and filter_params.region != "" %} - Region: {{ filter_params.region }} - {% endif %} - - {% if 'control' in filter_params and filter_params.control != "" %} - Political control: {{ filter_params.control }} - {% endif %} - - {% if 'imdq' in filter_params and filter_params.imdq %} - IMDQ: {{ filter_params.imdq }} - {% endif %} - - {% if 'ruc_cluster' in filter_params and filter_params.ruc_cluster != "" %} - {% for option in urbanisation_filter %} - {% if filter_params.ruc_cluster == option.0 %} - {{ option.1 }} - {% endif %} - {% endfor %} - {% endif %} - - {% if 'population' in filter_params and filter_params.population != "" %} - Population: {{ filter_params.population }} - {% endif %} -
- {% endif %} -
- -

Advanced filters

{% if filter_auth_type %} @@ -42,7 +7,7 @@

Advanced filters

- {% for option in urbanisation_filter %} @@ -53,7 +18,7 @@

Advanced filters

{% if authority_type != 'combined' and authority_type != 'northern-ireland' %}
- @@ -67,7 +32,7 @@

Advanced filters

{% if filter_params.country == "1" or filter_params.country == "" or filter_params.country is None %}
- @@ -85,7 +50,7 @@

Advanced filters

{% if authority_type == 'district' %}
- {% for option in county_filter %} @@ -97,7 +62,7 @@

Advanced filters

{% if authority_type != 'combined' and authority_type != 'northern-ireland' %}
- @@ -112,7 +77,7 @@

Advanced filters

- {% for option in population_filter %} @@ -120,4 +85,3 @@

Advanced filters

-