django-unfold 0.29.0__py3-none-any.whl → 0.30.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {django_unfold-0.29.0.dist-info → django_unfold-0.30.0.dist-info}/METADATA +5 -2
- {django_unfold-0.29.0.dist-info → django_unfold-0.30.0.dist-info}/RECORD +24 -24
- unfold/admin.py +2 -0
- unfold/contrib/forms/static/unfold/forms/js/trix.js +2 -2
- unfold/fields.py +2 -2
- unfold/forms.py +18 -3
- unfold/static/unfold/css/styles.css +1 -1
- unfold/static/unfold/js/app.js +19 -0
- unfold/styles.css +5 -1
- unfold/templates/admin/actions.html +1 -1
- unfold/templates/admin/app_list.html +1 -1
- unfold/templates/admin/change_list_results.html +1 -1
- unfold/templates/admin/edit_inline/stacked.html +12 -2
- unfold/templates/admin/edit_inline/tabular.html +14 -8
- unfold/templates/admin/filter.html +2 -2
- unfold/templates/admin/login.html +2 -2
- unfold/templates/admin/nav_sidebar.html +2 -2
- unfold/templates/unfold/change_list_filter.html +1 -1
- unfold/templates/unfold/helpers/field_readonly_value.html +1 -1
- unfold/templates/unfold/helpers/fieldset_row.html +1 -1
- unfold/templates/unfold/helpers/navigation.html +17 -15
- unfold/widgets.py +9 -2
- {django_unfold-0.29.0.dist-info → django_unfold-0.30.0.dist-info}/LICENSE.md +0 -0
- {django_unfold-0.29.0.dist-info → django_unfold-0.30.0.dist-info}/WHEEL +0 -0
@@ -59,22 +59,28 @@
|
|
59
59
|
|
60
60
|
{% if inline_admin_form.original or inline_admin_form.show_url %}
|
61
61
|
<tr>
|
62
|
-
<td class="original {% if inline_admin_form.original or inline_admin_form.show_url %}
|
62
|
+
<td class="original {% if inline_admin_form.original or inline_admin_form.show_url %}border-b border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-white/[.02]{% endif %}" colspan="{{ inline_admin_form|cell_count }}">
|
63
63
|
{% if inline_admin_form.original or inline_admin_form.show_url %}
|
64
|
-
<p class="
|
64
|
+
<p class="bg-gray-50 flex font-medium items-center px-3 py-2 text-gray-400 text-sm dark:bg-white/[.02] ">
|
65
65
|
{% if inline_admin_form.original %}
|
66
|
+
<span class="font-semibold text-gray-900 dark:text-gray-200">
|
67
|
+
{{ inline_admin_form.original }}
|
68
|
+
</span>
|
69
|
+
|
66
70
|
{% 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="{
|
68
|
-
{
|
71
|
+
<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' }} font-medium ml-2 text-primary-600 underline dark:text-primary-500">
|
72
|
+
{% if inline_admin_formset.has_change_permission %}
|
73
|
+
{% translate "Change" %}
|
74
|
+
{% else %}
|
75
|
+
{% translate "View" %}
|
76
|
+
{% endif %}
|
69
77
|
</a>
|
70
78
|
{% endif %}
|
71
|
-
{% else %}
|
72
|
-
{{ inline_admin_form.original }}
|
73
79
|
{% endif %}
|
74
80
|
|
75
81
|
{% if inline_admin_form.show_url %}
|
76
|
-
<a href="{{ inline_admin_form.absolute_url }}" class="ml-
|
77
|
-
|
82
|
+
<a href="{{ inline_admin_form.absolute_url }}" class="font-medium ml-2 text-primary-600 underline dark:text-primary-500">
|
83
|
+
{% translate "View on site" %}
|
78
84
|
</a>
|
79
85
|
{% endif %}
|
80
86
|
</p>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
{% if spec|class_name == "BooleanFieldListFilter" %}
|
15
15
|
<ul class="border-l-4 border-gray-200 flex pl-4 py-2 text-gray-500 text-sm dark:border-gray-700">
|
16
16
|
{% for choice in choices %}
|
17
|
-
<li class="{% if choice.selected %}font-medium text-primary-500 underline dark{% else %}text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200{% endif %} pr-4">
|
17
|
+
<li class="{% if choice.selected %}font-medium text-primary-600 dark:text-primary-500 underline dark{% else %}text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200{% endif %} pr-4">
|
18
18
|
<a href="{{ choice.query_string|iriencode }}" title="{{ choice.display }}">
|
19
19
|
{{ choice.display }}
|
20
20
|
</a>
|
@@ -24,7 +24,7 @@
|
|
24
24
|
{% else %}
|
25
25
|
<ul class="border-l-4 border-gray-200 flex flex-col pl-4 py-4 text-gray-500 text-sm dark:border-gray-700">
|
26
26
|
{% for choice in choices %}
|
27
|
-
<li class="mb-4 last:mb-0 {% if choice.selected %}font-medium text-primary-500 underline {% else %}text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200{% endif %}">
|
27
|
+
<li class="mb-4 last:mb-0 {% if choice.selected %}font-medium text-primary-600 dark:text-primary-500 underline {% else %}text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200{% endif %}">
|
28
28
|
<a href="{{ choice.query_string|iriencode }}" title="{{ choice.display }}">
|
29
29
|
{{ choice.display }}
|
30
30
|
</a>
|
@@ -29,7 +29,7 @@
|
|
29
29
|
<div class="w-full sm:w-96">
|
30
30
|
<h1 class="font-semibold mb-10">
|
31
31
|
<span class="block text-gray-700 dark:text-gray-200">{% trans 'Welcome back to' %}</span>
|
32
|
-
<span class="block text-primary-600 text-xl">{{ site_title }}</span>
|
32
|
+
<span class="block text-primary-600 text-xl dark:text-primary-500">{{ site_title }}</span>
|
33
33
|
</h1>
|
34
34
|
|
35
35
|
{% include "unfold/helpers/messages/errornote.html" with errors=form.errors %}
|
@@ -78,7 +78,7 @@
|
|
78
78
|
|
79
79
|
<div class="absolute flex flex-row items-center justify-between left-0 m-4 right-0 top-0">
|
80
80
|
{% if site_url %}
|
81
|
-
<a href="{{ site_url }}" class="flex font-medium items-center text-sm text-primary-600">
|
81
|
+
<a href="{{ site_url }}" class="flex font-medium items-center text-sm text-primary-600 dark:text-primary-500">
|
82
82
|
<span class="material-symbols-outlined mr-2">arrow_back</span> {% trans 'Return to site' %}
|
83
83
|
</a>
|
84
84
|
{% endif %}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<div @click="sidebarDesktopOpen = !sidebarDesktopOpen"
|
5
5
|
hx-get="{% url "admin:toggle_sidebar" %}"
|
6
6
|
hx-swap="none"
|
7
|
-
class="
|
7
|
+
class="bg-white border cursor-pointer fixed h-6 hidden items-center justify-center rounded-full text-gray-500 top-5 -translate-x-1/2 w-6 z-50 xl:flex dark:bg-gray-800 dark:border-gray-700 dark:text-gray-200"
|
8
8
|
:class="{'ml-6 rotate-180': !sidebarDesktopOpen, 'ml-72': sidebarDesktopOpen}">
|
9
9
|
<span class="material-symbols-outlined md-16">
|
10
10
|
first_page
|
@@ -12,7 +12,7 @@
|
|
12
12
|
</div>
|
13
13
|
|
14
14
|
<div @click="sidebarMobileOpen = !sidebarMobileOpen"
|
15
|
-
class="fixed bottom-0 bg-gray-700
|
15
|
+
class="fixed bottom-0 bg-gray-700 cursor-pointer flex items-center left-0 mb-2 ml-2 justify-center px-2 py-1 rounded-full shadow-sm text-xs text-white uppercase z-50 xl:hidden"
|
16
16
|
:class="{'ml-72 -translate-x-1/2': sidebarMobileOpen}">
|
17
17
|
{% trans "Menu" %}
|
18
18
|
</div>
|
@@ -1 +1 @@
|
|
1
|
-
<div class="readonly font-medium max-w-4xl py-2 text-gray-500 text-sm
|
1
|
+
<div class="readonly font-medium max-w-4xl py-2 text-gray-500 text-sm dark:text-gray-400 *:rounded-md {% if not adminform.model_admin.compressed_fields and not field.is_image %}bg-gray-50 border 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>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
{% if field.is_checkbox %}
|
9
9
|
{% if adminform.model_admin.compressed_fields %}
|
10
10
|
<div class="flex flex-row gap-4">
|
11
|
-
<div class="font-medium
|
11
|
+
<div class="font-medium flex items-start -ml-2 min-w-32 w-32 lg:min-w-48 lg:w-48">
|
12
12
|
{{ field.label_tag }}
|
13
13
|
</div>
|
14
14
|
|
@@ -1,23 +1,25 @@
|
|
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
|
5
|
-
<div class="
|
6
|
-
<div class="
|
7
|
-
|
8
|
-
{%
|
9
|
-
|
10
|
-
{%
|
11
|
-
|
4
|
+
<nav id="nav-sidebar" class="bg-gray-50 border-r border-gray-200 fixed max-h-screen transition-width w-sidebar dark:bg-gray-900 dark:border-gray-800">
|
5
|
+
<div class="flex flex-col min-h-screen min-w-sidebar dark:bg-gray-950/20">
|
6
|
+
<div class="border-b border-gray-200 mb-5 py-3 dark:border-gray-800">
|
7
|
+
<div class="flex font-medium h-10 items-center px-6 text-gray-700 dark:text-gray-200">
|
8
|
+
{% if site_logo %}
|
9
|
+
{% include "unfold/helpers/site_logo.html" %}
|
10
|
+
{% elif branding %}
|
11
|
+
{% include "unfold/helpers/site_icon.html" %}
|
12
|
+
{% endif %}
|
13
|
+
</div>
|
12
14
|
</div>
|
13
|
-
</div>
|
14
15
|
|
15
|
-
|
16
|
+
{% include "unfold/helpers/search.html" %}
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
{% if sidebar_navigation|length > 0 %}
|
19
|
+
{% include "unfold/helpers/app_list.html" with app_list=available_apps %}
|
20
|
+
{% else %}
|
21
|
+
{% include "admin/app_list.html" with app_list=available_apps show_changelinks=False %}
|
22
|
+
{% endif %}
|
23
|
+
</div>
|
22
24
|
</nav>
|
23
25
|
</div>
|
unfold/widgets.py
CHANGED
@@ -23,6 +23,7 @@ from django.forms import (
|
|
23
23
|
MultiWidget,
|
24
24
|
NullBooleanSelect,
|
25
25
|
NumberInput,
|
26
|
+
PasswordInput,
|
26
27
|
Select,
|
27
28
|
)
|
28
29
|
from django.utils.translation import gettext_lazy as _
|
@@ -90,12 +91,10 @@ TEXTAREA_CLASSES = [
|
|
90
91
|
"max-w-4xl",
|
91
92
|
"appearance-none",
|
92
93
|
"expandable",
|
93
|
-
"overflow-hidden",
|
94
94
|
"transition",
|
95
95
|
"transition-height",
|
96
96
|
"duration-75",
|
97
97
|
"ease-in-out",
|
98
|
-
"resize-none",
|
99
98
|
]
|
100
99
|
|
101
100
|
TEXTAREA_EXPANDABLE_CLASSES = [
|
@@ -116,6 +115,7 @@ SELECT_CLASSES = [
|
|
116
115
|
|
117
116
|
PROSE_CLASSES = [
|
118
117
|
"font-normal",
|
118
|
+
"whitespace-normal",
|
119
119
|
"prose-sm",
|
120
120
|
"prose-blockquote:border-l-4",
|
121
121
|
"prose-blockquote:not-italic",
|
@@ -567,3 +567,10 @@ class UnfoldForeignKeyRawIdWidget(ForeignKeyRawIdWidget):
|
|
567
567
|
**(attrs or {}),
|
568
568
|
}
|
569
569
|
super().__init__(rel, admin_site, attrs, using)
|
570
|
+
|
571
|
+
|
572
|
+
class UnfoldAdminPasswordInput(PasswordInput):
|
573
|
+
def __init__(self, attrs=None, render_value=False):
|
574
|
+
super().__init__(
|
575
|
+
{"class": " ".join(INPUT_CLASSES), **(attrs or {})}, render_value
|
576
|
+
)
|
File without changes
|
File without changes
|