Include date hierarchy in quick removal links (#218)

* Include date hierarchy in quick removal links

* use date field name in removal link

* reduce diff

* tweak some details

* start adding tests

* use mock without spec :(

it's not easy to instantiate ChangeList, and speccing from
the class means that many attributes are not recognized

* more tests

* more tests

* more checks for generated URLs

* better tags and tests

* compat for tox 4
This commit is contained in:
Éric
2022-12-11 14:44:31 -05:00
committed by GitHub
parent c414c3ad4d
commit 19cbeead58
6 changed files with 197 additions and 21 deletions
@@ -0,0 +1,3 @@
<div class="changelist-filter-clear"><a href="{{ removal_link }}">
{{ date_label|capfirst }}: <span>{{ date_value|date:date_format|capfirst }}</span>&nbsp;&#10006;
</a></div>
@@ -1,6 +1,5 @@
{% load admin_interface_tags %}
{% if spec.lookup_val or spec.value %}
<div class="changelist-filter-clear"><a href="{% admin_interface_clear_filter_qs cl spec %}">
{{ title|capfirst }}: <span>{{ selected_value }}</span> &#10006;
<div class="changelist-filter-clear"><a href="{{ removal_link }}">
{{ title|capfirst }}: <span>{{ selected_value }}</span>&nbsp;&#10006;
</a></div>
{% endif %}