Skip to content

Commit de51292

Browse files
author
Your Name
committed
date_hierarchy
1 parent 26f6303 commit de51292

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

django_daisy/templates/admin/change_list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
{% if action_form and actions_on_top and cl.show_admin_actions %}
8484
{% admin_actions %}
8585
{% endif %}
86+
{% block date_hierarchy %}{% if cl.date_hierarchy %}{% date_hierarchy cl %}{% endif %}{% endblock %}
8687
<div class="object-tools inline-flex ms-auto flex-wrap max-md:justify-center gap-2 justify-between p-4 pe-1">
8788
{% block object-tools %}
8889
{% if cl.list_editable %}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{% load i18n %}
2+
{% if show %}
3+
<div class="dropdown dropdown-hover">
4+
<div tabindex="0" role="button" class="btn btn-outline btn-sm gap-2">
5+
<i class="fa fa-calendar"></i>
6+
<!-- {% trans 'Filter by date' %} -->
7+
{% if back %}
8+
<span class="badge badge-primary badge-sm">{{ back.title }}</span>
9+
{% endif %}
10+
</div>
11+
<ul tabindex="0" class="dropdown-content z-[1] menu p-2 shadow-lg bg-base-100 rounded-box w-64">
12+
{% if back %}
13+
<li>
14+
<a href="{{ back.link }}" class="flex items-center gap-2 text-primary hover:bg-primary hover:text-primary-content">
15+
<i class="fa fa-arrow-left"></i>
16+
{{ back.title }}
17+
</a>
18+
</li>
19+
<!-- <li><hr class="divider my-1"></li> -->
20+
{% endif %}
21+
{% for choice in choices %}
22+
<li>
23+
{% if choice.link %}
24+
<a href="{{ choice.link }}" class="hover:bg-base-200 {% if choice.title == current %}bg-primary text-primary-content{% endif %}">
25+
{{ choice.title }}
26+
</a>
27+
{% else %}
28+
<span class="text-base-content font-semibold bg-base-200 px-2 py-1 rounded">{{ choice.title }}</span>
29+
{% endif %}
30+
</li>
31+
{% endfor %}
32+
</ul>
33+
</div>
34+
{% endif %}

0 commit comments

Comments
 (0)