mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-19 19:09:22 +02:00
changing exclude / include to checkboxes
This commit is contained in:
parent
12524403ef
commit
f200ba465c
3 changed files with 37 additions and 0 deletions
|
@ -966,6 +966,8 @@ class DomainRequestAdmin(ListHeaderAdmin):
|
|||
title = "Status"
|
||||
parameter_name = "status__in"
|
||||
|
||||
template = "django/admin/multiple_choice_list_filter.html"
|
||||
|
||||
def lookups(self, request, model_admin):
|
||||
return DomainRequest.DomainRequestStatus.choices
|
||||
|
||||
|
|
|
@ -350,3 +350,15 @@ input.admin-confirm-button {
|
|||
.errors span.select2-selection {
|
||||
border: 1px solid var(--error-fg) !important;
|
||||
}
|
||||
|
||||
.choice-filter {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.choice-filter--checked {
|
||||
background-image: url("/public/img/sprite.svg#check");
|
||||
}
|
||||
|
||||
.choice-filter--unchecked {
|
||||
background-image: url("/public/img/sprite.svg#check_box_outline_blank");
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
{% load i18n %}
|
||||
<h3>{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktrans %}</h3>
|
||||
<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 %}
|
||||
{% 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>
|
||||
{% endif %}
|
||||
{% if not choice.selected and choice.include_query_string %}
|
||||
<a class="choice-filter choice-filter--unchecked" href="{{ choice.include_query_string|iriencode }}">{{ choice.display }}</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
Loading…
Add table
Add a link
Reference in a new issue