django-unfold 0.28.0__py3-none-any.whl → 0.29.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.28.0.dist-info → django_unfold-0.29.0.dist-info}/METADATA +80 -6
- {django_unfold-0.28.0.dist-info → django_unfold-0.29.0.dist-info}/RECORD +24 -23
- unfold/contrib/forms/widgets.py +2 -0
- unfold/contrib/simple_history/templates/simple_history/object_history.html +3 -5
- unfold/contrib/simple_history/templates/simple_history/{_object_history_list.html → object_history_list.html} +49 -11
- unfold/static/unfold/css/styles.css +1 -1
- unfold/styles.css +16 -3
- unfold/templates/admin/change_form.html +0 -16
- unfold/templates/admin/edit_inline/tabular.html +2 -2
- unfold/templates/unfold/components/button.html +3 -0
- unfold/templates/unfold/helpers/account_links.html +1 -1
- unfold/templates/unfold/helpers/boolean.html +1 -1
- unfold/templates/unfold/helpers/field_readonly_value.html +1 -1
- unfold/templates/unfold/helpers/fieldset_row.html +46 -20
- unfold/templates/unfold/helpers/navigation.html +1 -1
- unfold/templates/unfold/helpers/tab_action.html +1 -1
- unfold/templates/unfold/helpers/tab_list.html +6 -2
- unfold/templates/unfold/helpers/theme_switch.html +1 -1
- unfold/templates/unfold/widgets/foreign_key_raw_id.html +1 -1
- unfold/templates/unfold/widgets/split_datetime.html +7 -7
- unfold/templatetags/unfold.py +1 -0
- unfold/widgets.py +8 -4
- {django_unfold-0.28.0.dist-info → django_unfold-0.29.0.dist-info}/LICENSE.md +0 -0
- {django_unfold-0.28.0.dist-info → django_unfold-0.29.0.dist-info}/WHEEL +0 -0
@@ -4,29 +4,55 @@
|
|
4
4
|
{% if not line.has_visible_field %} hidden{% endif %}
|
5
5
|
{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
|
6
6
|
{% for field in line %}
|
7
|
-
<div class="flex group {% 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 %}">
|
7
|
+
<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 %}">
|
8
8
|
{% if field.is_checkbox %}
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
<div class="
|
17
|
-
{
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
{
|
24
|
-
|
25
|
-
|
9
|
+
{% if adminform.model_admin.compressed_fields %}
|
10
|
+
<div class="flex flex-row gap-4">
|
11
|
+
<div class="font-medium h-5 flex items-start -ml-2 min-w-32 w-32 lg:min-w-48 lg:w-48">
|
12
|
+
{{ field.label_tag }}
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="flex-grow">
|
16
|
+
<div class="flex flex-col lg:flex-row">
|
17
|
+
{{ field.field }}
|
18
|
+
|
19
|
+
{% if field.field.help_text %}
|
20
|
+
<div class="lg:-mt-2 lg:ml-2">
|
21
|
+
{% include "unfold/helpers/help_text.html" with help_text=field.field.help_text %}
|
22
|
+
</div>
|
23
|
+
{% endif %}
|
24
|
+
</div>
|
25
|
+
|
26
|
+
{% if field.errors %}
|
27
|
+
<span class="mt-1 text-red-600 text-sm dark:text-red-500">
|
28
|
+
{{ field.errors }}
|
29
|
+
</span>
|
30
|
+
{% endif %}
|
31
|
+
</div>
|
26
32
|
</div>
|
27
|
-
|
33
|
+
{% else %}
|
34
|
+
<div class="flex flex-row">
|
35
|
+
{{ field.field }}
|
36
|
+
|
37
|
+
<div class="flex flex-col">
|
38
|
+
{{ field.label_tag }}
|
39
|
+
|
40
|
+
{% if field.field.help_text %}
|
41
|
+
<div class="ml-2 -mt-1">
|
42
|
+
{% include "unfold/helpers/help_text.html" with help_text=field.field.help_text %}
|
43
|
+
</div>
|
44
|
+
{% endif %}
|
45
|
+
|
46
|
+
{% if field.errors %}
|
47
|
+
<span class="mt-1 text-red-600 text-sm dark:text-red-500">
|
48
|
+
{{ field.errors }}
|
49
|
+
</span>
|
50
|
+
{% endif %}
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
{% endif %}
|
28
54
|
{% else %}
|
29
|
-
<div class="{% if adminform.model_admin.compressed_fields %} min-w-48 mt-2 w-48{% endif %}">
|
55
|
+
<div class="{% if adminform.model_admin.compressed_fields %} min-w-48 lg:mt-2 w-48{% endif %}">
|
30
56
|
{{ field.label_tag }}
|
31
57
|
</div>
|
32
58
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{% load i18n %}
|
2
2
|
|
3
3
|
<div class="relative min-w-sidebar transition-width w-sidebar z-30">
|
4
|
-
<nav id="nav-sidebar" class="bg-gray-50 border-r border-gray-200 flex flex-col fixed max-h-screen min-h-screen min-w-sidebar transition-width w-sidebar dark:bg-gray-
|
4
|
+
<nav id="nav-sidebar" class="bg-gray-50 border-r border-gray-200 flex flex-col fixed max-h-screen min-h-screen min-w-sidebar transition-width w-sidebar dark:bg-gray-950 dark:border-gray-800">
|
5
5
|
<div class="border-b border-gray-200 mb-5 py-3 dark:border-gray-800">
|
6
6
|
<div class="flex font-medium h-10 items-center px-6 text-gray-700 dark:text-gray-200">
|
7
7
|
{% if site_logo %}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<li class="border-b flex-grow text-center md:border-b-0 md:border-r last:border-0 dark:border-gray-800">
|
2
|
-
<a href="{{ link }}" class="block px-4 py-2 text-gray-500 text-left whitespace-nowrap hover:text-gray-700 dark:text-gray-400 hover:dark:text-gray-200"{% if blank %} target="_blank"{% endif %}>
|
2
|
+
<a href="{{ link }}" class="block px-4 py-2 text-gray-500 text-left whitespace-nowrap hover:text-gray-700 dark:text-gray-400 hover:dark:text-gray-200"{% if blank %} target="_blank"{% endif %} {% include "unfold/helpers/attrs.html" with attrs=action.attrs %}>
|
3
3
|
{{ title }}
|
4
4
|
</a>
|
5
5
|
</li>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{% if not is_popup %}
|
2
|
-
{% if tab_list or actions_list or actions_items or nav_global %}
|
2
|
+
{% if tab_list or actions_list or actions_detail or actions_items or nav_global %}
|
3
3
|
<div class="flex items-start flex-col mb-4 text-gray-500 text-sm w-full md:border-b dark:md:border-gray-800 md:border-l-0 md:flex-row md:items-center md:justify-end dark:text-gray-400">
|
4
4
|
{% if tab_list %}
|
5
5
|
<ul class="border rounded-md flex flex-col w-full md:flex-row md:border-b-0 md:border-t-0 md:border-l-0 md:border-r-0 dark:border-gray-800">
|
@@ -15,12 +15,16 @@
|
|
15
15
|
</ul>
|
16
16
|
{% endif %}
|
17
17
|
|
18
|
-
{% if actions_list or actions_items or nav_global %}
|
18
|
+
{% if actions_list or actions_detail or actions_items or nav_global %}
|
19
19
|
<ul class="border flex flex-col mb-4 mt-2 rounded-md shadow-sm md:flex-row md:mb-2 md:mt-0 dark:border-gray-800 max-md:w-full">
|
20
20
|
{% for action in actions_list %}
|
21
21
|
{% include "unfold/helpers/tab_action.html" with title=action.title link=action.path %}
|
22
22
|
{% endfor %}
|
23
23
|
|
24
|
+
{% for action in actions_detail %}
|
25
|
+
{% include "unfold/helpers/tab_action.html" with title=action.title link=action.path %}
|
26
|
+
{% endfor %}
|
27
|
+
|
24
28
|
{% if actions_items %}
|
25
29
|
{{ actions_items }}
|
26
30
|
{% endif %}
|
@@ -7,7 +7,7 @@
|
|
7
7
|
</span>
|
8
8
|
</a>
|
9
9
|
|
10
|
-
<nav class="absolute bg-white border flex flex-col leading-none overflow-hidden py-1 -right-2 rounded shadow-lg text-sm text-gray-500 top-7 w-40 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400" x-cloak x-show="openTheme" @click.outside="openTheme = false">
|
10
|
+
<nav class="absolute bg-white border flex flex-col leading-none overflow-hidden py-1 -right-2 rounded shadow-lg text-sm text-gray-500 top-7 w-40 z-50 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400" x-cloak x-show="openTheme" @click.outside="openTheme = false">
|
11
11
|
<a class="cursor-pointer flex flex-row leading-none mx-1 px-3 py-1.5 rounded hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-700 dark:hover:text-gray-200"
|
12
12
|
x-on:click="adminTheme = 'dark'"
|
13
13
|
x-bind:class="adminTheme == 'dark' && 'text-primary-600 dark:text-primary-500 dark:hover:!text-primary-500 hover:!text-primary-600'">
|
@@ -1,23 +1,23 @@
|
|
1
|
-
<div class="datetime flex flex-col max-w-2xl lg:flex-row">
|
2
|
-
<div class="basis-1/2 flex flex-col flex-
|
3
|
-
<div class="font-medium mb-2 text-gray-500 text-sm dark:text-gray-400">
|
1
|
+
<div class="datetime flex flex-col gap-2 max-w-2xl lg:flex-row lg:group-[.field-row]:flex-row lg:group-[.field-row]:items-center lg:group-[.field-tabular]:flex-row lg:group-[.field-tabular]:items-center">
|
2
|
+
<div class="basis-1/2 flex flex-col lg:group-[.field-row]:flex-row group-[.field-row]:gap-2 lg:group-[.field-tabular]:flex-row group-[.field-tabular]:gap-2">
|
3
|
+
<div class="font-medium mb-2 text-gray-500 text-sm dark:text-gray-400 group-[.field-row]:mb-0 group-[.field-row]:flex group-[.field-row]:items-center group-[.field-tabular]:mb-0 group-[.field-tabular]:flex group-[.field-tabular]:items-center">
|
4
4
|
{{ date_label }}
|
5
5
|
</div>
|
6
6
|
|
7
7
|
{% with widget=widget.subwidgets.0 %}
|
8
|
-
<div class="flex flex-col relative">
|
8
|
+
<div class="flex flex-col min-w-52 relative group-[.field-row]:flex-grow group-[.field-tabular]:flex-grow">
|
9
9
|
{% include widget.template_name %}
|
10
10
|
</div>
|
11
11
|
{% endwith %}
|
12
12
|
</div>
|
13
13
|
|
14
|
-
<div class="basis-1/2 flex flex-col
|
15
|
-
<div class="font-medium mb-2 text-gray-500 text-sm dark:text-gray-400">
|
14
|
+
<div class="basis-1/2 flex flex-col lg:ml-auto md:mt-0 lg:group-[.field-row]:flex-row group-[.field-row]:gap-2 lg:group-[.field-tabular]:flex-row group-[.field-tabular]:gap-2">
|
15
|
+
<div class="font-medium mb-2 text-gray-500 text-sm dark:text-gray-400 group-[.field-row]:mb-0 group-[.field-row]:flex group-[.field-row]:items-center group-[.field-tabular]:mb-0 group-[.field-tabular]:flex group-[.field-tabular]:items-center">
|
16
16
|
{{ time_label }}
|
17
17
|
</div>
|
18
18
|
|
19
19
|
{% with widget=widget.subwidgets.1 %}
|
20
|
-
<div class="flex flex-col relative">
|
20
|
+
<div class="flex flex-col min-w-52 relative group-[.field-row]:flex-grow group-[.field-tabular]:flex-grow">
|
21
21
|
{% include widget.template_name %}
|
22
22
|
</div>
|
23
23
|
{% endwith %}
|
unfold/templatetags/unfold.py
CHANGED
@@ -26,6 +26,7 @@ def tab_list(context, opts) -> str:
|
|
26
26
|
context={
|
27
27
|
"tab_list": tabs,
|
28
28
|
"nav_global": context.get("nav_global"),
|
29
|
+
"actions_detail": context.get("actions_detail"),
|
29
30
|
"actions_list": context.get("actions_list"),
|
30
31
|
"actions_items": context.get("actions_items"),
|
31
32
|
"is_popup": context.get("is_popup"),
|
unfold/widgets.py
CHANGED
@@ -49,6 +49,7 @@ BASE_CLASSES = [
|
|
49
49
|
"border",
|
50
50
|
"bg-white",
|
51
51
|
"font-medium",
|
52
|
+
"min-w-20",
|
52
53
|
"rounded-md",
|
53
54
|
"shadow-sm",
|
54
55
|
"text-gray-500",
|
@@ -78,6 +79,8 @@ BASE_INPUT_CLASSES = [
|
|
78
79
|
|
79
80
|
INPUT_CLASSES = [*BASE_INPUT_CLASSES, "max-w-2xl"]
|
80
81
|
|
82
|
+
DATETIME_CLASSES = [*BASE_INPUT_CLASSES, "min-w-52"]
|
83
|
+
|
81
84
|
COLOR_CLASSES = [*BASE_CLASSES, "h-9.5", "px-2", "py-2", "w-32"]
|
82
85
|
|
83
86
|
INPUT_CLASSES_READONLY = [*BASE_INPUT_CLASSES, "bg-gray-50"]
|
@@ -227,6 +230,7 @@ SWITCH_CLASSES = [
|
|
227
230
|
"rounded-full",
|
228
231
|
"transition-all",
|
229
232
|
"w-8",
|
233
|
+
"min-w-8",
|
230
234
|
"after:absolute",
|
231
235
|
"after:bg-white",
|
232
236
|
"after:content-['']",
|
@@ -321,7 +325,7 @@ class UnfoldAdminDateWidget(AdminDateWidget):
|
|
321
325
|
self, attrs: Optional[Dict[str, Any]] = None, format: Optional[str] = None
|
322
326
|
) -> None:
|
323
327
|
attrs = {
|
324
|
-
"class": "vDateField " + " ".join(
|
328
|
+
"class": "vDateField " + " ".join(DATETIME_CLASSES),
|
325
329
|
"size": "10",
|
326
330
|
**(attrs or {}),
|
327
331
|
}
|
@@ -335,7 +339,7 @@ class UnfoldAdminSingleDateWidget(AdminDateWidget):
|
|
335
339
|
self, attrs: Optional[Dict[str, Any]] = None, format: Optional[str] = None
|
336
340
|
) -> None:
|
337
341
|
attrs = {
|
338
|
-
"class": "vDateField " + " ".join(
|
342
|
+
"class": "vDateField " + " ".join(DATETIME_CLASSES),
|
339
343
|
"size": "10",
|
340
344
|
**(attrs or {}),
|
341
345
|
}
|
@@ -347,7 +351,7 @@ class UnfoldAdminTimeWidget(AdminTimeWidget):
|
|
347
351
|
self, attrs: Optional[Dict[str, Any]] = None, format: Optional[str] = None
|
348
352
|
) -> None:
|
349
353
|
attrs = {
|
350
|
-
"class": "vTimeField " + " ".join(
|
354
|
+
"class": "vTimeField " + " ".join(DATETIME_CLASSES),
|
351
355
|
"size": "8",
|
352
356
|
**(attrs or {}),
|
353
357
|
}
|
@@ -361,7 +365,7 @@ class UnfoldAdminSingleTimeWidget(AdminTimeWidget):
|
|
361
365
|
self, attrs: Optional[Dict[str, Any]] = None, format: Optional[str] = None
|
362
366
|
) -> None:
|
363
367
|
attrs = {
|
364
|
-
"class": "vTimeField " + " ".join(
|
368
|
+
"class": "vTimeField " + " ".join(DATETIME_CLASSES),
|
365
369
|
"size": "8",
|
366
370
|
**(attrs or {}),
|
367
371
|
}
|
File without changes
|
File without changes
|