django-unfold 0.23.0__py3-none-any.whl → 0.25.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- {django_unfold-0.23.0.dist-info → django_unfold-0.25.0.dist-info}/METADATA +97 -4
- {django_unfold-0.23.0.dist-info → django_unfold-0.25.0.dist-info}/RECORD +26 -24
- unfold/admin.py +3 -3
- unfold/contrib/filters/admin.py +116 -0
- unfold/contrib/filters/forms.py +29 -1
- unfold/contrib/filters/templates/unfold/filters/filters_date_range.html +1 -1
- unfold/contrib/filters/templates/unfold/filters/filters_datetime_range.html +1 -1
- unfold/contrib/filters/templates/unfold/filters/filters_field.html +7 -0
- unfold/contrib/filters/templates/unfold/filters/filters_numeric_range.html +1 -1
- unfold/contrib/filters/templates/unfold/filters/filters_numeric_single.html +1 -1
- unfold/contrib/filters/templates/unfold/filters/filters_numeric_slider.html +1 -1
- unfold/contrib/import_export/admin.py +1 -1
- unfold/contrib/import_export/forms.py +8 -3
- unfold/contrib/import_export/templates/admin/import_export/export.html +1 -1
- unfold/contrib/import_export/templates/admin/import_export/import_form.html +9 -16
- unfold/contrib/import_export/templates/admin/import_export/resource_fields_list.html +24 -0
- unfold/static/unfold/css/styles.css +1 -1
- unfold/styles.css +1 -1
- unfold/templates/admin/change_list_results.html +67 -65
- unfold/templates/admin/edit_inline/stacked.html +2 -2
- unfold/templates/admin/edit_inline/tabular.html +111 -109
- unfold/templates/admin/filter.html +2 -2
- unfold/templates/unfold/helpers/display_header.html +16 -13
- unfold/widgets.py +2 -2
- {django_unfold-0.23.0.dist-info → django_unfold-0.25.0.dist-info}/LICENSE.md +0 -0
- {django_unfold-0.23.0.dist-info → django_unfold-0.25.0.dist-info}/WHEEL +0 -0
@@ -23,7 +23,7 @@
|
|
23
23
|
|
24
24
|
<span class="inline_label font-semibold text-gray-900">
|
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 ml-1 text-primary-600 underline text-xs">
|
27
27
|
{{ inline_admin_form.original }}
|
28
28
|
</a>
|
29
29
|
{% else %}
|
@@ -37,7 +37,7 @@
|
|
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-
|
40
|
+
<span class="material-symbols-outlined h-4 md-16 text-primary-600">launch</span>
|
41
41
|
</a>
|
42
42
|
{% endif %}
|
43
43
|
|
@@ -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
|
-
<
|
25
|
-
<
|
26
|
-
<
|
27
|
-
|
28
|
-
{%
|
29
|
-
|
30
|
-
<
|
31
|
-
|
24
|
+
<div class="border border-gray-200 mb-6 overflow-x-auto rounded-md shadow-sm dark:border-gray-800">
|
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 dark:border-gray-800">
|
31
|
+
<span class="flex flex-row items-center">
|
32
|
+
{{ field.label|capfirst }}
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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 lg:w-px dark:border-gray-800">
|
44
|
+
{% translate "Delete?" %}
|
37
45
|
</th>
|
38
46
|
{% endif %}
|
39
|
-
|
47
|
+
</tr>
|
48
|
+
</thead>
|
40
49
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
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
|
-
|
60
|
-
|
61
|
-
|
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
|
-
|
71
|
-
|
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
|
-
|
83
|
-
|
84
|
-
|
83
|
+
{% if inline_admin_form.needs_explicit_pk_field %}
|
84
|
+
{{ inline_admin_form.pk_field.field }}
|
85
|
+
{% endif %}
|
85
86
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
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
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
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
|
-
{%
|
104
|
-
{% endspaceless %}
|
105
|
+
{% endspaceless %}
|
105
106
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
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
|
-
|
128
|
-
|
129
|
-
{%
|
130
|
-
{%
|
131
|
-
{%
|
129
|
+
</td>
|
130
|
+
{% endif %}
|
131
|
+
{% endfor %}
|
132
|
+
{% endwith %}
|
133
|
+
{% endfor %}
|
132
134
|
{% endfor %}
|
133
|
-
{% endfor %}
|
134
135
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
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
|
-
|
143
|
-
|
144
|
-
|
145
|
-
{%
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
</
|
150
|
-
</
|
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>
|
@@ -1,12 +1,12 @@
|
|
1
1
|
{% load i18n unfold %}
|
2
2
|
|
3
3
|
<div class="mb-6">
|
4
|
-
<h3 class="font-medium mb-
|
4
|
+
<h3 class="font-medium mb-2 text-gray-700 text-sm dark:text-gray-200">
|
5
5
|
{% blocktranslate with filter_title=title %} By {{ filter_title }} {% endblocktranslate %}
|
6
6
|
</h3>
|
7
7
|
|
8
8
|
{% for choice in choices %}
|
9
|
-
{% if choice.selected %}
|
9
|
+
{% if choice.selected and spec.lookup_val.0 %}
|
10
10
|
<input type="hidden" name="{{ spec.lookup_kwarg }}" value="{{ spec.lookup_val.0 }}" />
|
11
11
|
{% endif %}
|
12
12
|
{% endfor %}
|
@@ -1,17 +1,20 @@
|
|
1
1
|
<div class="flex gap-4 items-center">
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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>
|
5
|
+
{% 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
|
+
{{ value.2 }}
|
8
|
+
</div>
|
9
|
+
{% endif %}
|
7
10
|
|
8
|
-
|
9
|
-
|
11
|
+
<div class="flex flex-col text-right lg:text-left">
|
12
|
+
<h3>{{ value.0 }}</h3>
|
10
13
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
{% if value.1 %}
|
15
|
+
<p class="text-gray-500">
|
16
|
+
{{ value.1 }}
|
17
|
+
</p>
|
18
|
+
{% endif %}
|
19
|
+
</div>
|
17
20
|
</div>
|
unfold/widgets.py
CHANGED
@@ -444,7 +444,7 @@ class UnfoldAdminNullBooleanSelectWidget(NullBooleanSelect):
|
|
444
444
|
super().__init__(attrs)
|
445
445
|
|
446
446
|
|
447
|
-
class
|
447
|
+
class UnfoldAdminSelectWidget(Select):
|
448
448
|
def __init__(self, attrs=None, choices=()):
|
449
449
|
if attrs is None:
|
450
450
|
attrs = {}
|
@@ -482,7 +482,7 @@ try:
|
|
482
482
|
def __init__(self, *args, **kwargs):
|
483
483
|
super().__init__(
|
484
484
|
amount_widget=UnfoldAdminTextInputWidget,
|
485
|
-
currency_widget=
|
485
|
+
currency_widget=UnfoldAdminSelectWidget(choices=CURRENCY_CHOICES),
|
486
486
|
)
|
487
487
|
|
488
488
|
except ImportError:
|
File without changes
|
File without changes
|