django-unfold 0.42.0__py3-none-any.whl → 0.44.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. {django_unfold-0.42.0.dist-info → django_unfold-0.44.0.dist-info}/METADATA +1 -1
  2. django_unfold-0.44.0.dist-info/RECORD +227 -0
  3. {django_unfold-0.42.0.dist-info → django_unfold-0.44.0.dist-info}/WHEEL +1 -1
  4. unfold/admin.py +2 -0
  5. unfold/components.py +47 -0
  6. unfold/contrib/filters/admin.py +5 -5
  7. unfold/contrib/filters/templates/unfold/filters/filters_date_range.html +1 -1
  8. unfold/contrib/filters/templates/unfold/filters/filters_datetime_range.html +1 -1
  9. unfold/contrib/filters/templates/unfold/filters/filters_numeric_range.html +1 -1
  10. unfold/contrib/filters/templates/unfold/filters/filters_numeric_single.html +1 -1
  11. unfold/contrib/filters/templates/unfold/filters/filters_numeric_slider.html +3 -3
  12. unfold/contrib/forms/templates/unfold/forms/array.html +3 -3
  13. unfold/contrib/forms/templates/unfold/forms/helpers/toolbar.html +25 -25
  14. unfold/contrib/forms/widgets.py +5 -5
  15. unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage.html +1 -1
  16. unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_group.html +2 -2
  17. unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_user.html +2 -2
  18. unfold/contrib/guardian/templates/unfold/guardian/group_form.html +8 -8
  19. unfold/contrib/guardian/templates/unfold/guardian/user_form.html +8 -8
  20. unfold/contrib/import_export/templates/admin/import_export/change_form.html +1 -1
  21. unfold/contrib/import_export/templates/admin/import_export/export.html +4 -4
  22. unfold/contrib/import_export/templates/admin/import_export/import_confirm.html +4 -4
  23. unfold/contrib/import_export/templates/admin/import_export/import_errors.html +2 -2
  24. unfold/contrib/import_export/templates/admin/import_export/import_form.html +2 -2
  25. unfold/contrib/import_export/templates/admin/import_export/import_preview.html +5 -5
  26. unfold/contrib/import_export/templates/admin/import_export/import_validation.html +30 -25
  27. unfold/contrib/import_export/templates/admin/import_export/resource_fields_list.html +5 -3
  28. unfold/contrib/simple_history/templates/simple_history/object_history.html +2 -2
  29. unfold/contrib/simple_history/templates/simple_history/object_history_form.html +1 -1
  30. unfold/contrib/simple_history/templates/simple_history/object_history_list.html +9 -9
  31. unfold/contrib/simple_history/templates/simple_history/submit_line.html +4 -4
  32. unfold/forms.py +13 -2
  33. unfold/settings.py +20 -7
  34. unfold/sites.py +23 -8
  35. unfold/static/admin/js/inlines.js +2 -2
  36. unfold/static/unfold/css/styles.css +1 -1
  37. unfold/static/unfold/js/alpine.resize.js +1 -0
  38. unfold/static/unfold/js/app.js +52 -71
  39. unfold/static/unfold/js/htmx.js +1 -1
  40. unfold/styles.css +67 -71
  41. unfold/templates/admin/actions.html +19 -17
  42. unfold/templates/admin/app_list.html +3 -3
  43. unfold/templates/admin/auth/user/add_form.html +1 -1
  44. unfold/templates/admin/auth/user/change_password.html +2 -2
  45. unfold/templates/admin/base.html +1 -1
  46. unfold/templates/admin/change_form.html +8 -0
  47. unfold/templates/admin/change_list.html +24 -30
  48. unfold/templates/admin/change_list_results.html +40 -6
  49. unfold/templates/admin/date_hierarchy.html +1 -1
  50. unfold/templates/admin/delete_confirmation.html +7 -7
  51. unfold/templates/admin/delete_selected_confirmation.html +7 -7
  52. unfold/templates/admin/edit_inline/stacked.html +4 -4
  53. unfold/templates/admin/edit_inline/tabular.html +8 -151
  54. unfold/templates/admin/filter.html +7 -7
  55. unfold/templates/admin/includes/fieldset.html +2 -2
  56. unfold/templates/admin/includes/object_delete_summary.html +1 -1
  57. unfold/templates/admin/login.html +4 -4
  58. unfold/templates/admin/nav_sidebar.html +1 -17
  59. unfold/templates/admin/object_history.html +7 -7
  60. unfold/templates/admin/pagination.html +36 -30
  61. unfold/templates/admin/search_form.html +11 -9
  62. unfold/templates/admin/submit_line.html +11 -11
  63. unfold/templates/auth/widgets/read_only_password_hash.html +1 -1
  64. unfold/templates/registration/logged_out.html +3 -3
  65. unfold/templates/registration/password_change_done.html +1 -1
  66. unfold/templates/registration/password_change_form.html +1 -1
  67. unfold/templates/unfold/components/button.html +1 -1
  68. unfold/templates/unfold/components/card.html +4 -4
  69. unfold/templates/unfold/components/chart/cohort.html +59 -0
  70. unfold/templates/unfold/components/navigation.html +2 -2
  71. unfold/templates/unfold/components/separator.html +1 -1
  72. unfold/templates/unfold/components/table.html +6 -6
  73. unfold/templates/unfold/components/tracker.html +5 -0
  74. unfold/templates/unfold/helpers/account_links.html +6 -6
  75. unfold/templates/unfold/helpers/actions_row.html +5 -5
  76. unfold/templates/unfold/helpers/add_link.html +1 -1
  77. unfold/templates/unfold/helpers/app_list.html +10 -10
  78. unfold/templates/unfold/helpers/app_list_default.html +10 -10
  79. unfold/templates/unfold/helpers/boolean.html +1 -1
  80. unfold/templates/unfold/helpers/breadcrumb_item.html +1 -1
  81. unfold/templates/unfold/helpers/change_list_actions.html +13 -0
  82. unfold/templates/unfold/helpers/change_list_filter.html +31 -0
  83. unfold/templates/unfold/helpers/change_list_filter_actions.html +23 -0
  84. unfold/templates/unfold/helpers/delete_submit_line.html +2 -2
  85. unfold/templates/unfold/helpers/display_header.html +3 -3
  86. unfold/templates/unfold/helpers/edit_inline/tabular_delete.html +13 -0
  87. unfold/templates/unfold/helpers/edit_inline/tabular_error.html +8 -0
  88. unfold/templates/unfold/helpers/edit_inline/tabular_field.html +25 -0
  89. unfold/templates/unfold/helpers/edit_inline/tabular_heading.html +25 -0
  90. unfold/templates/unfold/helpers/edit_inline/tabular_row.html +27 -0
  91. unfold/templates/unfold/helpers/edit_inline/tabular_title.html +49 -0
  92. unfold/templates/unfold/helpers/field_readonly.html +1 -1
  93. unfold/templates/unfold/helpers/field_readonly_value.html +1 -1
  94. unfold/templates/unfold/helpers/fieldset_row.html +5 -73
  95. unfold/templates/unfold/helpers/fieldset_row_checkbox.html +45 -0
  96. unfold/templates/unfold/helpers/fieldset_row_field.html +21 -0
  97. unfold/templates/unfold/helpers/fieldsets_tabs.html +2 -2
  98. unfold/templates/unfold/helpers/header.html +1 -1
  99. unfold/templates/unfold/helpers/history.html +4 -4
  100. unfold/templates/unfold/helpers/label.html +1 -1
  101. unfold/templates/unfold/helpers/language_switch.html +3 -3
  102. unfold/templates/unfold/helpers/messages/debug.html +3 -0
  103. unfold/templates/unfold/helpers/messages/error.html +5 -3
  104. unfold/templates/unfold/helpers/messages/errornote.html +1 -1
  105. unfold/templates/unfold/helpers/messages/info.html +2 -2
  106. unfold/templates/unfold/helpers/messages/success.html +3 -0
  107. unfold/templates/unfold/helpers/messages/warning.html +3 -0
  108. unfold/templates/unfold/helpers/messages.html +13 -14
  109. unfold/templates/unfold/helpers/navigation.html +3 -11
  110. unfold/templates/unfold/helpers/navigation_header.html +13 -0
  111. unfold/templates/unfold/helpers/pagination_ellipsis.html +1 -1
  112. unfold/templates/unfold/helpers/search.html +5 -5
  113. unfold/templates/unfold/helpers/search_results.html +2 -2
  114. unfold/templates/unfold/helpers/site_icon.html +7 -5
  115. unfold/templates/unfold/helpers/site_logo.html +1 -1
  116. unfold/templates/unfold/helpers/submit.html +1 -1
  117. unfold/templates/unfold/helpers/tab_action.html +2 -2
  118. unfold/templates/unfold/helpers/tab_list.html +9 -9
  119. unfold/templates/unfold/helpers/theme_switch.html +5 -5
  120. unfold/templates/unfold/helpers/userlinks.html +4 -0
  121. unfold/templates/unfold/helpers/welcomemsg.html +13 -1
  122. unfold/templates/unfold/layouts/base_simple.html +2 -2
  123. unfold/templates/unfold/layouts/skeleton.html +12 -6
  124. unfold/templates/unfold/widgets/clearable_file_input.html +6 -6
  125. unfold/templates/unfold/widgets/clearable_file_input_small.html +7 -7
  126. unfold/templates/unfold/widgets/foreign_key_raw_id.html +1 -1
  127. unfold/templates/unfold/widgets/radio.html +1 -1
  128. unfold/templates/unfold/widgets/range.html +1 -1
  129. unfold/templates/unfold/widgets/related_widget_wrapper.html +4 -4
  130. unfold/templates/unfold/widgets/textarea_expandable.html +1 -1
  131. unfold/templatetags/unfold.py +130 -7
  132. unfold/templatetags/unfold_list.py +9 -4
  133. unfold/widgets.py +31 -28
  134. django_unfold-0.42.0.dist-info/RECORD +0 -209
  135. unfold/templates/unfold/change_list_filter.html +0 -59
  136. {django_unfold-0.42.0.dist-info → django_unfold-0.44.0.dist-info}/LICENSE.md +0 -0
@@ -3,43 +3,43 @@
3
3
  {% if app_list %}
4
4
  {% for app in app_list %}
5
5
  <div class="app-{{ app.app_label }} module{% if app.app_url in request.path %} current-app{% endif %}">
6
- <div class="bg-gray-50 mb-6 rounded-md p-3 dark:bg-gray-800">
7
- <table class="border border-gray-400/10 border-spacing-none border-separate rounded-md overflow-hidden shadow-sm w-full dark:border-gray-800">
8
- <caption class="font-semibold mb-3 text-gray-900 text-left dark:text-gray-100">
6
+ <div class="bg-base-50 mb-6 rounded p-3 dark:bg-base-800">
7
+ <table class="border border-base-400/10 border-spacing-none border-separate rounded overflow-hidden shadow-sm w-full dark:border-base-800">
8
+ <caption class="font-semibold mb-3 text-base-900 text-left dark:text-base-100">
9
9
  <a href="{{ app.app_url }}" class="section" title="{% blocktranslate with name=app.name %}Models in the {{ name }} application{% endblocktranslate %}">
10
10
  {{ app.name }}
11
11
  </a>
12
12
  </caption>
13
13
 
14
14
  {% for model in app.models %}
15
- <tr class="bg-white dark:bg-gray-900 model-{{ model.object_name|lower }}{% if model.admin_url in request.path %} current-model{% endif %}">
15
+ <tr class="bg-white dark:bg-base-900 model-{{ model.object_name|lower }}{% if model.admin_url in request.path %} current-model{% endif %}">
16
16
  {% if model.admin_url %}
17
- <th scope="row" class="font-normal p-3 text-left {% if not forloop.last %}border-b border-gray-100 dark:border-gray-800{% endif %}">
17
+ <th scope="row" class="font-normal p-3 text-left {% if not forloop.last %}border-b border-base-100 dark:border-base-800{% endif %}">
18
18
  <a href="{{ model.admin_url }}"{% if model.admin_url in request.path %} aria-current="page"{% endif %}>
19
19
  {{ model.name }}
20
20
  </a>
21
21
  </th>
22
22
  {% else %}
23
- <th scope="row" class="font-normal p-3 text-left {% if not forloop.last %}border-b border-gray-100 dark:border-gray-800{% endif %}">
23
+ <th scope="row" class="font-normal p-3 text-left {% if not forloop.last %}border-b border-base-100 dark:border-base-800{% endif %}">
24
24
  {{ model.name }}
25
25
  </th>
26
26
  {% endif %}
27
27
 
28
- <td class="{% if not forloop.last %}border-b border-gray-100 dark:border-gray-800{% endif %} p-3 text-right">
28
+ <td class="{% if not forloop.last %}border-b border-base-100 dark:border-base-800{% endif %} p-3 text-right">
29
29
  <div class="flex flex-row items-center ml-auto gap-4 justify-end">
30
30
  {% if model.add_url %}
31
- <a href="{{ model.add_url }}" class="addlink block leading-none text-gray-400 transition-colors dark:text-gray-500 " title="{% translate 'Add' %}">
31
+ <a href="{{ model.add_url }}" class="addlink block leading-none text-base-400 transition-colors dark:text-base-500 " title="{% translate 'Add' %}">
32
32
  <span class="material-symbols-outlined">add</span>
33
33
  </a>
34
34
  {% endif %}
35
35
 
36
36
  {% if model.admin_url and show_changelinks %}
37
37
  {% if model.view_only %}
38
- <a href="{{ model.admin_url }}" class="viewlink block leading-none text-gray-400 transition-colors dark:text-gray-500" title="{% translate 'View' %} ">
38
+ <a href="{{ model.admin_url }}" class="viewlink block leading-none text-base-400 transition-colors dark:text-base-500" title="{% translate 'View' %} ">
39
39
  <span class="material-symbols-outlined">visibility</span>
40
40
  </a>
41
41
  {% else %}
42
- <a href="{{ model.admin_url }}" class="changelink block leading-none text-gray-400 transition-colors dark:text-gray-300" title="{% translate 'Change' %}">
42
+ <a href="{{ model.admin_url }}" class="changelink block leading-none text-base-400 transition-colors dark:text-base-300" title="{% translate 'Change' %}">
43
43
  <span class="material-symbols-outlined">edit_square</span>
44
44
  </a>
45
45
  {% endif %}
@@ -1,7 +1,7 @@
1
1
  {% load i18n %}
2
2
 
3
3
  <div class="flex items-center ">
4
- <div class="block mr-3 outline rounded-full ml-1 h-1 w-1 {% if value == '' or value == None %}bg-gray-500 outline-gray-500/20{% elif value %}bg-green-500 outline-green-200 dark:outline-green-500/20{% else %}bg-red-500 outline-red-200 dark:outline-red-500/20{% endif %}"></div>
4
+ <div class="block mr-3 outline rounded-full ml-1 h-1 w-1 {% if value == '' or value == None %}bg-base-500 outline-gray-500/20{% elif value %}bg-green-500 outline-green-200 dark:outline-green-500/20{% else %}bg-red-500 outline-red-200 dark:outline-red-500/20{% endif %}"></div>
5
5
 
6
6
  <span>
7
7
  {% if value == '' or value == None %}
@@ -1,7 +1,7 @@
1
1
 
2
2
  <li class="text-xs">
3
3
  {% if link %}
4
- <a href="{{ link }}">{{ name }}</a> <span class="mx-2 text-gray-200 dark:text-gray-600">/</span>
4
+ <a href="{{ link }}">{{ name }}</a> <span class="mx-2 text-base-200 dark:text-base-600">/</span>
5
5
  {% else %}
6
6
  {{ name }}
7
7
  {% endif %}
@@ -0,0 +1,13 @@
1
+ {% load admin_list %}
2
+
3
+ {% if actions_on_top %}
4
+ {% if cl.search_fields or action_form or cl.has_filters %}
5
+ <div class="bottom-0 left-0 right-0 hidden bg-primary-600 group-has-[input.action-select:checked]:flex fixed gap-3 lg:h-[71px] items-center p-3 z-50 lg:flex-row dark:bg-primary-500">
6
+ <div id="changelist-actions-wrapper" class="flex-grow lg:px-4" {% if not is_popup %}x-bind:class="{'xl:ml-0': !sidebarDesktopOpen, 'xl:ml-72': sidebarDesktopOpen}"{% endif %}>
7
+ {% if action_form %}
8
+ {% admin_actions %}
9
+ {% endif %}
10
+ </div>
11
+ </div>
12
+ {% endif %}
13
+ {% endif %}
@@ -0,0 +1,31 @@
1
+ {% load i18n admin_list unfold %}
2
+
3
+ <div id="changelist-filter" class="backdrop-blur-sm bg-opacity-80 bg-base-900 flex inset-0 z-50 fixed {% if not cl.model_admin.list_filter_sheet %}2xl:pb-24 2xl:bg-transparent 2xl:relative 2xl:!block 2xl:z-10{% endif %}" hx-preserve x-show="filterOpen">
4
+ <label for="show-filters" id="changelist-filter-close" class="flex-grow {% if not cl.model_admin.list_filter_sheet %}2xl:hidden{% endif %}" x-on:click="filterOpen = false"></label>
5
+
6
+ <div class="bg-white flex m-4 overflow-hidden rounded shadow-sm w-80 dark:bg-base-800 {% if not cl.model_admin.list_filter_sheet %} 2xl:overflow-visible 2xl:border-0 2xl:shadow-none 2xl:sticky 2xl:top-4 2xl:dark:border-base-800 2xl:bg-transparent 2xl:dark:!bg-transparent 2xl:m-0{% endif %}">
7
+ <div class="flex-grow h-full overflow-auto relative {% if not cl.model_admin.list_filter_sheet %} 2xl:overflow-visible{% endif %}">
8
+ <div class="px-3 py-2.5 {% if not cl.model_admin.list_filter_sheet %}2xl:px-0{% endif %}">
9
+ {% if cl.model_admin.list_filter_submit %}
10
+ <form id="filter-form" method="get">
11
+ {% preserve_filters %}
12
+ {% endif %}
13
+
14
+ <div class="flex flex-col gap-4 *:mb-0">
15
+ {% for spec in cl.filter_specs %}
16
+ {% admin_list_filter cl spec %}
17
+ {% endfor %}
18
+ </div>
19
+
20
+ {% if cl.model_admin.list_filter_submit %}
21
+ <button type="submit" class="bg-primary-600 block border border-transparent font-medium mt-6 px-3 py-2 rounded text-white w-full">
22
+ {% trans "Apply Filters" %}
23
+ </button>
24
+ </form>
25
+ {% endif %}
26
+
27
+ {% include "unfold/helpers/change_list_filter_actions.html" %}
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
@@ -0,0 +1,23 @@
1
+ {% load i18n %}
2
+
3
+ {% if cl.is_facets_optional or cl.has_active_filters %}
4
+ <span id="changelist-filter-extra-actions" class="flex flex-row gap-2 items-center mt-2">
5
+ {% if cl.is_facets_optional %}
6
+ {% if cl.add_facets %}
7
+ <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">
8
+ {% trans "Hide counts" %}
9
+ </a>
10
+ {% else %}
11
+ <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">
12
+ {% trans "Show counts" %}
13
+ </a>
14
+ {% endif %}
15
+ {% endif %}
16
+
17
+ {% if cl.has_active_filters %}
18
+ <a href="{{ cl.clear_all_filters_qs }}" class="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">
19
+ {% trans "Clear all filters" %}
20
+ </a>
21
+ {% endif %}
22
+ </span>
23
+ {% endif %}
@@ -1,11 +1,11 @@
1
1
  {% load i18n %}
2
2
 
3
3
  <div class="flex flex-col gap-3 items-center w-full lg:flex-row">
4
- <a href="#" class="border cancel-link flex items-center justify-center font-medium px-3 py-2 rounded-md w-full hover:bg-gray-50 lg:block lg:mb-0 lg:w-auto dark:border-gray-700 dark:text-font-default-dark dark:hover:text-gray-200 dark:hover:bg-gray-900">
4
+ <a href="#" class="border cancel-link flex items-center justify-center font-medium px-3 py-2 rounded w-full hover:bg-base-50 lg:block lg:mb-0 lg:w-auto dark:border-base-700 dark:text-font-default-dark dark:hover:text-base-200 dark:hover:bg-base-900">
5
5
  {% translate "No, take me back" %}
6
6
  </a>
7
7
 
8
- <button type="submit" class="bg-red-600 cursor-pointer flex items-center justify-center font-medium h-9.5 ml-0 px-3 py-2 rounded-md text-white w-full lg:ml-auto lg:w-auto dark:bg-red-500/20 dark:text-red-500">
8
+ <button type="submit" class="bg-red-600 cursor-pointer flex items-center justify-center font-medium h-9.5 ml-0 px-3 py-2 rounded text-white w-full lg:ml-auto lg:w-auto dark:bg-red-500/20 dark:text-red-500">
9
9
  {% translate "Yes, I’m sure" %}
10
10
  </button>
11
11
  </div>
@@ -6,12 +6,12 @@
6
6
  <span class="block bg-center bg-contain bg-no-repeat {% if not value.3.width %}w-16{% endif %} {% if not value.3.height %}h-12{% endif %}" style="background-image: url({{ value.3.path }}); {% if value.3.height %}height: {{ value.3.height }}px;{% endif %} {% if value.3.width %}width: {{ value.3.width }}px;{% endif %}">
7
7
  </span>
8
8
  {% else %}
9
- <span class="bg-center bg-cover bg-white flex font-medium justify-center overflow-hidden dark:bg-gray-900 dark:border-gray-700 {% if value.3.squared %}rounded-sm{% else %}rounded-full{% endif %}{% if not value.3.borderless %} border{% endif %}{% if not value.3.width or not value.3.height %} h-8 max-w-8 min-w-8{% endif %}">
9
+ <span class="bg-center bg-cover bg-white flex font-medium justify-center overflow-hidden dark:bg-base-900 dark:border-base-700 {% if value.3.squared %}rounded{% else %}rounded-full{% endif %}{% if not value.3.borderless %} border{% endif %}{% if not value.3.width or not value.3.height %} h-8 max-w-8 min-w-8{% endif %}">
10
10
  <img loading="lazy" src="{{ value.3.path }}" class="max-w-none object-cover" {% if value.3.width %}width="{{ value.3.width }}"{% endif %} {% if value.3.height %}height="{{ value.3.height }}"{% endif %} alt="{% trans "Record picture" %}" />
11
11
  </span>
12
12
  {% endif %}
13
13
  {% elif value.2 %}
14
- <span class="bg-white border flex font-medium h-8 justify-center items-center rounded-full text-xs uppercase w-8 dark:bg-gray-900 dark:border-gray-700">
14
+ <span class="bg-white border flex font-medium h-8 justify-center items-center rounded-full text-xs uppercase w-8 dark:bg-base-900 dark:border-base-700">
15
15
  {{ value.2 }}
16
16
  </span>
17
17
  {% endif %}
@@ -22,7 +22,7 @@
22
22
  {% endif %}
23
23
 
24
24
  {% if value.1 %}
25
- <p class="text-gray-500">
25
+ <p class="text-base-500">
26
26
  {{ value.1 }}
27
27
  </p>
28
28
  {% endif %}
@@ -0,0 +1,13 @@
1
+ {% load i18n unfold %}
2
+
3
+ {% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
4
+ <td class="border-t border-base-200 dark:border-base-800 lg:border-t-0 min-h-[62.5px] delete {% if inline_admin_form.original %}p-3 lg:py-3{% else %}py-3{% endif %} text-left text-red-600 flex items-center before:capitalize before:font-semibold before:content-[attr(data-label)] before:mr-auto before:text-font-important-light before:pr-4 lg:before:hidden font-normal px-3 text-sm lg:align-top lg:table-cell lg:w-px before:dark:text-font-important-dark" data-label="{% trans "Remove" %}">
5
+ {% if inline_admin_form.original %}
6
+ <div class="flex flex-row lg:mt-3">
7
+ <div class="ml-auto">
8
+ {{ inline_admin_form.deletion_field.field|add_css_class:form_classes.checkbox }}
9
+ </div>
10
+ </div>
11
+ {% endif %}
12
+ </td>
13
+ {% endif %}
@@ -0,0 +1,8 @@
1
+ {% load admin_modify %}
2
+ {% if inline_admin_form.form.non_field_errors %}
3
+ <tr class="row-form-errors group inline-tabular">
4
+ <td colspan="{{ inline_admin_form|cell_count }}">
5
+ {% include "unfold/helpers/messages/error.html" with errors=inline_admin_form.form.non_field_errors %}
6
+ </td>
7
+ </tr>
8
+ {% endif %}
@@ -0,0 +1,25 @@
1
+ <div class="flex flex-row gap-3 items-center">
2
+ {% if forloop.parentloop.counter == 1 and forloop.counter == 1 %}
3
+ {% if inline_admin_formset.opts.ordering_field %}
4
+ {% if inline_admin_form.original %}
5
+ <span class="material-symbols-outlined cursor-pointer" x-sort:handle>drag_indicator</span>
6
+ {% else %}
7
+ <span class="-mr-3" x-sort:handle></span>
8
+ {% endif %}
9
+ {% endif %}
10
+ {% endif %}
11
+
12
+ {% if field.is_readonly %}
13
+ {% include "unfold/helpers/field_readonly_value.html" with tabular=1 %}
14
+ {% else %}
15
+ {{ field.field }}
16
+
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 %}
24
+ {% endif %}
25
+ </div>
@@ -0,0 +1,25 @@
1
+ {% load i18n %}
2
+
3
+ <thead class="hidden lg:table-header-group">
4
+ <tr>
5
+ {% for field in inline_admin_formset.fields %}
6
+ {% if not field.widget.is_hidden %}
7
+ <th class="column-{{ field.name }}{% if field.required %} required{% endif %} align-middle border-b border-base-200 dark:border-base-800 font-semibold px-1.5 first:pl-3 last:pr-3 py-2 text-left text-font-important-light text-sm whitespace-nowrap dark:text-font-important-dark {% if inline_admin_formset.opts.ordering_field and field.name == inline_admin_formset.opts.ordering_field and inline_admin_formset.opts.hide_ordering_field %}hidden{% endif %}">
8
+ <span class="flex flex-row items-center">
9
+ {{ field.label|capfirst }}
10
+
11
+ {% if field.help_text %}
12
+ <span class="cursor-pointer material-symbols-outlined ml-2 text-base-400 dark:text-base-500" title="{{ field.help_text|striptags }}">help</span>
13
+ {% endif %}
14
+ </span>
15
+ </th>
16
+ {% endif %}
17
+ {% endfor %}
18
+
19
+ {% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
20
+ <th class="align-middle border-b border-base-200 dark:border-base-800 font-semibold px-3 py-2 text-left text-font-important-light text-sm whitespace-nowrap lg:w-px dark:text-font-important-dark">
21
+ {% translate "Delete?" %}
22
+ </th>
23
+ {% endif %}
24
+ </tr>
25
+ </thead>
@@ -0,0 +1,27 @@
1
+ <tr class="form-row {% if inline_admin_form.original or inline_admin_form.show_url %}has_original{% endif %}{% if forloop.last and inline_admin_formset.has_add_permission %} empty-form{% endif %}" id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
2
+ {% spaceless %}
3
+ {% for fieldset in inline_admin_form %}
4
+ {% for line in fieldset %}
5
+ {% for field in line %}
6
+ {% if not field.is_readonly and field.field.is_hidden %}
7
+ {{ field.field }}
8
+ {% endif %}
9
+ {% endfor %}
10
+ {% endfor %}
11
+ {% endfor %}
12
+ {% endspaceless %}
13
+
14
+ {% for fieldset in inline_admin_form %}
15
+ {% for line in fieldset %}
16
+ {% for field in line %}
17
+ {% if field.is_readonly or not field.field.is_hidden %}
18
+ <td{% if field.field.name %} class="min-h-[62.5px] field-{{ field.field.name }} group field-tabular {% if field.field.errors|length > 0 %} errors{% endif %}{% if inline_admin_form.original %} p-3 lg:py-3{% else %} py-3{% endif %}{% if field.is_checkbox %} align-middle{% else %} align-top{% endif %} flex items-center before:capitalize before:font-semibold before:content-[attr(data-label)] before:mr-auto before:font-text before:pr-4 lg:before:hidden font-normal px-3 lg:first:pl-3 lg:last:pr-3 lg:px-1.5 text-left lg:table-cell {% if field.field.is_hidden %} !hidden{% endif %} {% if inline_admin_formset.opts.ordering_field and field.field.name == inline_admin_formset.opts.ordering_field and inline_admin_formset.opts.hide_ordering_field %}!hidden{% endif %}"{% endif %} data-label="{{ field.field.label }}">
19
+ {% include "unfold/helpers/edit_inline/tabular_field.html" %}
20
+ </td>
21
+ {% endif %}
22
+ {% endfor %}
23
+ {% endfor %}
24
+ {% endfor %}
25
+
26
+ {% include "unfold/helpers/edit_inline/tabular_delete.html" %}
27
+ </tr>
@@ -0,0 +1,49 @@
1
+ {% load admin_modify admin_urls i18n %}
2
+
3
+ {% if inline_admin_form.original or inline_admin_form.show_url %}
4
+ <tr class="border-b border-base-200 dark:border-base-800 bg-base-50 dark:bg-white/[.02] lg:bg-transparent lg:border-0 dark:lg:!bg-transparent">
5
+ <td class="original" colspan="{{ inline_admin_form|cell_count }}">
6
+ {% if not inline_admin_formset.opts.hide_title %}
7
+ {% if inline_admin_form.original or inline_admin_form.show_url %}
8
+ <p class="flex font-medium items-center px-3 text-xs py-2 lg:pb-0 lg:pt-2">
9
+ {% if inline_admin_form.original %}
10
+ <span>
11
+ {% with inline_title=inline_admin_form.original.get_inline_title %}
12
+ {% if inline_title %}
13
+ {{ inline_title }}
14
+ {% else %}
15
+ {{ inline_admin_form.original }}
16
+ {% endif %}
17
+ {% endwith %}
18
+ </span>
19
+
20
+ {% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}
21
+ <a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="{{ inline_admin_formset.has_change_permission|yesno:'inlinechangelink,inlineviewlink' }} ml-2 text-primary-600 dark:text-primary-500">
22
+ {% if inline_admin_formset.has_change_permission %}
23
+ {% translate "Change" %}
24
+ {% else %}
25
+ {% translate "View" %}
26
+ {% endif %}
27
+ </a>
28
+ {% endif %}
29
+ {% endif %}
30
+
31
+ {% if inline_admin_form.show_url %}
32
+ <a href="{{ inline_admin_form.absolute_url }}" class="font-medium ml-2 text-primary-600 dark:text-primary-500">
33
+ {% translate "View on site" %}
34
+ </a>
35
+ {% endif %}
36
+ </p>
37
+ {% endif %}
38
+ {% endif %}
39
+
40
+ {% if inline_admin_form.needs_explicit_pk_field %}
41
+ {{ inline_admin_form.pk_field.field }}
42
+ {% endif %}
43
+
44
+ {% if inline_admin_form.fk_field %}
45
+ {{ inline_admin_form.fk_field.field }}
46
+ {% endif %}
47
+ </td>
48
+ </tr>
49
+ {% endif %}
@@ -1,5 +1,5 @@
1
1
  <div class="flex group mb-6 flex-col last:mb-4">
2
- <label class="block font-semibold mb-2 text-gray-900 text-sm dark:text-gray-200">
2
+ <label class="block font-semibold mb-2 text-base-900 text-sm dark:text-base-200">
3
3
  {{ title }}
4
4
  </label>
5
5
 
@@ -1 +1 @@
1
- <div class="readonly {% if field.is_json %}max-w-4xl{% else %}max-w-2xl{% endif %} py-2 text-sm *:rounded-md {% if not adminform.model_admin.compressed_fields and not field.is_image %}bg-gray-50 border font-medium px-3 rounded-md shadow-sm dark:border-gray-700 dark:bg-gray-800{% endif %} {% if field.is_image %}inline-block [&_img]:rounded-md !py-0{% endif %}">{% if value %}{{ value }}{% elif field.contents %}{{ field.contents }}{% else %}-{% endif %}</div>
1
+ <div class="readonly break-all {% if field.is_json %}max-w-4xl{% else %}max-w-2xl{% endif %} py-2 text-sm *:rounded {% if not adminform.model_admin.compressed_fields and not field.is_image %}bg-base-50 border font-medium px-3 rounded shadow-sm dark:border-base-700 dark:bg-base-800{% endif %} {% if field.is_image %}inline-block [&_img]:rounded !py-0{% endif %}">{% if value %}{{ value }}{% elif field.contents %}{{ field.contents }}{% else %}-{% endif %}</div>
@@ -1,80 +1,12 @@
1
+ {% load unfold %}
1
2
 
2
- <div class="form-row
3
- {% for field in line %}{% if inline_admin_formset.opts.ordering_field and field.field.name == inline_admin_formset.opts.ordering_field and inline_admin_formset.opts.hide_ordering_field %} hidden{% endif %}{% endfor %}
4
- {% if adminform.model_admin.compressed_fields %} border-b border-gray-200 -mx-3 px-3 pt-3 first:pt-0 dark:border-gray-800 last:border-b-0{% endif %}
5
- {% if not line.fields|length == 1 %} flex flex-row flex-wrap gap-x-8{% endif %}
6
- {% if not line.has_visible_field %} hidden{% endif %}
7
- {% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
3
+ <div class="{% fieldset_row_classes %} {% if forloop.last %}last{% endif %}">
8
4
  {% for field in line %}
9
- <div class="flex group {% if adminform.model_admin.compressed_fields %} field-row{% endif %}{% if not line.fields|length == 1 and not adminform.model_admin.compressed_fields %} lg:max-w-xs flex-grow{% endif %}{% if field.errors %} errors {% endif %}{% if not forloop.parentloop.last %} {% if adminform.model_admin.compressed_fields %}mb-3{% else %}mb-6{% endif %}{% else %} pb-3{% endif %} {% if adminform.model_admin.compressed_fields %}flex-col lg:flex-row lg:gap-2 {% else %}flex-col{% endif %}">
5
+ <div class="{% fieldset_line_classes %}">
10
6
  {% if field.is_checkbox %}
11
- {% if adminform.model_admin.compressed_fields %}
12
- <div class="flex flex-col gap-4 py-2 lg:flex-row">
13
- <div class="font-medium flex items-start -ml-2 min-w-32 w-32 lg:min-w-48 lg:w-48">
14
- {{ field.label_tag }}
15
- </div>
16
-
17
- <div class="flex-grow">
18
- <div class="flex flex-col lg:flex-row">
19
- {{ field.field }}
20
-
21
- {% if field.field.help_text %}
22
- <div class="lg:-mt-2 lg:ml-2">
23
- {% include "unfold/helpers/help_text.html" with help_text=field.field.help_text %}
24
- </div>
25
- {% endif %}
26
- </div>
27
-
28
- {% if field.errors %}
29
- <div class="mt-1 text-red-600 text-sm dark:text-red-500">
30
- {{ field.errors }}
31
- </div>
32
- {% endif %}
33
- </div>
34
- </div>
35
- {% else %}
36
- <div class="flex flex-row">
37
- {{ field.field }}
38
-
39
- <div class="flex flex-col">
40
- {{ field.label_tag }}
41
-
42
- {% if field.field.help_text %}
43
- <div class="ml-2 -mt-1">
44
- {% include "unfold/helpers/help_text.html" with help_text=field.field.help_text %}
45
- </div>
46
- {% endif %}
47
-
48
- {% if field.errors %}
49
- <div class="mt-1 text-red-600 text-sm dark:text-red-500">
50
- {{ field.errors }}
51
- </div>
52
- {% endif %}
53
- </div>
54
- </div>
55
- {% endif %}
7
+ {% include "unfold/helpers/fieldset_row_checkbox.html" %}
56
8
  {% else %}
57
- <div class="{% if adminform.model_admin.compressed_fields %}lg:min-w-48 lg:mt-2 lg:w-48{% endif %}">
58
- {{ field.label_tag }}
59
- </div>
60
-
61
- <div class="flex-grow">
62
- {% if field.is_readonly %}
63
- {% include "unfold/helpers/field_readonly_value.html" %}
64
- {% else %}
65
- {{ field.field }}
66
- {% endif %}
67
-
68
- {% if field.field.help_text and not field.is_checkbox %}
69
- {% include "unfold/helpers/help_text.html" with help_text=field.field.help_text %}
70
- {% endif %}
71
-
72
- {% if field.errors %}
73
- <div class="mt-1 text-red-600 text-sm dark:text-red-500">
74
- {{ field.errors }}
75
- </div>
76
- {% endif %}
77
- </div>
9
+ {% include "unfold/helpers/fieldset_row_field.html" %}
78
10
  {% endif %}
79
11
  </div>
80
12
  {% endfor %}
@@ -0,0 +1,45 @@
1
+ {% if adminform.model_admin.compressed_fields %}
2
+ <div class="flex flex-col gap-4 py-2 lg:flex-row">
3
+ <div class="font-medium flex items-start -ml-2 min-w-32 w-32 lg:min-w-48 lg:w-48">
4
+ {{ field.label_tag }}
5
+ </div>
6
+
7
+ <div class="flex-grow">
8
+ <div class="flex flex-col lg:flex-row">
9
+ {{ field.field }}
10
+
11
+ {% if field.field.help_text %}
12
+ <div class="lg:-mt-2 lg:ml-2">
13
+ {% include "unfold/helpers/help_text.html" with help_text=field.field.help_text %}
14
+ </div>
15
+ {% endif %}
16
+ </div>
17
+
18
+ {% if field.errors %}
19
+ <div class="mt-1 text-red-600 text-sm dark:text-red-500">
20
+ {{ field.errors }}
21
+ </div>
22
+ {% endif %}
23
+ </div>
24
+ </div>
25
+ {% else %}
26
+ <div class="flex flex-row">
27
+ {{ field.field }}
28
+
29
+ <div class="flex flex-col">
30
+ {{ field.label_tag }}
31
+
32
+ {% if field.field.help_text %}
33
+ <div class="ml-2 -mt-1">
34
+ {% include "unfold/helpers/help_text.html" with help_text=field.field.help_text %}
35
+ </div>
36
+ {% endif %}
37
+
38
+ {% if field.errors %}
39
+ <div class="mt-1 text-red-600 text-sm dark:text-red-500">
40
+ {{ field.errors }}
41
+ </div>
42
+ {% endif %}
43
+ </div>
44
+ </div>
45
+ {% endif %}
@@ -0,0 +1,21 @@
1
+ <div class="{% if adminform.model_admin.compressed_fields %}lg:min-w-48 lg:mt-2 lg:w-48{% endif %}">
2
+ {{ field.label_tag }}
3
+ </div>
4
+
5
+ <div class="flex-grow">
6
+ {% if field.is_readonly %}
7
+ {% include "unfold/helpers/field_readonly_value.html" %}
8
+ {% else %}
9
+ {{ field.field }}
10
+ {% endif %}
11
+
12
+ {% if field.field.help_text and not field.is_checkbox %}
13
+ {% include "unfold/helpers/help_text.html" with help_text=field.field.help_text %}
14
+ {% endif %}
15
+
16
+ {% if field.errors %}
17
+ <div class="mt-1 text-red-600 text-sm dark:text-red-500">
18
+ {{ field.errors }}
19
+ </div>
20
+ {% endif %}
21
+ </div>
@@ -3,10 +3,10 @@
3
3
  {% with tabs=adminform|tabs %}
4
4
  {% if tabs %}
5
5
  <div x-data="{openTab: null}" x-show="activeTab == 'general'">
6
- <ul class="bg-gray-100 border border-transparent flex gap-10 mb-6 px-4 py-3 rounded-md text-font-default-light text-sm lg:-mx-4 dark:bg-white/[.02] dark:border dark:border-gray-800 dark:text-font-default-dark">
6
+ <ul class="bg-base-100 flex gap-10 mb-6 px-4 py-3 rounded text-font-default-light lg:-mx-4 dark:bg-white/[.02] dark:text-font-default-dark">
7
7
  {% for fieldset in tabs %}
8
8
  <li>
9
- <a class="cursor-pointer font-semibold hover:text-gray-700 dark:hover:text-white"
9
+ <a class="cursor-pointer font-semibold hover:text-base-700 dark:hover:text-white"
10
10
  x-on:click="openTab = '{{ forloop.counter0 }}-{{ fieldset.name|slugify }}'"
11
11
  x-bind:class="openTab == '{{ forloop.counter0 }}-{{ fieldset.name|slugify }}'{% if forloop.first %} || openTab == null{% endif %} ? 'text-font-important-light dark:text-font-important-dark' : ''">
12
12
  {{ fieldset.name }}
@@ -1,6 +1,6 @@
1
1
  {% if not is_popup %}
2
2
  {% block header %}
3
- <div class="border-b border-gray-200 mb-6 px-4 lg:px-8 dark:border-gray-800">
3
+ <div class="border-b border-base-200 mb-6 px-4 lg:px-8 dark:border-base-800">
4
4
  <div class="{% if not cl.model_admin.list_fullwidth %}container{% endif %} flex items-center h-16 mx-auto py-4">
5
5
  <div id="header-inner" class="flex items-center w-full">
6
6
  <div class="flex items-center w-full">
@@ -4,14 +4,14 @@
4
4
 
5
5
  {% if admin_log %}
6
6
  <div id="content-related" class="lg:w-96">
7
- <div id="recent-actions-module" class="module bg-gray-50 rounded-md p-3 dark:bg-gray-800">
8
- <h2 class="mb-3 font-semibold text-gray-900 dark:text-gray-100">
7
+ <div id="recent-actions-module" class="module bg-base-50 rounded p-3 dark:bg-base-800">
8
+ <h2 class="mb-3 font-semibold text-base-900 dark:text-base-100">
9
9
  {% translate 'Recent actions' %}
10
10
  </h2>
11
11
 
12
12
  <ul class="actionlist">
13
13
  {% for entry in admin_log %}
14
- <li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %} border border-gray-400/10 bg-white mb-3 p-3 rounded-md shadow-sm last:mb-0 dark:bg-gray-900">
14
+ <li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %} border border-base-400/10 bg-white mb-3 p-3 rounded shadow-sm last:mb-0 dark:bg-base-900">
15
15
  <div class="mb-3 overflow-hidden text-ellipsis whitespace-nowrap">
16
16
  {% if entry.is_deletion or not entry.get_admin_url %}
17
17
  {{ entry.object_repr }}
@@ -20,7 +20,7 @@
20
20
  {% endif %}
21
21
  </div>
22
22
 
23
- <div class="border-gray-100 border-t flex pt-3 dark:border-gray-800">
23
+ <div class="border-base-100 border-t flex pt-3 dark:border-base-800">
24
24
  <div>
25
25
  {% if entry.content_type %}
26
26
  {% filter capfirst %}{{ entry.content_type.name }}{% endfilter %}
@@ -10,7 +10,7 @@
10
10
  {% elif type == 'primary' %}
11
11
  bg-primary-100 text-primary-700 dark:bg-primary-500/20 dark:text-primary-400
12
12
  {% else %}
13
- bg-gray-100 text-gray-700 dark:bg-gray-500/20 dark:text-gray-200
13
+ bg-base-100 text-base-700 dark:bg-base-500/20 dark:text-base-200
14
14
  {% endif %}">
15
15
  {{ text }}
16
16
  </span>
@@ -6,11 +6,11 @@
6
6
 
7
7
 
8
8
  <div class="relative" x-data="{ openLanguageLinks: false }">
9
- <a class="block cursor-pointer hover:text-gray-700 dark:hover:text-gray-200" x-on:click="openLanguageLinks = !openLanguageLinks">
9
+ <a class="block cursor-pointer h-4.5 hover:text-base-700 dark:hover:text-base-200" x-on:click="openLanguageLinks = !openLanguageLinks">
10
10
  <span class="material-symbols-outlined">translate</span>
11
11
  </a>
12
12
 
13
- <div class="absolute bg-white border flex flex-col leading-none py-1 -right-2 rounded shadow-lg top-7 w-52 z-50 dark:bg-gray-800 dark:border-gray-700" x-cloak x-show="openLanguageLinks" @click.outside="openLanguageLinks = false">
13
+ <div class="absolute bg-white border flex flex-col leading-none py-1 -right-2 rounded shadow-lg top-7 w-52 z-50 dark:bg-base-800 dark:border-base-700" x-cloak x-show="openLanguageLinks" @click.outside="openLanguageLinks = false">
14
14
  {% for language in languages %}
15
15
  <form action="{% url 'set_language' %}" method="post" class="flex w-full">
16
16
  {% csrf_token %}
@@ -18,7 +18,7 @@
18
18
  <input name="next" type="hidden" value="{{ redirect_to }}">
19
19
  <input name="language" type="hidden" value="{{ language.code }}">
20
20
 
21
- <button type="submit" class="block flex-grow mx-1 px-3 py-2 rounded text-left hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-700 dark:hover:text-gray-200 {% if language.code == LANGUAGE_CODE %}text-primary-600 dark:text-primary-500 dark:hover:!text-primary-500 hover:!text-primary-600{% endif %}">
21
+ <button type="submit" class="block flex-grow 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 language.code == LANGUAGE_CODE %}text-primary-600 dark:text-primary-500 dark:hover:!text-primary-500 hover:!text-primary-600{% endif %}">
22
22
  {{ language.name_local }} ({{ language.code }})
23
23
  </button>
24
24
  </form>
@@ -0,0 +1,3 @@
1
+ <p class="mb-3 px-3 py-3 rounded text-sm last:mb-8 bg-base-100 text-base-700 dark:bg-base-500/20 dark:text-base-400">
2
+ {{ message }}
3
+ </p>