django-unfold 0.24.0__py3-none-any.whl → 0.26.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. {django_unfold-0.24.0.dist-info → django_unfold-0.26.0.dist-info}/METADATA +51 -6
  2. {django_unfold-0.24.0.dist-info → django_unfold-0.26.0.dist-info}/RECORD +36 -26
  3. unfold/admin.py +11 -3
  4. unfold/contrib/import_export/forms.py +28 -5
  5. unfold/contrib/import_export/templates/admin/import_export/change_form.html +10 -0
  6. unfold/contrib/import_export/templates/admin/import_export/export.html +38 -3
  7. unfold/contrib/import_export/templates/admin/import_export/import_form.html +9 -20
  8. unfold/contrib/import_export/templates/admin/import_export/resource_fields_list.html +24 -0
  9. unfold/contrib/inlines/__init__.py +0 -0
  10. unfold/contrib/inlines/admin.py +141 -0
  11. unfold/contrib/inlines/apps.py +6 -0
  12. unfold/contrib/inlines/checks.py +18 -0
  13. unfold/contrib/inlines/forms.py +43 -0
  14. unfold/forms.py +6 -0
  15. unfold/static/unfold/css/simplebar.css +230 -0
  16. unfold/static/unfold/css/styles.css +1 -1
  17. unfold/static/unfold/js/simplebar.js +10 -0
  18. unfold/styles.css +10 -2
  19. unfold/templates/admin/app_list.html +1 -1
  20. unfold/templates/admin/change_form.html +11 -9
  21. unfold/templates/admin/change_list_results.html +67 -65
  22. unfold/templates/admin/edit_inline/stacked.html +7 -7
  23. unfold/templates/admin/edit_inline/tabular.html +111 -109
  24. unfold/templates/admin/includes/fieldset.html +1 -1
  25. unfold/templates/unfold/helpers/app_list.html +1 -1
  26. unfold/templates/unfold/helpers/display_header.html +11 -8
  27. unfold/templates/unfold/helpers/field.html +20 -6
  28. unfold/templates/unfold/helpers/fieldsets_tabs.html +4 -4
  29. unfold/templates/unfold/helpers/form_label.html +1 -1
  30. unfold/templates/unfold/layouts/skeleton.html +2 -0
  31. unfold/templates/unfold/widgets/foreign_key_raw_id.html +21 -0
  32. unfold/templates/unfold/widgets/textarea.html +1 -7
  33. unfold/templates/unfold/widgets/textarea_expandable.html +7 -0
  34. unfold/widgets.py +36 -3
  35. unfold/contrib/import_export/admin.py +0 -37
  36. {django_unfold-0.24.0.dist-info → django_unfold-0.26.0.dist-info}/LICENSE.md +0 -0
  37. {django_unfold-0.24.0.dist-info → django_unfold-0.26.0.dist-info}/WHEEL +0 -0
@@ -7,80 +7,82 @@
7
7
  {% endif %}
8
8
 
9
9
  {% if results %}
10
- <table id="result_list" class="block border-gray-200 border-spacing-none border-separate text-gray-700 w-full dark:text-gray-400 lg:border lg:rounded-md lg:shadow-sm lg:table lg:dark:border-gray-800">
11
- <thead>
12
- <tr>
13
- {% for header in result_headers %}
14
- <th class="align-middle font-medium py-2 text-left text-gray-400 text-sm {{ header.class_attrib }} {% if "action-toggle" in header.text and forloop.counter == 1 %}lg:px-3 lg:w-10{% else %}hidden px-3 lg:table-cell{% endif %}" scope="col">
15
- <div class="flex items-center">
16
- <div class="text">
17
- {% if header.sortable %}
18
- <a href="{{ header.url_primary }}">
19
- {{ header.text|capfirst }}
20
- </a>
21
- {% else %}
22
- {% if "action-toggle" in header.text and forloop.counter == 1 %}
23
- <label class="flex flex-row items-center gap-2">
10
+ <div class="overflow-x-auto lg:border lg:rounded-md lg:shadow-sm lg:dark:border-gray-800" data-simplebar data-simplebar-auto-hide="false">
11
+ <table id="result_list" class="block border-gray-200 border-spacing-none border-separate text-gray-700 w-full dark:text-gray-400 lg:table">
12
+ <thead>
13
+ <tr>
14
+ {% for header in result_headers %}
15
+ <th class="align-middle font-medium py-2 text-left text-gray-400 text-sm whitespace-nowrap {{ header.class_attrib }} {% if "action-toggle" in header.text and forloop.counter == 1 %}lg:px-3 lg:w-10{% else %}hidden px-3 lg:table-cell{% endif %}" scope="col">
16
+ <div class="flex items-center">
17
+ <div class="text">
18
+ {% if header.sortable %}
19
+ <a href="{{ header.url_primary }}">
24
20
  {{ header.text|capfirst }}
21
+ </a>
22
+ {% else %}
23
+ {% if "action-toggle" in header.text and forloop.counter == 1 %}
24
+ <label class="flex flex-row items-center gap-2">
25
+ {{ header.text|capfirst }}
25
26
 
26
- <span class="block font-normal text-gray-500 dark:text-gray-400 lg:hidden">
27
- {% trans "Select all rows"%}
27
+ <span class="block font-normal text-gray-500 dark:text-gray-400 lg:hidden">
28
+ {% trans "Select all rows"%}
29
+ </span>
30
+ </label>
31
+ {% else %}
32
+ <span>
33
+ {{ header.text|capfirst }}
28
34
  </span>
29
- </label>
30
- {% else %}
31
- <span>
32
- {{ header.text|capfirst }}
33
- </span>
35
+ {% endif %}
34
36
  {% endif %}
35
- {% endif %}
36
- </div>
37
+ </div>
37
38
 
38
- {% if header.sortable %}
39
- {% if header.sort_priority > 0 %}
40
- <div class="sortoptions flex items-center ml-2">
41
- <a href="{{ header.url_toggle }}" class="flex items-center leading-none text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 toggle {% if header.ascending %}ascending{% else %}descending{% endif %}" title="{% translate "Toggle sorting" %}">
42
- {% if header.ascending %}
43
- <span class="block material-symbols-outlined">arrow_circle_down</span>
44
- {% else %}
45
- <span class="block material-symbols-outlined">arrow_circle_up</span>
46
- {% endif %}
47
- </a>
39
+ {% if header.sortable %}
40
+ {% if header.sort_priority > 0 %}
41
+ <div class="sortoptions flex items-center ml-2">
42
+ <a href="{{ header.url_toggle }}" class="flex items-center leading-none text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 toggle {% if header.ascending %}ascending{% else %}descending{% endif %}" title="{% translate "Toggle sorting" %}">
43
+ {% if header.ascending %}
44
+ <span class="block material-symbols-outlined">arrow_circle_down</span>
45
+ {% else %}
46
+ <span class="block material-symbols-outlined">arrow_circle_up</span>
47
+ {% endif %}
48
+ </a>
48
49
 
49
- <a class="sortremove flex items-center leading-none ml-1 text-gray-400 transition-all hover:text-red-700 dark:hover:text-red-500" href="{{ header.url_remove }}" title="{% translate "Remove from sorting" %}">
50
- <span class="block material-symbols-outlined">cancel</span>
51
- </a>
52
- </div>
50
+ <a class="sortremove flex items-center leading-none ml-1 text-gray-400 transition-all hover:text-red-700 dark:hover:text-red-500" href="{{ header.url_remove }}" title="{% translate "Remove from sorting" %}">
51
+ <span class="block material-symbols-outlined">cancel</span>
52
+ </a>
53
+ </div>
53
54
 
54
- {% if num_sorted_fields > 1 %}
55
- <span class="sortpriority font-medium ml-2 text-xs" title="{% blocktranslate with priority_number=header.sort_priority %}Sorting priority: {{ priority_number }}{% endblocktranslate %}">
56
- {{ header.sort_priority }}
57
- </span>
55
+ {% if num_sorted_fields > 1 %}
56
+ <span class="sortpriority font-medium ml-2 text-xs" title="{% blocktranslate with priority_number=header.sort_priority %}Sorting priority: {{ priority_number }}{% endblocktranslate %}">
57
+ {{ header.sort_priority }}
58
+ </span>
59
+ {% endif %}
58
60
  {% endif %}
59
61
  {% endif %}
60
- {% endif %}
61
- </div>
62
- </th>
63
- {% endfor %}
64
- </tr>
65
- </thead>
66
-
67
- <tbody class="block lg:table-row-group">
68
- {% for result in results %}
69
- {% if result.form and result.form.non_field_errors %}
70
- <tr>
71
- <td class="text-left" colspan="{{ result|length }}">
72
- {{ result.form.non_field_errors }}
73
- </td>
74
- </tr>
75
- {% endif %}
76
-
77
- <tr class="{% cycle '' 'bg-gray-50 dark:bg-white/[.02]' %} block border mb-3 rounded-md shadow-sm lg:table-row lg:border-none lg:mb-0 lg:shadow-none dark:border-gray-800">
78
- {% for item in result %}
79
- {{ item }}
62
+ </div>
63
+ </th>
80
64
  {% endfor %}
81
- {% include 'unfold/helpers/actions_row.html' with actions=actions_row instance_pk=result.instance_pk %}
82
65
  </tr>
83
- {% endfor %}
84
- </tbody>
85
- </table>
66
+ </thead>
67
+
68
+ <tbody class="block lg:table-row-group">
69
+ {% for result in results %}
70
+ {% if result.form and result.form.non_field_errors %}
71
+ <tr>
72
+ <td class="text-left" colspan="{{ result|length }}">
73
+ {{ result.form.non_field_errors }}
74
+ </td>
75
+ </tr>
76
+ {% endif %}
77
+
78
+ <tr class="{% cycle '' 'bg-gray-50 dark:bg-white/[.02]' %} block border mb-3 rounded-md shadow-sm lg:table-row lg:border-none lg:mb-0 lg:shadow-none dark:border-gray-800">
79
+ {% for item in result %}
80
+ {{ item }}
81
+ {% endfor %}
82
+ {% include 'unfold/helpers/actions_row.html' with actions=actions_row instance_pk=result.instance_pk %}
83
+ </tr>
84
+ {% endfor %}
85
+ </tbody>
86
+ </table>
87
+ </div>
86
88
  {% endif %}
@@ -11,19 +11,19 @@
11
11
  </h2>
12
12
 
13
13
  {{ inline_admin_formset.formset.management_form }}
14
- {{ inline_admin_formset.formset.non_form_errors }}
14
+ {% include "unfold/helpers/messages/error.html" with errors=inline_admin_formset.formset.non_form_errors %}
15
15
 
16
16
  <div class="border border-gray-200 mb-6 overflow-hidden rounded-md shadow-sm text-gray-700 w-full dark:border-gray-800">
17
17
  {% for inline_admin_form in inline_admin_formset %}
18
18
  <div class="inline-related group inline-stacked {% 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 last-related{% endif %}" id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
19
- <h3 class="border-b {% if not forloop.first %}border-t{% endif %} border-gray-200 flex font-medium items-center mb-3 px-3 py-2 text-gray-400 text-sm dark:border-gray-800">
19
+ <h3 class="bg-gray-50 border-b {% if not forloop.first %}border-t{% endif %} border-gray-200 flex font-medium items-center mb-3 px-3 py-2 text-gray-400 text-sm dark:bg-white/[.02] dark:border-gray-800">
20
20
  <span class="mr-2">
21
21
  {{ inline_admin_formset.opts.verbose_name|capfirst }}:
22
22
  </span>
23
23
 
24
- <span class="inline_label font-semibold text-gray-900">
24
+ <span class="inline_label font-semibold text-gray-900 dark:text-gray-200">
25
25
  {% if inline_admin_form.original and inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}
26
- <a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="{% if inline_admin_formset.has_change_permission %}inlinechangelink{% else %}inlineviewlink{% endif %} ml-1">
26
+ <a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="{% if inline_admin_formset.has_change_permission %}inlinechangelink{% else %}inlineviewlink{% endif %} font-medium text-primary-600 underline">
27
27
  {{ inline_admin_form.original }}
28
28
  </a>
29
29
  {% else %}
@@ -37,12 +37,12 @@
37
37
 
38
38
  {% if inline_admin_form.show_url %}
39
39
  <a href="{{ inline_admin_form.absolute_url }}" class="h-4 leading-none ml-1">
40
- <span class="material-symbols-outlined h-4 md-16 text-gray-400">launch</span>
40
+ <span class="material-symbols-outlined h-4 md-16 text-primary-600">launch</span>
41
41
  </a>
42
42
  {% endif %}
43
43
 
44
44
  {% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission and inline_admin_form.original %}
45
- <span class="delete flex items-center ml-auto text-gray-500">
45
+ <span class="delete flex gap-2 items-center ml-auto text-gray-500">
46
46
  {{ inline_admin_form.deletion_field.field|add_css_class:form_classes.checkbox }} {{ inline_admin_form.deletion_field.label_tag }}
47
47
  </span>
48
48
  {% endif %}
@@ -52,7 +52,7 @@
52
52
 
53
53
  {% for fieldset in inline_admin_form %}
54
54
  <div class="px-3 -mb-5">
55
- {% include 'admin/includes/fieldset.html' %}
55
+ {% include 'admin/includes/fieldset.html' with stacked=1 %}
56
56
  </div>
57
57
  {% endfor %}
58
58
 
@@ -4,7 +4,7 @@
4
4
  <div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
5
5
  {{ inline_admin_formset.formset.management_form }}
6
6
 
7
- <fieldset class="module {{ inline_admin_formset.classes }}">
7
+ <fieldset class="module {{ inline_admin_formset.classes }} min-w-0">
8
8
  <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 rounded-md text-gray-900 text-sm lg:-mx-4 dark:bg-white/[.02] dark:border dark:border-gray-800 dark:text-gray-200">
9
9
  {% if inline_admin_formset.formset.max_num == 1 %}
10
10
  {{ inline_admin_formset.opts.verbose_name|capfirst }}
@@ -21,133 +21,135 @@
21
21
  {% trans "No records found." %}
22
22
  </p>
23
23
  {% else %}
24
- <table class="border border-gray-200 border-spacing-none border-separate mb-6 rounded-md shadow-sm text-gray-700 w-full dark:border-gray-800">
25
- <thead class="hidden lg:table-header-group">
26
- <tr>
27
- {% for field in inline_admin_formset.fields %}
28
- {% if not field.widget.is_hidden %}
29
- <th class="column-{{ field.name }}{% if field.required %} required{% endif %} align-middle border-b border-gray-200 font-medium px-3 py-2 text-left text-gray-400 text-sm dark:border-gray-800">
30
- <span class="flex flex-row items-center">
31
- {{ field.label|capfirst }}
24
+ <div class="border border-gray-200 mb-6 overflow-x-auto rounded-md shadow-sm dark:border-gray-800" data-simplebar data-simplebar-auto-hide="false">
25
+ <table class="border-spacing-none border-separate text-gray-700 w-full">
26
+ <thead class="hidden lg:table-header-group">
27
+ <tr>
28
+ {% for field in inline_admin_formset.fields %}
29
+ {% if not field.widget.is_hidden %}
30
+ <th class="column-{{ field.name }}{% if field.required %} required{% endif %} align-middle border-b border-gray-200 font-medium px-3 py-2 text-left text-gray-400 text-sm whitespace-nowrap dark:border-gray-800">
31
+ <span class="flex flex-row items-center">
32
+ {{ field.label|capfirst }}
32
33
 
33
- {% if field.help_text %}
34
- <span class="cursor-pointer material-symbols-outlined ml-2" title="{{ field.help_text|striptags }}">help</span>
35
- {% endif %}
36
- </span>
34
+ {% if field.help_text %}
35
+ <span class="cursor-pointer material-symbols-outlined ml-2" title="{{ field.help_text|striptags }}">help</span>
36
+ {% endif %}
37
+ </span>
38
+ </th>
39
+ {% endif %}
40
+ {% endfor %}
41
+
42
+ {% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
43
+ <th class="align-middle border-b border-gray-200 font-medium px-3 py-2 text-left text-gray-400 text-sm whitespace-nowrap lg:w-px dark:border-gray-800">
44
+ {% translate "Delete?" %}
37
45
  </th>
38
46
  {% endif %}
39
- {% endfor %}
47
+ </tr>
48
+ </thead>
40
49
 
41
- {% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
42
- <th class="align-middle border-b border-gray-200 font-medium px-3 py-2 text-left text-gray-400 text-sm lg:w-px dark:border-gray-800">
43
- {% translate "Delete?" %}
44
- </th>
45
- {% endif %}
46
- </tr>
47
- </thead>
50
+ <tbody>
51
+ {% for inline_admin_form in inline_admin_formset %}
52
+ {% if inline_admin_form.form.non_field_errors %}
53
+ <tr class="row-form-errors group inline-tabular">
54
+ <td colspan="{{ inline_admin_form|cell_count }}">
55
+ {% include "unfold/helpers/messages/error.html" with errors=inline_admin_form.form.non_field_errors %}
56
+ </td>
57
+ </tr>
58
+ {% endif %}
48
59
 
49
- <tbody>
50
- {% for inline_admin_form in inline_admin_formset %}
51
- {% if inline_admin_form.form.non_field_errors %}
52
- <tr class="row-form-errors group inline-tabular">
53
- <td colspan="{{ inline_admin_form|cell_count }}">
54
- {% include "unfold/helpers/messages/error.html" with errors=inline_admin_form.form.non_field_errors %}
55
- </td>
56
- </tr>
57
- {% endif %}
60
+ {% if inline_admin_form.original or inline_admin_form.show_url %}
61
+ <tr>
62
+ <td class="original" colspan="10">
63
+ {% if inline_admin_form.original or inline_admin_form.show_url %}
64
+ <p class="align-middle flex font-normal items-center leading-none px-3 text-gray-500 text-left text-sm whitespace-nowrap">
65
+ {% if inline_admin_form.original %}
66
+ {% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}
67
+ <a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="{% if inline_admin_formset.has_change_permission %}inlinechangelink{% else %}inlineviewlink{% endif %} font-medium mt-3 text-primary-600 underline text-xs">
68
+ {{ inline_admin_form.original }}
69
+ </a>
70
+ {% endif %}
71
+ {% else %}
72
+ {{ inline_admin_form.original }}
73
+ {% endif %}
58
74
 
59
- {% if inline_admin_form.original or inline_admin_form.show_url %}
60
- <tr>
61
- <td class="original" colspan="10">
62
- {% if inline_admin_form.original or inline_admin_form.show_url %}
63
- <p class="align-middle flex font-normal items-center leading-none px-3 text-gray-500 text-left text-sm whitespace-nowrap">
64
- {% if inline_admin_form.original %}
65
- {% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}
66
- <a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="{% if inline_admin_formset.has_change_permission %}inlinechangelink{% else %}inlineviewlink{% endif %} mt-3 text-gray-500 text-xs">
67
- {{ inline_admin_form.original }}
75
+ {% if inline_admin_form.show_url %}
76
+ <a href="{{ inline_admin_form.absolute_url }}" class="ml-1 mt-3">
77
+ <span class="material-symbols-outlined h-4 md-16 text-primary-600">launch</span>
68
78
  </a>
69
79
  {% endif %}
70
- {% else %}
71
- {{ inline_admin_form.original }}
72
- {% endif %}
73
-
74
- {% if inline_admin_form.show_url %}
75
- <a href="{{ inline_admin_form.absolute_url }}" class="ml-1 mt-3">
76
- <span class="material-symbols-outlined h-4 md-16 text-gray-400">launch</span>
77
- </a>
78
- {% endif %}
79
- </p>
80
- {% endif %}
80
+ </p>
81
+ {% endif %}
81
82
 
82
- {% if inline_admin_form.needs_explicit_pk_field %}
83
- {{ inline_admin_form.pk_field.field }}
84
- {% endif %}
83
+ {% if inline_admin_form.needs_explicit_pk_field %}
84
+ {{ inline_admin_form.pk_field.field }}
85
+ {% endif %}
85
86
 
86
- {% if inline_admin_form.fk_field %}
87
- {{ inline_admin_form.fk_field.field }}
88
- {% endif %}
89
- </td>
90
- </tr>
91
- {% endif %}
87
+ {% if inline_admin_form.fk_field %}
88
+ {{ inline_admin_form.fk_field.field }}
89
+ {% endif %}
90
+ </td>
91
+ </tr>
92
+ {% endif %}
92
93
 
93
- <tr class="lg:border-b-0 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 %}">
94
- {% spaceless %}
95
- {% for fieldset in inline_admin_form %}
96
- {% for line in fieldset %}
97
- {% for field in line %}
98
- {% if not field.is_readonly and field.field.is_hidden %}
99
- {{ field.field }}
100
- {% endif %}
94
+ <tr class="lg:border-b-0 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 %}">
95
+ {% spaceless %}
96
+ {% for fieldset in inline_admin_form %}
97
+ {% for line in fieldset %}
98
+ {% for field in line %}
99
+ {% if not field.is_readonly and field.field.is_hidden %}
100
+ {{ field.field }}
101
+ {% endif %}
102
+ {% endfor %}
101
103
  {% endfor %}
102
104
  {% endfor %}
103
- {% endfor %}
104
- {% endspaceless %}
105
+ {% endspaceless %}
105
106
 
106
- {% with is_last_row=forloop.last %}
107
- {% for fieldset in inline_admin_form %}
108
- {% for line in fieldset %}
109
- {% with is_last_col=forloop.last %}
110
- {% for field in line %}
111
- {% if field.is_readonly or not field.field.is_hidden %}
112
- <td{% if field.field.name %} class="field-{{ field.field.name }}{% 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 %} {% if is_last_row and not inline_admin_formset.has_add_permission %}{% if is_last_col %}border-0 {% else %}border-b lg:border-0{% endif %}{% else %}border-b{% endif %} border-gray-200 flex items-center before:capitalize before:content-[attr(data-label)] before:mr-auto before:text-gray-500 before:w-72 lg:before:hidden font-normal px-3 text-left text-sm lg:table-cell dark:border-gray-800 {% if field.field.is_hidden %} !hidden{% endif %}"{% endif %} data-label="{{ field.field.label }}">
113
- {% if field.is_readonly %}
114
- <div class="bg-gray-50 border font-medium max-w-lg px-3 py-2 rounded-md shadow-sm text-gray-500 text-sm truncate whitespace-nowrap dark:border-gray-700 dark:text-gray-400 dark:bg-gray-800">
115
- {{ field.contents }}
116
- </div>
117
- {% else %}
118
- {{ field.field }}
119
-
120
- {% if field.field.errors|length > 0 %}
121
- <div class="mt-1 text-red-600 text-sm dark:text-red-500">
122
- {% for error in field.field.errors %}
123
- {{ error }}
124
- {% endfor %}
107
+ {% with is_last_row=forloop.last %}
108
+ {% for fieldset in inline_admin_form %}
109
+ {% for line in fieldset %}
110
+ {% with is_last_col=forloop.last %}
111
+ {% for field in line %}
112
+ {% if field.is_readonly or not field.field.is_hidden %}
113
+ <td{% if field.field.name %} class="field-{{ field.field.name }}{% 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 %} {% if is_last_row and not inline_admin_formset.has_add_permission %}{% if is_last_col %}border-0 {% else %}border-b lg:border-0{% endif %}{% else %}border-b{% endif %} border-gray-200 flex items-center before:capitalize before:content-[attr(data-label)] before:mr-auto before:text-gray-500 before:w-72 lg:before:hidden font-normal px-3 text-left text-sm lg:table-cell dark:border-gray-800 {% if field.field.is_hidden %} !hidden{% endif %}"{% endif %} data-label="{{ field.field.label }}">
114
+ {% if field.is_readonly %}
115
+ <div class="bg-gray-50 border font-medium max-w-lg px-3 py-2 rounded-md shadow-sm text-gray-500 text-sm truncate whitespace-nowrap dark:border-gray-700 dark:text-gray-400 dark:bg-gray-800">
116
+ {{ field.contents }}
125
117
  </div>
118
+ {% else %}
119
+ {{ field.field }}
120
+
121
+ {% if field.field.errors|length > 0 %}
122
+ <div class="mt-1 text-red-600 text-sm dark:text-red-500">
123
+ {% for error in field.field.errors %}
124
+ {{ error }}
125
+ {% endfor %}
126
+ </div>
127
+ {% endif %}
126
128
  {% endif %}
127
- {% endif %}
128
- </td>
129
- {% endif %}
130
- {% endfor %}
131
- {% endwith %}
129
+ </td>
130
+ {% endif %}
131
+ {% endfor %}
132
+ {% endwith %}
133
+ {% endfor %}
132
134
  {% endfor %}
133
- {% endfor %}
134
135
 
135
- {% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
136
- <td class="delete {% if inline_admin_form.original %}p-3 lg:py-3{% else %}py-3{% endif %} text-left font-normal px-3 text-sm text-red-600 border-b border-gray-200 flex items-center before:capitalize before:content-[attr(data-label)] before:mr-auto before:text-gray-500 before:w-72 lg:before:hidden font-normal px-3 text-sm lg:align-top lg:table-cell lg:underline lg:w-px dark:border-gray-800" data-label="{% trans "Remove" %}">
137
- {% if inline_admin_form.original %}
138
- <div class="flex flex-row lg:mt-3">
139
- <div class="ml-auto">
140
- {{ inline_admin_form.deletion_field.field|add_css_class:form_classes.checkbox }}
136
+ {% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
137
+ <td class="delete {% if inline_admin_form.original %}p-3 lg:py-3{% else %}py-3{% endif %} text-left font-normal px-3 text-sm text-red-600 border-b border-gray-200 flex items-center before:capitalize before:content-[attr(data-label)] before:mr-auto before:text-gray-500 before:w-72 lg:before:hidden font-normal px-3 text-sm lg:align-top lg:table-cell lg:underline lg:w-px dark:border-gray-800" data-label="{% trans "Remove" %}">
138
+ {% if inline_admin_form.original %}
139
+ <div class="flex flex-row lg:mt-3">
140
+ <div class="ml-auto">
141
+ {{ inline_admin_form.deletion_field.field|add_css_class:form_classes.checkbox }}
142
+ </div>
141
143
  </div>
142
- </div>
143
- {% endif %}
144
- </td>
145
- {% endif %}
146
- {% endwith %}
147
- </tr>
148
- {% endfor %}
149
- </tbody>
150
- </table>
144
+ {% endif %}
145
+ </td>
146
+ {% endif %}
147
+ {% endwith %}
148
+ </tr>
149
+ {% endfor %}
150
+ </tbody>
151
+ </table>
152
+ </div>
151
153
  {% endif %}
152
154
  </div>
153
155
  </fieldset>
@@ -13,7 +13,7 @@
13
13
  </div>
14
14
  {% endif %}
15
15
 
16
- <div class="aligned border border-gray-200 mb-8 rounded-md pt-3 px-3 shadow-sm dark:border-gray-800">
16
+ <div class="aligned mb-8 {% if not stacked %}border border-gray-200 rounded-md pt-3 px-3 shadow-sm dark:border-gray-800{% endif %}">
17
17
  {% for line in fieldset %}
18
18
  <div class="form-row block {% if not line.fields|length_is:'1' %}flex flex-row flex-wrap gap-x-8{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
19
19
  {% for field in line %}
@@ -1,7 +1,7 @@
1
1
  {% load i18n %}
2
2
 
3
3
  {% if sidebar_navigation %}
4
- <div class="overflow-auto">
4
+ <div class="h-0 flex-grow overflow-auto" data-simplebar>
5
5
  {% for group in sidebar_navigation %}
6
6
  {% if group.items %}
7
7
  {% if group.separator %}
@@ -1,20 +1,23 @@
1
- <div class="flex gap-4 items-center">
1
+ <span class="flex gap-4 items-center">
2
2
  {% if value.3 and value.3.path %}
3
- <div class="bg-center bg-cover bg-white border flex font-medium h-8 w-8 dark:bg-gray-900 dark:border-gray-700 {% if value.3.squared %}rounded-sm{% else %}rounded-full{% endif %}" style="background-image: url('{{ value.3.path }}')">
4
- </div>
3
+ <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 %}">
4
+ <img loading="lazy" src="{{ value.3.path }}" class="object-cover" {% if value.3.width %}width="{{ value.3.width }}"{% endif %} {% if value.3.height %}height="{{ value.3.height }}"{% endif %}/>
5
+ </span>
5
6
  {% elif value.2 %}
6
- <div 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">
7
+ <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">
7
8
  {{ value.2 }}
8
- </div>
9
+ </span>
9
10
  {% endif %}
10
11
 
11
- <div class="flex flex-col text-right lg:text-left">
12
- <h3>{{ value.0 }}</h3>
12
+ <span class="flex flex-col text-right lg:text-left">
13
+ {% if value.0 %}
14
+ <h3>{{ value.0 }}</h3>
15
+ {% endif %}
13
16
 
14
17
  {% if value.1 %}
15
18
  <p class="text-gray-500">
16
19
  {{ value.1 }}
17
20
  </p>
18
21
  {% endif %}
19
- </div>
22
+ </span>
20
23
  </div>
@@ -1,9 +1,23 @@
1
- <div class="{% if field.errors %}errors {% endif %}flex group mb-6 flex-col last:mb-4">
2
- {% include "unfold/helpers/form_label.html" with field=field %}
1
+ {% if field.field.widget.input_type == "checkbox" %}
2
+ <div class="{% if field.errors %}errors {% endif %}flex flex-col group mb-6 last:mb-4">
3
+ <div class="flex flex-row gap-2 items-center">
4
+ {{ field }}
3
5
 
4
- {{ field }}
6
+ {% include "unfold/helpers/form_label.html" with field=field %}
7
+ </div>
5
8
 
6
- {% include "unfold/helpers/form_errors.html" with errors=field.errors %}
9
+ {% include "unfold/helpers/form_errors.html" with errors=field.errors %}
7
10
 
8
- {% include "unfold/helpers/help_text.html" with help_text=field.help_text %}
9
- </div>
11
+ {% include "unfold/helpers/help_text.html" with help_text=field.help_text %}
12
+ </div>
13
+ {% else %}
14
+ <div class="{% if field.errors %}errors {% endif %}flex flex-col group mb-6 last:mb-4">
15
+ {% include "unfold/helpers/form_label.html" with field=field %}
16
+
17
+ {{ field }}
18
+
19
+ {% include "unfold/helpers/form_errors.html" with errors=field.errors %}
20
+
21
+ {% include "unfold/helpers/help_text.html" with help_text=field.help_text %}
22
+ </div>
23
+ {% endif %}
@@ -7,8 +7,8 @@
7
7
  {% for fieldset in tabs %}
8
8
  <li>
9
9
  <a class="cursor-pointer font-semibold hover:text-gray-700 dark:hover:text-white"
10
- x-on:click="openTab = '{{ fieldset.name|slugify }}'"
11
- x-bind:class="openTab == '{{ fieldset.name|slugify }}'{% if forloop.first %} || openTab == null{% endif %} ? 'text-gray-700 dark:text-white' : ''">
10
+ x-on:click="openTab = '{{ forloop.counter0 }}-{{ fieldset.name|slugify }}'"
11
+ x-bind:class="openTab == '{{ forloop.counter0 }}-{{ fieldset.name|slugify }}'{% if forloop.first %} || openTab == null{% endif %} ? 'text-gray-700 dark:text-white' : ''">
12
12
  {{ fieldset.name }}
13
13
  </a>
14
14
  </li>
@@ -16,8 +16,8 @@
16
16
  </ul>
17
17
 
18
18
  {% for fieldset in tabs %}
19
- <div class="tab-wrapper{% if fieldset.name %} fieldset-{{ fieldset.name|slugify }}{% endif %}"
20
- x-show="openTab == '{{ fieldset.name|slugify }}'{% if forloop.first %} || openTab == null{% endif %}">
19
+ <div class="tab-wrapper{% if fieldset.name %} fieldset-{{ fieldset.name|slugify }} fieldset-{{ forloop.counter0 }}-{{ fieldset.name|slugify }}{% endif %}"
20
+ x-show="openTab == '{{ forloop.counter0 }}-{{ fieldset.name|slugify }}'{% if forloop.first %} || openTab == null{% endif %}">
21
21
  {% include 'admin/includes/fieldset.html' %}
22
22
  </div>
23
23
  {% endfor %}
@@ -1,4 +1,4 @@
1
- <label for="{{ field.id_for_label }}" class="block font-medium mb-2 text-gray-900 text-sm dark:text-gray-200">
1
+ <label for="{{ field.id_for_label }}" class="block text-gray-900 text-sm dark:text-gray-200{% if field.field.widget.input_type == "checkbox" %}{% else %} font-medium mb-2{% endif %}">
2
2
  {{ field.label }}
3
3
 
4
4
  {% if field.field.required %}
@@ -25,6 +25,7 @@
25
25
  {% endfor %}
26
26
 
27
27
  <link href="{% static 'unfold/css/styles.css' %}" rel="stylesheet">
28
+ <link href="{% static 'unfold/css/simplebar.css' %}" rel="stylesheet">
28
29
 
29
30
  <script src="{% static 'unfold/js/alpine.persist.js' %}" defer></script>
30
31
  <script src="{% static 'unfold/js/alpine.js' %}" defer></script>
@@ -66,6 +67,7 @@
66
67
  {% block base %}{% endblock %}
67
68
 
68
69
  <div id="modal-overlay" class="backdrop-blur-sm bg-opacity-80 bg-gray-900 bottom-0 fixed hidden left-0 mr-1 right-0 top-0 z-50"></div>
70
+ <script src="{% static 'unfold/js/simplebar.js' %}"></script>
69
71
  </body>
70
72
 
71
73
  </html>