django-unfold 0.52.0__py3-none-any.whl → 0.54.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. {django_unfold-0.52.0.dist-info → django_unfold-0.54.0.dist-info}/METADATA +1 -1
  2. {django_unfold-0.52.0.dist-info → django_unfold-0.54.0.dist-info}/RECORD +42 -38
  3. {django_unfold-0.52.0.dist-info → django_unfold-0.54.0.dist-info}/WHEEL +1 -1
  4. unfold/contrib/filters/admin/__init__.py +17 -0
  5. unfold/contrib/filters/admin/choice_filters.py +134 -0
  6. unfold/contrib/filters/admin/dropdown_filters.py +3 -3
  7. unfold/contrib/filters/admin/mixins.py +1 -1
  8. unfold/contrib/filters/admin/text_filters.py +2 -2
  9. unfold/contrib/filters/forms.py +41 -3
  10. unfold/contrib/filters/templates/unfold/filters/filters_date_range.html +1 -1
  11. unfold/contrib/filters/templates/unfold/filters/filters_datetime_range.html +1 -1
  12. unfold/contrib/filters/templates/unfold/filters/filters_numeric_slider.html +1 -1
  13. unfold/decorators.py +10 -4
  14. unfold/forms.py +2 -1
  15. unfold/paginator.py +10 -0
  16. unfold/sites.py +8 -6
  17. unfold/static/admin/js/inlines.js +23 -3
  18. unfold/static/unfold/css/styles.css +1 -1
  19. unfold/styles.css +2 -1
  20. unfold/templates/admin/auth/user/add_form.html +1 -1
  21. unfold/templates/admin/change_form.html +9 -8
  22. unfold/templates/admin/change_list.html +15 -13
  23. unfold/templates/admin/change_list_results.html +1 -1
  24. unfold/templates/admin/edit_inline/tabular.html +1 -2
  25. unfold/templates/admin/pagination.html +4 -20
  26. unfold/templates/unfold/components/chart/cohort.html +2 -2
  27. unfold/templates/unfold/helpers/change_list_filter.html +2 -2
  28. unfold/templates/unfold/helpers/change_list_filter_actions.html +28 -26
  29. unfold/templates/unfold/helpers/edit_inline/tabular_field.html +10 -8
  30. unfold/templates/unfold/helpers/field.html +4 -2
  31. unfold/templates/unfold/helpers/fieldset_row.html +19 -7
  32. unfold/templates/unfold/helpers/form_label.html +1 -1
  33. unfold/templates/unfold/helpers/pagination_default.html +23 -0
  34. unfold/templates/unfold/helpers/pagination_infinite.html +11 -0
  35. unfold/templates/unfold/helpers/site_icon.html +14 -14
  36. unfold/templates/unfold/helpers/tab_action.html +18 -3
  37. unfold/templates/unfold/helpers/welcomemsg.html +2 -2
  38. unfold/templates/unfold/widgets/radio_option.html +1 -1
  39. unfold/templatetags/unfold.py +66 -29
  40. unfold/utils.py +11 -0
  41. unfold/widgets.py +2 -0
  42. {django_unfold-0.52.0.dist-info → django_unfold-0.54.0.dist-info}/LICENSE.md +0 -0
unfold/styles.css CHANGED
@@ -264,12 +264,13 @@ table tr.selected th {
264
264
  @apply hidden;
265
265
  }
266
266
 
267
+ .tabular-table tbody.has_original,
267
268
  .tabular-table .template tr {
268
269
  @apply border-t border-base-200 dark:border-base-800;
269
270
  }
270
271
 
271
272
  .add-row {
272
- @apply align-middle bg-base-50 px-3 py-5 font-normal text-right dark:bg-white/[.02];
273
+ @apply align-middle bg-white px-3 py-5 font-normal text-right dark:bg-base-900;
273
274
  }
274
275
 
275
276
  [data-inline-type="stacked"] .add-row {
@@ -6,7 +6,7 @@
6
6
  {% if not is_popup %}
7
7
  {% translate 'First, enter a username and password. Then, you’ll be able to edit more user options.' %}
8
8
  {% else %}
9
- {% translate "Enter a username and password." %}x
9
+ {% translate "Enter a username and password." %}
10
10
  {% endif %}
11
11
  <p>
12
12
  {% endblock %}
@@ -1,6 +1,6 @@
1
1
  {% extends "admin/base_site.html" %}
2
2
 
3
- {% load i18n admin_urls static admin_modify %}
3
+ {% load i18n admin_urls static admin_modify unfold %}
4
4
 
5
5
  {% block extrahead %}{{ block.super }}
6
6
  <script src="{% url 'admin:jsi18n' %}"></script>
@@ -65,7 +65,7 @@
65
65
  {% include adminform.model_admin.change_form_outer_before_template %}
66
66
  {% endif %}
67
67
 
68
- <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}{% if form_url %}action="{{ form_url }}" {% endif %}method="post" id="{{ opts.model_name }}_form" {% if adminform.model_admin.warn_unsaved_form %}class="warn-unsaved-form"{% endif %} novalidate>
68
+ <form {% if adminform.model_admin.conditional_fields %}x-data='{{ adminform|changeform_data }}'{% endif %} {% if has_file_field %}enctype="multipart/form-data" {% endif %}{% if form_url %}action="{{ form_url }}" {% endif %}method="post" id="{{ opts.model_name }}_form" {% if adminform.model_admin.warn_unsaved_form %}class="warn-unsaved-form"{% endif %} novalidate>
69
69
  {% csrf_token %}
70
70
 
71
71
  {% if adminform.model_admin.change_form_before_template %}
@@ -87,12 +87,13 @@
87
87
  {% include "unfold/helpers/messages/error.html" with errors=adminform.form.non_field_errors %}
88
88
 
89
89
  {% block field_sets %}
90
- {% for fieldset in adminform %}
91
- {% if "tab" not in fieldset.classes %}
92
- {% include 'admin/includes/fieldset.html' %}
93
- {% endif %}
94
- {% endfor %}
95
-
90
+ {% with has_conditional_display=adminform.model_admin.conditional_fields %}
91
+ {% for fieldset in adminform %}
92
+ {% if "tab" not in fieldset.classes %}
93
+ {% include 'admin/includes/fieldset.html' %}
94
+ {% endif %}
95
+ {% endfor %}
96
+ {% endwith %}
96
97
  {% include "unfold/helpers/fieldsets_tabs.html" %}
97
98
  {% endblock %}
98
99
 
@@ -74,21 +74,23 @@
74
74
  {% include cl.model_admin.list_before_template %}
75
75
  {% endif %}
76
76
 
77
- <div class="flex flex-col gap-4 mb-4 sm:flex-row empty:hidden lg:border lg:border-base-200 lg:dark:border-base-800 lg:-mb-8 lg:p-3 lg:pb-11 lg:rounded-t">
78
- {% block search %}
79
- {% search_form cl %}
80
- {% endblock %}
77
+ {% spaceless %}
78
+ <div class="flex flex-col gap-4 mb-4 sm:flex-row empty:hidden lg:border lg:border-base-200 lg:dark:border-base-800 lg:-mb-8 lg:p-3 lg:pb-11 lg:rounded-t">
79
+ {% block search %}
80
+ {% search_form cl %}
81
+ {% endblock %}
81
82
 
82
- {% block filters %}
83
- {% if cl.has_filters %}
84
- <a class="{% if cl.has_active_filters %}bg-primary-600 border-primary-600 text-white{% else %}bg-white border-base-200 hover:text-primary-600 dark:bg-base-900 dark:border-base-700 dark:hover:text-primary-500{% endif %} border cursor-pointer flex font-medium gap-2 group items-center px-3 py-2 rounded shadow-sm text-sm lg:ml-auto md:mt-0 {% if not cl.model_admin.list_filter_sheet %}2xl:hidden{% endif %}" x-on:click="filterOpen = true" x-on:keydown.escape.window="filterOpen = false">
85
- {% trans "Filters" %}
83
+ {% block filters %}
84
+ {% if cl.has_filters %}
85
+ <a class="{% if cl.has_active_filters %}bg-primary-600 border-primary-600 text-white{% else %}bg-white border-base-200 hover:text-primary-600 dark:bg-base-900 dark:border-base-700 dark:hover:text-primary-500{% endif %} border cursor-pointer flex font-medium gap-2 group items-center px-3 py-2 rounded shadow-sm text-sm lg:ml-auto md:mt-0 {% if not cl.model_admin.list_filter_sheet %}2xl:hidden{% endif %}" x-on:click="filterOpen = true" x-on:keydown.escape.window="filterOpen = false">
86
+ {% trans "Filters" %}
86
87
 
87
- <span class="material-symbols-outlined md-18 ml-auto">filter_list</span>
88
- </a>
89
- {% endif %}
90
- {% endblock %}
91
- </div>
88
+ <span class="material-symbols-outlined md-18 ml-auto">filter_list</span>
89
+ </a>
90
+ {% endif %}
91
+ {% endblock %}
92
+ </div>
93
+ {% endspaceless %}
92
94
 
93
95
  <form id="changelist-form" class="group" method="post"{% if cl.formset and cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate>
94
96
  {% csrf_token %}
@@ -100,7 +100,7 @@
100
100
 
101
101
  {% if cl.model_admin.list_sections|length > 0 %}
102
102
  <tr class="block mb-3 lg:table-row" x-show="rowOpen">
103
- <td colspan="{{ result|length|add:1 }}" class="border bg-base-200/10 block border-base-200 relative rounded p-3 lg:shadow-inner lg:border-0 lg:border-t lg:rounded-none lg:table-cell dark:border-base-800">
103
+ <td colspan="{{ result|length|add:2 }}" class="border bg-base-200/10 block border-base-200 relative rounded p-3 lg:shadow-inner lg:border-0 lg:border-t lg:rounded-none lg:table-cell dark:border-base-800">
104
104
  <div class="absolute bg-primary-600 h-full hidden left-0 top-0 w-0.5 lg:block"></div>
105
105
 
106
106
  <div class="grid gap-3 {{ cl.model_admin.list_sections_classes }}">
@@ -18,9 +18,8 @@
18
18
  {% if inline_admin_formset.is_collapsible %}</summary>{% endif %}
19
19
 
20
20
  {{ inline_admin_formset.formset.non_form_errors }}
21
-
22
21
  <div class="border border-base-200 mb-6 overflow-x-auto rounded shadow-sm dark:border-base-800" data-simplebar data-simplebar-auto-hide="false">
23
- <table class="tabular-table w-full" {% if inline_admin_formset.opts.ordering_field %}data-ordering-field="{{ inline_admin_formset.opts.ordering_field }}" x-on:end="sortRecords" x-sort.ghost{% endif %}>
22
+ <table class="tabular-table w-full [&>tbody:nth-child(odd)]:bg-base-50 [&>tbody:nth-child(odd)]:dark:bg-white/[.02]" {% if inline_admin_formset.opts.ordering_field %}data-ordering-field="{{ inline_admin_formset.opts.ordering_field }}" x-on:end="sortRecords" x-sort.ghost{% endif %}>
24
23
  {% include "unfold/helpers/edit_inline/tabular_heading.html" %}
25
24
 
26
25
  {% for inline_admin_form in inline_admin_formset %}
@@ -4,28 +4,12 @@
4
4
  <div class="{% if not is_popup %}max-w-full lg:bottom-0 lg:fixed lg:left-0 lg:right-0{% endif %}" {% if not is_popup %}x-bind:class="{'xl:left-0': !sidebarDesktopOpen, 'xl:left-72': sidebarDesktopOpen}"{% endif %} x-bind:style="'width: ' + mainWidth + 'px'">
5
5
  <div class="lg:backdrop-blur-sm lg:bg-white/80 lg:flex lg:items-center lg:dark:bg-base-900/80 {% if not is_popup %}lg:border-t lg:border-base-200 lg:h-[71px] lg:py-2 lg:relative lg:scrollable-top lg:px-8 lg:dark:border-base-800{% endif %}">
6
6
  <div class="flex flex-row items-center {% if not cl.model_admin.list_fullwidth %}lg:mx-auto{% endif %}" x-bind:style="'width: ' + changeListWidth + 'px'">
7
- {% if pagination_required %}
8
- {% for i in page_range %}
9
- <div class="{% if forloop.last %}pr-2{% else %}pr-4{% endif %}">
10
- {% paginator_number cl i %}
11
- </div>
12
- {% endfor %}
7
+ {% if cl.paginator.template_name %}
8
+ {% include cl.paginator.template_name %}
9
+ {% else %}
10
+ {% include "unfold/helpers/pagination_default.html" %}
13
11
  {% endif %}
14
12
 
15
- <div class="py-4">
16
- {% if pagination_required %}
17
- -
18
- {% endif %}
19
-
20
- {{ cl.result_count }}
21
-
22
- {% if cl.result_count == 1 %}
23
- {{ cl.opts.verbose_name }}
24
- {% else %}
25
- {{ cl.opts.verbose_name_plural }}
26
- {% endif %}
27
- </div>
28
-
29
13
  {% if show_all_url %}
30
14
  <a href="{{ show_all_url }}" class="showall ml-4 text-primary-600 dark:text-primary-500">
31
15
  {% translate 'Show all' %}
@@ -5,7 +5,7 @@
5
5
  <th></th>
6
6
 
7
7
  {% for header in data.headers %}
8
- <th class="font-normal px-3 pb-2.5 text-left ">
8
+ <th class="font-normal px-3 pb-2.5 text-left">
9
9
  <div class="font-semibold text-font-important-light truncate dark:text-font-important-dark">
10
10
  {{ header.title }}
11
11
  </div>
@@ -25,7 +25,7 @@
25
25
  <tr class="h-full">
26
26
  <td>
27
27
  <div class="pr-3 py-2.5">
28
- <div class="font-semibold text-font-important-light dark:text-font-important-dark">
28
+ <div class="font-semibold text-font-important-light truncate dark:text-font-important-dark">
29
29
  {{ row.header.title }}
30
30
  </div>
31
31
 
@@ -10,8 +10,8 @@
10
10
  {% preserve_filters %}
11
11
  {% endif %}
12
12
 
13
- <div class="flex flex-col grow gap-4 overflow-auto *:mb-0" data-simplebar data-simplebar-direction="rtl">
14
- <div class="flex flex-col gap-4 mx-1 px-2 py-2.5 {% if not cl.model_admin.list_filter_sheet %} 2xl:px-0 2xl:py-0{% endif %} *:mb-0">
13
+ <div class="flex flex-col grow gap-4 overflow-auto *:mb-0 {% if not cl.model_admin.list_filter_sheet %}2xl:-mx-1{% endif %}" data-simplebar data-simplebar-direction="rtl">
14
+ <div class="flex flex-col gap-4 px-3 py-2.5 {% if not cl.model_admin.list_filter_sheet %}2xl:pb-1 2xl:px-1 2xl:py-0{% endif %} *:mb-0">
15
15
  {% for spec in cl.filter_specs %}
16
16
  {% admin_list_filter cl spec %}
17
17
  {% endfor %}
@@ -1,31 +1,33 @@
1
1
  {% load i18n %}
2
2
 
3
- <div class="bg-white border-t border-base-200 p-3 py-2.5 dark:bg-base-800 dark:border-base-700{% if not cl.model_admin.list_filter_sheet %} 2xl:!border-t-0 2xl:!bg-transparent 2xl:px-0{% endif %}">
4
- {% if cl.model_admin.list_filter_submit %}
5
- <button type="submit" class="bg-primary-600 block border border-transparent font-medium px-3 py-2 rounded text-white w-full">
6
- {% trans "Apply Filters" %}
7
- </button>
8
- {% endif %}
3
+ {% if cl.model_admin.list_filter_submit or cl.is_facets_optional or cl.has_active_filters %}
4
+ <div class="bg-white border-t border-base-200 p-3 py-2.5 dark:bg-base-800 dark:border-base-700{% if not cl.model_admin.list_filter_sheet %} 2xl:!border-t-0 2xl:!bg-transparent 2xl:px-0{% endif %}">
5
+ {% if cl.model_admin.list_filter_submit %}
6
+ <button type="submit" class="bg-primary-600 block border border-transparent font-medium px-3 py-2 rounded text-white w-full">
7
+ {% trans "Apply Filters" %}
8
+ </button>
9
+ {% endif %}
9
10
 
10
- {% if cl.is_facets_optional or cl.has_active_filters %}
11
- <span id="changelist-filter-extra-actions" class="flex flex-row gap-2 items-center mt-2">
12
- {% if cl.is_facets_optional %}
13
- {% if cl.add_facets %}
14
- <a href="{{ cl.remove_facet_link }}" class="hidelink border flex-grow font-medium px-3 py-2 rounded text-center transition-all w-full hover:bg-base-50 lg:w-auto dark:border-base-700 dark:hover:text-base-200">
15
- {% trans "Hide counts" %}
16
- </a>
17
- {% else %}
18
- <a href="{{ cl.add_facet_link }}" class="viewlink border flex-grow font-medium px-3 py-2 rounded text-center transition-all w-full lg:w-auto dark:border-base-700 dark:hover:text-base-200">
19
- {% trans "Show counts" %}
20
- </a>
11
+ {% if cl.is_facets_optional or cl.has_active_filters %}
12
+ <span id="changelist-filter-extra-actions" class="flex flex-row gap-2 items-center mt-2">
13
+ {% if cl.is_facets_optional %}
14
+ {% if cl.add_facets %}
15
+ <a href="{{ cl.remove_facet_link }}" class="hidelink border flex-grow font-medium px-3 py-2 rounded text-center transition-all w-full hover:bg-base-50 lg:w-auto dark:border-base-700 dark:hover:text-base-200">
16
+ {% trans "Hide counts" %}
17
+ </a>
18
+ {% else %}
19
+ <a href="{{ cl.add_facet_link }}" class="viewlink border flex-grow font-medium px-3 py-2 rounded text-center transition-all w-full lg:w-auto dark:border-base-700 dark:hover:text-base-200">
20
+ {% trans "Show counts" %}
21
+ </a>
22
+ {% endif %}
21
23
  {% endif %}
22
- {% endif %}
23
24
 
24
- {% if cl.has_active_filters %}
25
- <a href="{{ cl.clear_all_filters_qs }}" class="border flex-grow font-medium px-3 py-2 rounded text-center transition-all w-full lg:w-auto dark:border-base-700 dark:hover:text-base-200">
26
- {% trans "Clear all filters" %}
27
- </a>
28
- {% endif %}
29
- </span>
30
- {% endif %}
31
- </div>
25
+ {% if cl.has_active_filters %}
26
+ <a href="{{ cl.clear_all_filters_qs }}" class="border flex-grow font-medium px-3 py-2 rounded text-center transition-all w-full lg:w-auto dark:border-base-700 dark:hover:text-base-200">
27
+ {% trans "Clear all filters" %}
28
+ </a>
29
+ {% endif %}
30
+ </span>
31
+ {% endif %}
32
+ </div>
33
+ {% endif %}
@@ -12,14 +12,16 @@
12
12
  {% if field.is_readonly %}
13
13
  {% include "unfold/helpers/field_readonly_value.html" with tabular=1 %}
14
14
  {% else %}
15
- {{ field.field }}
15
+ <div class="flex flex-col">
16
+ {{ field.field }}
16
17
 
17
- {% if field.field.errors|length > 0 %}
18
- <div class="mt-1 text-red-600 text-sm dark:text-red-500">
19
- {% for error in field.field.errors %}
20
- {{ error }}
21
- {% endfor %}
22
- </div>
23
- {% endif %}
18
+ {% if field.field.errors|length > 0 %}
19
+ <div class="mt-1 text-red-600 text-sm dark:text-red-500">
20
+ {% for error in field.field.errors %}
21
+ {{ error }}
22
+ {% endfor %}
23
+ </div>
24
+ {% endif %}
25
+ </div>
24
26
  {% endif %}
25
27
  </div>
@@ -1,4 +1,6 @@
1
- {% if field.field.widget.input_type == "checkbox" %}
1
+ {% load unfold %}
2
+
3
+ {% if field.field.widget.input_type == "checkbox" and field.field.widget|class_name != "UnfoldAdminCheckboxSelectMultiple"%}
2
4
  <div class="{% if field.errors %}errors {% endif %}flex flex-col group mb-6 last:mb-4">
3
5
  <div class="flex flex-row gap-2 items-center">
4
6
  {{ field }}
@@ -11,7 +13,7 @@
11
13
  {% include "unfold/helpers/help_text.html" with help_text=field.help_text %}
12
14
  </div>
13
15
  {% else %}
14
- <div class="{% if field.errors %}errors {% endif %}flex flex-col group mb-6 last:mb-4">
16
+ <div class="{% if field.errors %}errors {% endif %}flex flex-col gap-2 group mb-6 last:mb-4">
15
17
  {% include "unfold/helpers/form_label.html" with field=field %}
16
18
 
17
19
  {{ field }}
@@ -2,12 +2,24 @@
2
2
 
3
3
  <div class="{% fieldset_row_classes %} {% if forloop.last %}last{% endif %}">
4
4
  {% for field in line %}
5
- <div class="{% fieldset_line_classes %}">
6
- {% if field.is_checkbox %}
7
- {% include "unfold/helpers/fieldset_row_checkbox.html" %}
8
- {% else %}
9
- {% include "unfold/helpers/fieldset_row_field.html" %}
10
- {% endif %}
11
- </div>
5
+ {% with adminform.model_admin.conditional_fields|index:field.field.name as conditional_display %}
6
+ <div class="{% fieldset_line_classes %}" {% if has_conditional_display and conditional_display %}x-show="{{ conditional_display }}"{% endif %}>
7
+ {% if has_conditional_display %}
8
+ {% with field|changeform_condition as field %}
9
+ {% if field.is_checkbox %}
10
+ {% include "unfold/helpers/fieldset_row_checkbox.html" %}
11
+ {% else %}
12
+ {% include "unfold/helpers/fieldset_row_field.html" %}
13
+ {% endif %}
14
+ {% endwith %}
15
+ {% else %}
16
+ {% if field.is_checkbox %}
17
+ {% include "unfold/helpers/fieldset_row_checkbox.html" %}
18
+ {% else %}
19
+ {% include "unfold/helpers/fieldset_row_field.html" %}
20
+ {% endif %}
21
+ {% endif %}
22
+ </div>
23
+ {% endwith %}
12
24
  {% endfor %}
13
25
  </div>
@@ -1,4 +1,4 @@
1
- <label for="{{ field.id_for_label }}" class="block text-font-important-light dark:text-font-important-dark{% if field.field.widget.input_type == "checkbox" %}{% else %} font-semibold mb-2{% endif %}">
1
+ <label for="{{ field.id_for_label }}" class="block font-semibold text-font-important-light dark:text-font-important-dark">
2
2
  {{ field.label }}
3
3
 
4
4
  {% if field.field.required %}
@@ -0,0 +1,23 @@
1
+ {% load unfold_list %}
2
+
3
+ {% if pagination_required %}
4
+ {% for i in page_range %}
5
+ <div class="{% if forloop.last %}pr-2{% else %}pr-4{% endif %}">
6
+ {% paginator_number cl i %}
7
+ </div>
8
+ {% endfor %}
9
+ {% endif %}
10
+
11
+ <div class="py-4">
12
+ {% if pagination_required %}
13
+ -
14
+ {% endif %}
15
+
16
+ {{ cl.result_count }}
17
+
18
+ {% if cl.result_count == 1 %}
19
+ {{ cl.opts.verbose_name }}
20
+ {% else %}
21
+ {{ cl.opts.verbose_name_plural }}
22
+ {% endif %}
23
+ </div>
@@ -0,0 +1,11 @@
1
+ {% load unfold_list i18n %}
2
+
3
+ <div class="flex flex-row gap-4">
4
+ <a {% if cl.page_num != 1 %}href="?p={{ cl.page_num|add:-1 }}"{% endif %} class="{% if cl.page_num != 1 %}hover:text-primary-600 dark:hover:text-primary-500{% endif %}">
5
+ {% trans "Previous" %}
6
+ </a>
7
+
8
+ <a href="?p={{ cl.page_num|add:1 }}" class="hover:text-primary-600 dark:hover:text-primary-500">
9
+ {% trans "Next" %}
10
+ </a>
11
+ </div>
@@ -2,29 +2,29 @@
2
2
 
3
3
  {% if site_icon %}
4
4
  <div class="shrink-0">
5
- <a href="{% url "admin:index" %}">
6
- {% if site_icon.light and site_icon.dark %}
7
- <img src="{{ site_icon.dark }}" alt="{% trans 'Home' %}" class="h-8 hidden dark:block"/>
5
+ <{% if site_dropdown %}span{% else %}a href="{% url "admin:index" %}"{% endif %}>
6
+ {% if site_icon.light and site_icon.dark %}
7
+ <img src="{{ site_icon.dark }}" alt="{% trans 'Home' %}" class="h-8 hidden dark:block"/>
8
8
 
9
- <img src="{{ site_icon.light }}" alt="{% trans 'Home' %}" class="block h-8 dark:hidden" />
10
- {% else %}
11
- <img src="{{ site_icon }}" class="h-8" alt="{% trans 'Home' %}" />
12
- {% endif %}
13
- </a>
9
+ <img src="{{ site_icon.light }}" alt="{% trans 'Home' %}" class="block h-8 dark:hidden" />
10
+ {% else %}
11
+ <img src="{{ site_icon }}" class="h-8" alt="{% trans 'Home' %}" />
12
+ {% endif %}
13
+ </{% if site_dropdown %}span{% else %}a{% endif %}>
14
14
  </div>
15
15
  {% else %}
16
- <a href="{% url "admin:index" %}" class="bg-primary-600 flex h-8 items-center justify-center rounded text-white text-xs w-8">
17
- <span class="material-symbols-outlined md-18">{% if site_symbol %}{{ site_symbol }}{% else %}settings{% endif %}</span>
18
- </a>
16
+ <{% if site_dropdown %}span{% else %}a href="{% url "admin:index" %}"{% endif %} class="bg-primary-600 flex h-8 items-center justify-center rounded shrink-0 text-white text-xs w-8">
17
+ <span class="material-symbols-outlined md-18">{% if site_symbol %}{{ site_symbol }}{% else %}settings{% endif %}</span>
18
+ </{% if site_dropdown %}span{% else %}a{% endif %}>
19
19
  {% endif %}
20
20
 
21
- <div class="flex flex-col grow min-w-0">
22
- <div class="text-font-important-light leading-normal tracking-tight dark:text-font-important-dark *:leading-none {% if site_subheader %}xl:text-sm{% else %}xl:text-base{% endif %}">
21
+ <div class="flex flex-col gap-0.5 grow justify-center min-w-0">
22
+ <div class="text-font-important-light leading-normal tracking-tight dark:text-font-important-dark *:leading-none *:truncate {% if site_subheader %}xl:text-sm{% else %}xl:text-base{% endif %}">
23
23
  {{ branding }}
24
24
  </div>
25
25
 
26
26
  {% if site_subheader %}
27
- <div class="font-normal leading-normal text-font-subtle-light text-xs truncate dark:text-font-subtle-dark">
27
+ <div class="font-normal text-font-subtle-light text-xs leading-none dark:text-font-subtle-dark">
28
28
  {{ site_subheader }}
29
29
  </div>
30
30
  {% endif %}
@@ -15,8 +15,23 @@
15
15
  {{ title }}
16
16
 
17
17
  {% if not link %}
18
- <span class="material-symbols-outlined ml-auto rotate-90">
19
- chevron_right
18
+ <span class="border-l border-base-200 flex items-center select-none self-stretch ml-1 -mr-1 -my-2 pl-2
19
+ {% if action.variant.value == "primary" %}
20
+ border-primary-700 dark:border-primary-500
21
+ {% elif action.variant.value == "danger" %}
22
+ border-red-700 dark:border-red-500
23
+ {% elif action.variant.value == "success" %}
24
+ border-green-700 dark:border-green-500
25
+ {% elif action.variant.value == "info" %}
26
+ border-blue-700 dark:border-blue-500
27
+ {% elif action.variant.value == "warning" %}
28
+ border-orange-700 dark:border-orange-500
29
+ {% else %}
30
+ border-base-200 dark:border-base-700
31
+ {% endif %}">
32
+ <span class="material-symbols-outlined ml-auto rotate-90 transition-transform" x-bind:class="{'!-rotate-90': actionDropdownOpen }">
33
+ chevron_right
34
+ </span>
20
35
  </span>
21
36
  {% endif %}
22
37
  </a>
@@ -25,7 +40,7 @@
25
40
  <template x-teleport="body">
26
41
  <nav x-anchor.bottom-end.offset.4="$refs.actionDropdown{{ action.method_name }}" class="absolute bg-white border flex flex-col -mr-px py-1 right-0 rounded shadow-lg top-10 w-52 z-50 dark:bg-base-800 dark:border-base-700" x-transition x-show="actionDropdownOpen" x-on:click.outside="actionDropdownOpen = false">
27
42
  {% for item in action.items %}
28
- <a href="{{ item.path }}" class="flex items-center font-normal gap-2 max-h-[30px] mx-1 px-3 py-2 rounded text-left hover:bg-base-100 hover:text-base-700 dark:hover:bg-base-700 dark:hover:text-base-200"{% if blank %} target="_blank"{% endif %} {% include "unfold/helpers/attrs.html" with attrs=action.attrs %}>
43
+ <a href="{{ item.path }}" class="flex items-center font-normal gap-2 max-h-[30px] mx-1 px-3 py-2 rounded text-left hover:bg-base-100 hover:text-base-700 dark:hover:bg-base-700 dark:hover:text-base-200"{% if blank %} target="_blank"{% endif %} {% include "unfold/helpers/attrs.html" with attrs=item.attrs %}>
29
44
  {% if item.icon %}
30
45
  <span class="material-symbols-outlined">
31
46
  {{ item.icon }}
@@ -1,4 +1,4 @@
1
- {% load i18n %}
1
+ {% load unfold i18n %}
2
2
 
3
3
  <div class="flex flex-row flex-grow font-semibold items-center min-w-0 mr-3">
4
4
  <span class="cursor-pointer flex flex-row items-center">
@@ -23,7 +23,7 @@
23
23
  {{ content_title }}
24
24
  </span>
25
25
 
26
- {% if cl and cl.full_result_count != cl.result_count %}
26
+ {% if cl and cl.full_result_count != cl.result_count and cl.paginator|class_name != "InfinitePaginator" %}
27
27
  <span class="font-medium ml-2 text-font-subtle-light text-sm dark:text-font-subtle-dark">
28
28
  {% blocktranslate count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktranslate %} (<a href="?{% if cl.is_popup %}_popup=1{% endif %}">{% if cl.show_full_result_count %}{% blocktranslate with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktranslate %}{% else %}{% translate "Show all" %}{% endif %}</a>)
29
29
  </span>
@@ -5,7 +5,7 @@
5
5
  {% include "django/forms/widgets/input.html" %}
6
6
 
7
7
  {% if widget.wrap_label %}
8
- <span>
8
+ <span class="truncate">
9
9
  {{ widget.label }}
10
10
  </span>
11
11
  </label>