mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-21 10:16:13 +02:00
Merge branch 'main' into nl/3144-add-filter-skip-link
This commit is contained in:
commit
fb4c3da25d
2 changed files with 60 additions and 34 deletions
|
@ -1,4 +1,5 @@
|
|||
{% extends "admin/change_list.html" %}
|
||||
{% load i18n admin_urls static admin_list %}
|
||||
|
||||
{% block content_title %}
|
||||
<h1>{{ title }}</h1>
|
||||
|
@ -48,3 +49,24 @@
|
|||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% comment %} Replace the Django header markup for clearing all filters with a div. {% endcomment %}
|
||||
{% block filters %}
|
||||
{% if cl.has_filters %}
|
||||
<nav id="changelist-filter" aria-labelledby="changelist-filter-header">
|
||||
<h2 id="changelist-filter-header">{% translate 'Filter' %}</h2>
|
||||
{% if cl.is_facets_optional or cl.has_active_filters %}<div id="changelist-filter-extra-actions">
|
||||
{% if cl.is_facets_optional %}<h3>
|
||||
{% if cl.add_facets %}<a href="{{ cl.remove_facet_link }}" class="hidelink">{% translate "Hide counts" %}</a>
|
||||
{% else %}<a href="{{ cl.add_facet_link }}" class="viewlink">{% translate "Show counts" %}</a>{% endif %}
|
||||
</h3>{% endif %}
|
||||
{% if cl.has_active_filters %}<div class="margin-2">
|
||||
<a href="{{ cl.clear_all_filters_qs }}" role="link">✖ {% translate "Clear all filters" %}</a>
|
||||
</div>{% endif %}
|
||||
</div>{% endif %}
|
||||
{% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
|
||||
</nav>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -1,21 +1,24 @@
|
|||
{% load i18n %}
|
||||
{% load static field_helpers url_helpers %}
|
||||
|
||||
|
||||
<h3>{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktrans %}</h3>
|
||||
<ul class="mulitple-choice">
|
||||
{% for choice in choices %}
|
||||
<details data-filter-title="{{ title }}" open="">
|
||||
<summary aria-label="Show/hide {{ title }} filters" role="button">
|
||||
{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktrans %}
|
||||
</summary>
|
||||
<ul class="mulitple-choice">
|
||||
{% for choice in choices %}
|
||||
{% if choice.reset %}
|
||||
<li{% if choice.selected %} class="selected"{% endif %}">
|
||||
<a href="{{ choice.query_string|iriencode }}" title="{{ choice.display }}">{{ choice.display }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% for choice in choices %}
|
||||
{% endfor %}
|
||||
|
||||
{% for choice in choices %}
|
||||
{% if not choice.reset %}
|
||||
<li{% if choice.selected %} class="selected"{% endif %}">
|
||||
{% if choice.selected and choice.exclude_query_string %}
|
||||
<a class="choice-filter choice-filter--checked" href="{{ choice.exclude_query_string|iriencode }}">{{ choice.display }}
|
||||
<a role="menuitemcheckbox" class="choice-filter choice-filter--checked" href="{{ choice.exclude_query_string|iriencode }}">{{ choice.display }}
|
||||
<svg class="usa-icon position-absolute z-0 left-0" aria-hidden="true" focusable="false" role="img" width="24" height="24">
|
||||
<use xlink:href="{%static 'img/sprite.svg'%}#check_box_outline_blank"></use>
|
||||
</svg>
|
||||
|
@ -25,7 +28,7 @@
|
|||
</a>
|
||||
{% endif %}
|
||||
{% if not choice.selected and choice.include_query_string %}
|
||||
<a class="choice-filter" href="{{ choice.include_query_string|iriencode }}">{{ choice.display }}
|
||||
<a role="menuitemcheckbox" class="choice-filter" href="{{ choice.include_query_string|iriencode }}">{{ choice.display }}
|
||||
<svg class="usa-icon position-absolute z-0 left-0" aria-hidden="true" focusable="false" role="img" width="24" height="24">
|
||||
<use xlink:href="{%static 'img/sprite.svg'%}#check_box_outline_blank"></use>
|
||||
</svg>
|
||||
|
@ -33,5 +36,6 @@
|
|||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</details>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue