Add option to make active list filters more visible. #178

* add option to make active list filters more visible

* fix margins and border radius for selected filters
This commit is contained in:
Éric
2022-10-06 03:47:19 -04:00
committed by GitHub
parent 56f876d25e
commit f25d340738
7 changed files with 55 additions and 7 deletions
@@ -142,6 +142,7 @@ flat-theme admin-interface
{% if theme.foldable_apps %} foldable-apps {% endif %}
{% if theme.form_submit_sticky %} sticky-submit {% endif %}
{% if theme.form_pagination_sticky %} sticky-pagination {% endif %}
{% if theme.list_filter_highlight %} list-filter-highlight {% endif %}
{% if theme.list_filter_sticky %} list-filter-sticky {% endif %}
{% endblock %}
+3 -4
View File
@@ -8,10 +8,10 @@
{% else %}
{# Use the default list filter template -> https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/filter.html #}
{# Use a changed default list filter template -> https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/filter.html #}
<h3>{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktrans %}</h3>
<ul>
<h3 {% if spec.lookup_val or spec.value %}class="active"{% endif %}>{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktrans %}</h3>
<ul {% if spec.lookup_val or spec.value %}class="active"{% endif %}>
{% for choice in choices %}
<li{% if choice.selected %} class="selected"{% endif %}>
<a href="{{ choice.query_string|iriencode }}">{{ choice.display }}</a></li>
@@ -19,4 +19,3 @@
</ul>
{% endif %}
@@ -1,7 +1,7 @@
{% load i18n %}
<div class="list-filter-dropdown">
<h3>{% blocktrans with title as filter_title %} By {{ filter_title }} {% endblocktrans %}</h3>
<h3 {% if spec.lookup_val or spec.value %}class="active"{% endif %}>{% blocktrans with title as filter_title %} By {{ filter_title }} {% endblocktrans %}</h3>
<div align="right">
<select onChange="javascript:window.location = this.options[this.selectedIndex].value;">
{% for choice in choices %}