django-unfold 0.59.0__py3-none-any.whl → 0.61.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.59.0.dist-info → django_unfold-0.61.0.dist-info}/METADATA +17 -7
- {django_unfold-0.59.0.dist-info → django_unfold-0.61.0.dist-info}/RECORD +58 -47
- unfold/admin.py +45 -13
- unfold/contrib/import_export/templates/admin/import_export/change_list_import.html +5 -0
- unfold/contrib/inlines/admin.py +11 -6
- unfold/contrib/inlines/forms.py +3 -1
- unfold/contrib/location_field/__init__.py +0 -0
- unfold/contrib/location_field/apps.py +6 -0
- unfold/contrib/location_field/templates/location_field/map_widget.html +5 -0
- unfold/contrib/simple_history/templates/simple_history/submit_line.html +16 -18
- unfold/fields.py +17 -19
- unfold/forms.py +96 -2
- unfold/mixins/base_model_admin.py +21 -2
- unfold/sites.py +18 -31
- unfold/static/admin/js/admin/RelatedObjectLookups.js +2 -2
- unfold/static/unfold/css/styles.css +1 -1
- unfold/static/unfold/js/app.js +61 -0
- unfold/styles.css +6 -8
- unfold/templates/admin/app_list.html +4 -1
- unfold/templates/admin/auth/user/add_form.html +1 -5
- unfold/templates/admin/change_form.html +3 -1
- unfold/templates/admin/change_list.html +4 -2
- unfold/templates/admin/change_list_results.html +3 -3
- unfold/templates/admin/edit_inline/stacked.html +18 -8
- unfold/templates/admin/edit_inline/tabular.html +2 -0
- unfold/templates/admin/includes/fieldset.html +9 -3
- unfold/templates/admin/login.html +45 -88
- unfold/templates/admin/search_form.html +14 -5
- unfold/templates/admin/submit_line.html +1 -1
- unfold/templates/unfold/components/button.html +10 -1
- unfold/templates/unfold/components/card.html +4 -4
- unfold/templates/unfold/helpers/add_link.html +3 -1
- unfold/templates/unfold/helpers/app_list.html +5 -2
- unfold/templates/unfold/helpers/app_list_default.html +2 -1
- unfold/templates/unfold/helpers/field.html +5 -3
- unfold/templates/unfold/helpers/fieldsets_tabs.html +3 -3
- unfold/templates/unfold/helpers/help_text.html +1 -1
- unfold/templates/unfold/helpers/messages.html +4 -4
- unfold/templates/unfold/helpers/pagination.html +1 -1
- unfold/templates/unfold/helpers/pagination_inline.html +28 -0
- unfold/templates/unfold/helpers/popup_header.html +27 -0
- unfold/templates/unfold/helpers/search.html +16 -12
- unfold/templates/unfold/helpers/search_results.html +10 -9
- unfold/templates/unfold/helpers/shortcut.html +3 -0
- unfold/templates/unfold/helpers/site_branding.html +2 -2
- unfold/templates/unfold/helpers/tab_action.html +4 -3
- unfold/templates/unfold/helpers/unauthenticated_header.html +15 -0
- unfold/templates/unfold/helpers/unauthenticated_title.html +11 -0
- unfold/templates/unfold/layouts/unauthenticated.html +37 -0
- unfold/templates/unfold/widgets/text.html +28 -0
- unfold/templates/unfold_crispy/field.html +12 -10
- unfold/templates/unfold_crispy/layout/checkbox.html +20 -4
- unfold/templates/unfold_crispy/layout/fieldset.html +3 -3
- unfold/templatetags/unfold.py +34 -4
- unfold/templatetags/unfold_list.py +4 -1
- unfold/widgets.py +42 -1
- {django_unfold-0.59.0.dist-info → django_unfold-0.61.0.dist-info}/LICENSE.md +0 -0
- {django_unfold-0.59.0.dist-info → django_unfold-0.61.0.dist-info}/WHEEL +0 -0
unfold/static/unfold/js/app.js
CHANGED
@@ -25,6 +25,67 @@ const sortRecords = (e) => {
|
|
25
25
|
});
|
26
26
|
};
|
27
27
|
|
28
|
+
/*************************************************************
|
29
|
+
* Search form
|
30
|
+
*************************************************************/
|
31
|
+
function searchForm() {
|
32
|
+
return {
|
33
|
+
applyShortcut(event) {
|
34
|
+
if (
|
35
|
+
event.key === "/" &&
|
36
|
+
document.activeElement.tagName.toLowerCase() !== "input" &&
|
37
|
+
document.activeElement.tagName.toLowerCase() !== "textarea" &&
|
38
|
+
!document.activeElement.isContentEditable
|
39
|
+
) {
|
40
|
+
event.preventDefault();
|
41
|
+
this.$refs.searchInput.focus();
|
42
|
+
}
|
43
|
+
},
|
44
|
+
};
|
45
|
+
}
|
46
|
+
|
47
|
+
/*************************************************************
|
48
|
+
* Search dropdown
|
49
|
+
*************************************************************/
|
50
|
+
function searchDropdown() {
|
51
|
+
return {
|
52
|
+
openSearchResults: true,
|
53
|
+
currentIndex: 0,
|
54
|
+
applyShortcut(event) {
|
55
|
+
if (
|
56
|
+
event.key === "t" &&
|
57
|
+
document.activeElement.tagName.toLowerCase() !== "input" &&
|
58
|
+
document.activeElement.tagName.toLowerCase() !== "textarea" &&
|
59
|
+
!document.activeElement.isContentEditable
|
60
|
+
) {
|
61
|
+
event.preventDefault();
|
62
|
+
this.$refs.searchInput.focus();
|
63
|
+
}
|
64
|
+
},
|
65
|
+
nextItem() {
|
66
|
+
if (this.currentIndex < this.maxItem()) {
|
67
|
+
this.currentIndex++;
|
68
|
+
}
|
69
|
+
},
|
70
|
+
prevItem() {
|
71
|
+
if (this.currentIndex > 0) {
|
72
|
+
this.currentIndex--;
|
73
|
+
}
|
74
|
+
},
|
75
|
+
maxItem() {
|
76
|
+
return document.getElementById("search-results").querySelectorAll("li")
|
77
|
+
.length;
|
78
|
+
},
|
79
|
+
selectItem() {
|
80
|
+
const items = document
|
81
|
+
.getElementById("search-results")
|
82
|
+
.querySelectorAll("li");
|
83
|
+
|
84
|
+
window.location = items[this.currentIndex - 1].querySelector("a").href;
|
85
|
+
},
|
86
|
+
};
|
87
|
+
}
|
88
|
+
|
28
89
|
/*************************************************************
|
29
90
|
* Warn without saving
|
30
91
|
*************************************************************/
|
unfold/styles.css
CHANGED
@@ -35,6 +35,8 @@
|
|
35
35
|
|
36
36
|
@theme {
|
37
37
|
--font-sans: 'Inter', sans-serif;
|
38
|
+
--shadow-raised: 0 2px 12px rgba(0, 0, 0, 0.12);
|
39
|
+
--shadow-raised-dark: 0 2px 12px rgba(255, 255, 255, 0.12);
|
38
40
|
}
|
39
41
|
|
40
42
|
@theme inline{
|
@@ -197,7 +199,7 @@ table tr.selected th {
|
|
197
199
|
}
|
198
200
|
|
199
201
|
.timezonewarning {
|
200
|
-
@apply absolute block items-center right-
|
202
|
+
@apply absolute block items-center right-11 top-2 text-base-500 truncate;
|
201
203
|
font-size: 0;
|
202
204
|
}
|
203
205
|
|
@@ -218,7 +220,7 @@ table tr.selected th {
|
|
218
220
|
Selector
|
219
221
|
*******************************************************/
|
220
222
|
.selector {
|
221
|
-
@apply flex flex-col grow items-center md:flex-row;
|
223
|
+
@apply flex flex-col grow items-center max-w-5xl md:flex-row;
|
222
224
|
}
|
223
225
|
|
224
226
|
.selector .selector-available-title label,
|
@@ -319,7 +321,7 @@ table tr.selected th {
|
|
319
321
|
}
|
320
322
|
|
321
323
|
[data-inline-type="stacked"] .add-row {
|
322
|
-
@apply
|
324
|
+
@apply overflow-hidden;
|
323
325
|
}
|
324
326
|
|
325
327
|
.add-row td {
|
@@ -338,10 +340,6 @@ td .inline-deletelink {
|
|
338
340
|
@apply block lg:mt-2.5;
|
339
341
|
}
|
340
342
|
|
341
|
-
h3 span:nth-child(3) {
|
342
|
-
@apply ml-auto;
|
343
|
-
}
|
344
|
-
|
345
343
|
/*******************************************************
|
346
344
|
Autocomplete
|
347
345
|
*******************************************************/
|
@@ -483,7 +481,7 @@ fieldset details > summary {
|
|
483
481
|
}
|
484
482
|
|
485
483
|
fieldset details > summary:after {
|
486
|
-
@apply material-symbols-outlined absolute right-3 top-3.5;
|
484
|
+
@apply material-symbols-outlined absolute cursor-pointer right-3 top-3.5;
|
487
485
|
content: "expand_more";
|
488
486
|
}
|
489
487
|
|
@@ -44,5 +44,8 @@
|
|
44
44
|
{% endfor %}
|
45
45
|
</div>
|
46
46
|
{% else %}
|
47
|
-
<p>
|
47
|
+
<p>
|
48
|
+
{% trans "You don’t have permission to view or edit anything." as error_message %}
|
49
|
+
{% include "unfold/helpers/messages/error.html" with error=error_message %}
|
50
|
+
</p>
|
48
51
|
{% endif %}
|
@@ -3,10 +3,6 @@
|
|
3
3
|
|
4
4
|
{% block form_top %}
|
5
5
|
<p class="bg-blue-50 border-blue-200 mb-8 p-3 rounded-default text-blue-500 text-sm dark:bg-blue-500/20 dark:border-blue-500/10">
|
6
|
-
{%
|
7
|
-
{% translate 'First, enter a username and password. Then, you’ll be able to edit more user options.' %}
|
8
|
-
{% else %}
|
9
|
-
{% translate "Enter a username and password." %}
|
10
|
-
{% endif %}
|
6
|
+
{% translate "After you've created a user, you’ll be able to edit more user options." %}
|
11
7
|
<p>
|
12
8
|
{% endblock %}
|
@@ -59,13 +59,15 @@
|
|
59
59
|
|
60
60
|
{% block content %}
|
61
61
|
<div id="content-main">
|
62
|
+
{% include "unfold/helpers/popup_header.html" %}
|
63
|
+
|
62
64
|
{% block form_before %}{% endblock %}
|
63
65
|
|
64
66
|
{% if adminform.model_admin.change_form_outer_before_template %}
|
65
67
|
{% include adminform.model_admin.change_form_outer_before_template %}
|
66
68
|
{% endif %}
|
67
69
|
|
68
|
-
<form {% if adminform.model_admin.conditional_fields %}x-data='{{ adminform|changeform_data }}'{% endif %} {% if has_file_field %}enctype="multipart/form-data" {% endif %}{% if form_url %}action="{{ form_url }}" {% endif %}method="post" id="{{ opts.model_name }}_form" {% if adminform.model_admin.warn_unsaved_form %}class="warn-unsaved-form"{% endif %} novalidate>
|
70
|
+
<form {% if adminform.model_admin.conditional_fields %}x-data='{{ adminform|changeform_data }}'{% endif %} {% if has_file_field %}enctype="multipart/form-data" {% endif %}{% if form_url %}action="{{ form_url }}"{% else %}x-bind:value="activeTab && activeTab !== 'general' ? '#' + activeTab : ''" {% endif %}method="post" id="{{ opts.model_name }}_form" {% if adminform.model_admin.warn_unsaved_form %}class="warn-unsaved-form"{% endif %} novalidate>
|
69
71
|
{% csrf_token %}
|
70
72
|
|
71
73
|
{% if adminform.model_admin.change_form_before_template %}
|
@@ -55,6 +55,8 @@
|
|
55
55
|
|
56
56
|
{% block content %}
|
57
57
|
<div id="content-main" x-data="{ filterOpen: false }">
|
58
|
+
{% include "unfold/helpers/popup_header.html" %}
|
59
|
+
|
58
60
|
{% if cl.formset and cl.formset.errors %}
|
59
61
|
{% include "unfold/helpers/messages/errornote.html" with errors=cl.formset.errors %}
|
60
62
|
|
@@ -70,7 +72,7 @@
|
|
70
72
|
{% endif %}
|
71
73
|
{% endblock %}
|
72
74
|
|
73
|
-
{% if cl.model_admin.list_before_template %}
|
75
|
+
{% if cl.model_admin.list_before_template and not is_popup %}
|
74
76
|
{% include cl.model_admin.list_before_template %}
|
75
77
|
{% endif %}
|
76
78
|
|
@@ -106,7 +108,7 @@
|
|
106
108
|
{% endblock %}
|
107
109
|
</form>
|
108
110
|
|
109
|
-
{% if cl.model_admin.list_after_template %}
|
111
|
+
{% if cl.model_admin.list_after_template and not is_popup %}
|
110
112
|
{% include cl.model_admin.list_after_template %}
|
111
113
|
{% endif %}
|
112
114
|
</div>
|
@@ -70,7 +70,7 @@
|
|
70
70
|
</thead>
|
71
71
|
|
72
72
|
{% for result in results %}
|
73
|
-
<tbody class="block lg:table-row-group" x-data="{rowOpen: false}">
|
73
|
+
<tbody class="{% cycle '' 'after:bg-base-50 dark:after:bg-white/[.02]' %} block relative lg:table-row-group lg:hover:shadow-raised lg:dark:hover:shadow-raised-dark lg:hover:z-20 after:content-[''] after:absolute after:inset-0" x-data="{rowOpen: false}">
|
74
74
|
{% if result.form and result.form.non_field_errors %}
|
75
75
|
<tr>
|
76
76
|
<td class="text-left" colspan="{{ result|length }}">
|
@@ -79,7 +79,7 @@
|
|
79
79
|
</tr>
|
80
80
|
{% endif %}
|
81
81
|
|
82
|
-
<tr class="
|
82
|
+
<tr class="block border border-base-200 mb-3 relative rounded-default shadow-xs z-20 lg:table-row lg:border-none lg:mb-0 lg:rounded-none lg:shadow-none dark:border-base-800">
|
83
83
|
{% if cl.model_admin.list_sections|length > 0 %}
|
84
84
|
<td class="align-middle cursor-pointer flex border-b border-base-200 font-normal px-2.5 py-2 relative text-left before:font-semibold before:text-font-important-light before:block before:capitalize before:content-[attr(data-label)] before:mr-auto lg:before:hidden lg:border-b-0 lg:border-t lg:pl-3 lg:pr-0 lg:py-3 lg:table-cell dark:border-base-800 dark:lg:border-base-800 dark:before:text-font-important-dark lg:w-px"
|
85
85
|
data-label="{% trans "Expand row" %}"
|
@@ -99,7 +99,7 @@
|
|
99
99
|
</tr>
|
100
100
|
|
101
101
|
{% if cl.model_admin.list_sections|length > 0 %}
|
102
|
-
<tr class="block mb-3 lg:table-row" x-show="rowOpen">
|
102
|
+
<tr class="block mb-3 relative z-30 lg:table-row" x-show="rowOpen">
|
103
103
|
<td colspan="{{ result|length|add:2 }}" class="border bg-base-200/10 block border-base-200 relative rounded-default p-3 lg:shadow-inner lg:border-0 lg:border-t lg:rounded-none lg:table-cell dark:border-base-800">
|
104
104
|
<div class="absolute bg-primary-600 h-full hidden left-0 top-0 w-0.5 lg:block"></div>
|
105
105
|
|
@@ -17,15 +17,21 @@
|
|
17
17
|
{{ inline_admin_formset.formset.management_form }}
|
18
18
|
{% include "unfold/helpers/messages/error.html" with errors=inline_admin_formset.formset.non_form_errors %}
|
19
19
|
|
20
|
-
<div class="border border-base-200 mb-6 overflow-hidden rounded-default shadow-xs w-full dark:border-base-800
|
20
|
+
<div class="border border-base-200 mb-6 overflow-hidden rounded-default shadow-xs w-full dark:border-base-800"
|
21
21
|
{% if inline_admin_formset.opts.ordering_field %}
|
22
22
|
data-ordering-field="{{ inline_admin_formset.opts.ordering_field }}" x-on:end="sortRecords" x-sort.ghost
|
23
23
|
{% endif %}>
|
24
24
|
|
25
25
|
{% for inline_admin_form in inline_admin_formset %}
|
26
|
-
<div x-sort:item 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 %}">
|
26
|
+
<div x-sort:item 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 %}" {% if inline_admin_formset.opts.collapsible and inline_admin_form.original %}x-data="{ open: {% if inline_admin_form.errors %}true{% else %}false{% endif %} }"{% endif %}>
|
27
27
|
{% if not inline_admin_formset.opts.hide_title or inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
|
28
|
-
<h3 class="
|
28
|
+
<h3 class="border-b border-base-200 flex font-medium items-center gap-2 px-3 py-2 text-sm dark:border-base-800 {% if inline_admin_formset.opts.collapsible and inline_admin_form.original %}cursor-pointer{% endif %}" {% if inline_admin_formset.opts.collapsible and inline_admin_form.original %}x-on:click="open = !open"{% endif %}>
|
29
|
+
{% if inline_admin_formset.opts.collapsible and inline_admin_form.original %}
|
30
|
+
<span class="material-symbols-outlined select-none block! -rotate-90 transition-all" x-bind:class="open && 'rotate-0'">
|
31
|
+
expand_more
|
32
|
+
</span>
|
33
|
+
{% endif %}
|
34
|
+
|
29
35
|
{% if inline_admin_formset.opts.ordering_field %}
|
30
36
|
{% if inline_admin_form.original %}
|
31
37
|
<span class="material-symbols-outlined cursor-pointer" x-sort:handle>drag_indicator</span>
|
@@ -82,11 +88,13 @@
|
|
82
88
|
|
83
89
|
{% include "unfold/helpers/messages/error.html" with errors=inline_admin_form.form.non_field_errors %}
|
84
90
|
|
85
|
-
{%
|
86
|
-
|
87
|
-
{%
|
88
|
-
|
89
|
-
|
91
|
+
<div class="border-b border-base-200 dark:border-base-800" {% if inline_admin_formset.opts.collapsible and inline_admin_form.original %}x-show="open"{% endif %}>
|
92
|
+
{% for fieldset in inline_admin_form %}
|
93
|
+
<div class="{% if inline_admin_formset.opts.hide_title %}{% if not inline_admin_formset.formset.can_delete or not inline_admin_formset.has_delete_permission %}pt-3{% endif %}{% endif %}">
|
94
|
+
{% include 'admin/includes/fieldset.html' with stacked=1 %}
|
95
|
+
</div>
|
96
|
+
{% endfor %}
|
97
|
+
</div>
|
90
98
|
|
91
99
|
{% if inline_admin_form.needs_explicit_pk_field %}
|
92
100
|
{{ inline_admin_form.pk_field.field }}
|
@@ -97,6 +105,8 @@
|
|
97
105
|
{% endfor %}
|
98
106
|
</div>
|
99
107
|
|
108
|
+
{% include "unfold/helpers/pagination_inline.html" %}
|
109
|
+
|
100
110
|
{% if inline_admin_formset.is_collapsible %}</details>{% endif %}
|
101
111
|
</fieldset>
|
102
112
|
</div>
|
@@ -1,18 +1,22 @@
|
|
1
1
|
{% load unfold %}
|
2
2
|
|
3
|
-
<fieldset class="module{% if fieldset.classes %} {{ fieldset.classes }}{% endif %}" {% if stacked != 1 %}x-show="activeTab == 'general'"{% endif %}>
|
3
|
+
<fieldset class="module relative {% if fieldset.classes %} {{ fieldset.classes }}{% endif %}" {% if stacked != 1 %}x-show="activeTab == 'general'"{% endif %}>
|
4
|
+
{% if fieldset.is_collapsible %}<details><summary>{% endif %}
|
5
|
+
|
4
6
|
{% if fieldset.name and "tab" not in fieldset.classes %}
|
5
7
|
{% if stacked == 1 %}
|
6
|
-
<h2 class="
|
8
|
+
<h2 class="border-b border-base-200 border-t border-dashed font-semibold text-font-important-light px-3 py-4.5 dark:text-font-important-dark dark:border-base-800 {% if fieldset.is_collapsible %}cursor-pointer{% endif %}">
|
7
9
|
{{ fieldset.name }}
|
8
10
|
</h2>
|
9
11
|
{% else %}
|
10
|
-
<h2 class="bg-base-100 font-semibold mb-6 px-4 py-3 rounded-default text-font-important-light text-sm 2xl:-mx-4 dark:bg-white/[.02] dark:text-font-important-dark">
|
12
|
+
<h2 class="bg-base-100 font-semibold mb-6 px-4 py-3 rounded-default text-font-important-light text-sm 2xl:-mx-4 dark:bg-white/[.02] dark:text-font-important-dark {% if fieldset.is_collapsible %}cursor-pointer{% endif %}">
|
11
13
|
{{ fieldset.name }}
|
12
14
|
</h2>
|
13
15
|
{% endif %}
|
14
16
|
{% endif %}
|
15
17
|
|
18
|
+
{% if fieldset.is_collapsible %}</summary>{% endif %}
|
19
|
+
|
16
20
|
{% if fieldset.description %}
|
17
21
|
<div class="leading-relaxed mb-4 max-w-4xl text-sm">
|
18
22
|
{{ fieldset.description|safe }}
|
@@ -24,4 +28,6 @@
|
|
24
28
|
{% include "unfold/helpers/fieldset_row.html" %}
|
25
29
|
{% endfor %}
|
26
30
|
</div>
|
31
|
+
|
32
|
+
{% if fieldset.name and fieldset.is_collapsible %}</details>{% endif %}
|
27
33
|
</fieldset>
|
@@ -1,105 +1,62 @@
|
|
1
|
-
{% extends 'unfold/layouts/
|
1
|
+
{% extends 'unfold/layouts/unauthenticated.html' %}
|
2
2
|
|
3
|
-
{% load i18n static %}
|
3
|
+
{% load i18n static unfold %}
|
4
4
|
|
5
5
|
{% block extrastyle %}
|
6
6
|
{{ block.super }}
|
7
7
|
{{ form.media }}
|
8
8
|
{% endblock %}
|
9
9
|
|
10
|
-
{% block
|
10
|
+
{% block title %}
|
11
|
+
{{ title }} | {{ site_title }}
|
12
|
+
{% endblock %}
|
11
13
|
|
12
|
-
{% block
|
14
|
+
{% block content %}
|
15
|
+
{% include "unfold/helpers/unauthenticated_title.html" with title=site_title|default:_('Django site admin') subtitle=_('Welcome back to') %}
|
13
16
|
|
14
|
-
{%
|
17
|
+
{% include "unfold/helpers/messages.html" %}
|
15
18
|
|
16
|
-
{%
|
19
|
+
{% if form.errors or form.non_field_errors %}
|
20
|
+
<div class="flex flex-col gap-4 mb-8 *:mb-0">
|
21
|
+
{% include "unfold/helpers/messages/errornote.html" with errors=form.errors %}
|
17
22
|
|
18
|
-
{%
|
23
|
+
{% include "unfold/helpers/messages/error.html" with errors=form.non_field_errors %}
|
19
24
|
|
20
|
-
{%
|
25
|
+
{% if user.is_authenticated %}
|
26
|
+
{% blocktranslate trimmed asvar message %}
|
27
|
+
You are authenticated as {{ username }}, but are not authorized to
|
28
|
+
access this page. Would you like to login to a different account?
|
29
|
+
{% endblocktranslate %}
|
21
30
|
|
22
|
-
{%
|
23
|
-
|
24
|
-
|
31
|
+
{% include "unfold/helpers/messages/error.html" with error=message %}
|
32
|
+
{% endif %}
|
33
|
+
</div>
|
34
|
+
{% endif %}
|
35
|
+
|
36
|
+
{% block login_before %}{% endblock %}
|
37
|
+
|
38
|
+
<form action="{{ app_path }}" method="post" id="login-form">
|
39
|
+
{% csrf_token %}
|
40
|
+
|
41
|
+
{% include "unfold/helpers/field.html" with field=form.username %}
|
42
|
+
|
43
|
+
{% include "unfold/helpers/field.html" with field=form.password %}
|
44
|
+
|
45
|
+
<div class="flex flex-col gap-3 mt-6">
|
46
|
+
{% component "unfold/components/button.html" with submit=1 variant="primary" class="submit-row w-full" %}
|
47
|
+
{% translate 'Log in' %} <span class="material-symbols-outlined ml-2 relative right-0 transition-all group-hover:-right-1">arrow_forward</span>
|
48
|
+
{% endcomponent %}
|
49
|
+
|
50
|
+
{% url 'admin_password_reset' as password_reset_url %}
|
51
|
+
{% url 'admin:admin_password_reset' as unfold_password_reset_url %}
|
25
52
|
|
26
|
-
{%
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
<span class="block text-font-important-light dark:text-font-important-dark">{% trans 'Welcome back to' %}</span>
|
32
|
-
<span class="block text-primary-600 text-xl dark:text-primary-500">{{ site_title|default:_('Django site admin') }}</span>
|
33
|
-
</h1>
|
34
|
-
|
35
|
-
{% include "unfold/helpers/messages.html" %}
|
36
|
-
|
37
|
-
{% if form.errors or form.non_field_errors %}
|
38
|
-
<div class="flex flex-col gap-4 mb-8 *:mb-0">
|
39
|
-
{% include "unfold/helpers/messages/errornote.html" with errors=form.errors %}
|
40
|
-
|
41
|
-
{% include "unfold/helpers/messages/error.html" with errors=form.non_field_errors %}
|
42
|
-
|
43
|
-
{% if user.is_authenticated %}
|
44
|
-
{% blocktranslate trimmed asvar message %}
|
45
|
-
You are authenticated as {{ username }}, but are not authorized to
|
46
|
-
access this page. Would you like to login to a different account?
|
47
|
-
{% endblocktranslate %}
|
48
|
-
|
49
|
-
{% include "unfold/helpers/messages/error.html" with error=message %}
|
50
|
-
{% endif %}
|
51
|
-
</div>
|
52
|
-
{% endif %}
|
53
|
-
|
54
|
-
{% block login_before %}{% endblock %}
|
55
|
-
|
56
|
-
<form action="{{ app_path }}" method="post" id="login-form">
|
57
|
-
{% csrf_token %}
|
58
|
-
|
59
|
-
{% include "unfold/helpers/field.html" with field=form.username %}
|
60
|
-
|
61
|
-
{% include "unfold/helpers/field.html" with field=form.password %}
|
62
|
-
|
63
|
-
{% url 'admin_password_reset' as password_reset_url %}
|
64
|
-
|
65
|
-
<div class="submit-row">
|
66
|
-
<button type="submit" class="bg-primary-600 border border-transparent cursor-pointer flex flex-row font-semibold group items-center justify-center py-2 rounded-default text-sm text-white w-full">
|
67
|
-
{% translate 'Log in' %}
|
68
|
-
|
69
|
-
<span class="material-symbols-outlined ml-2 relative right-0 text-base transition-all group-hover:-right-1">arrow_forward</span>
|
70
|
-
</button>
|
71
|
-
</div>
|
72
|
-
|
73
|
-
{% if password_reset_url %}
|
74
|
-
<div class="password-reset-link">
|
75
|
-
<a href="{{ password_reset_url }}" class="border border-base-200 font-medium hidden mt-4 px-3 py-2 rounded-default text-center text-sm text-base-500 transition-all w-full hover:bg-base-50 lg:block lg:w-auto dark:border-base-700 dark:text-font-default-dark dark:hover:text-base-200 dark:hover:bg-base-900">
|
76
|
-
{% translate 'Forgotten your password or username?' %}
|
77
|
-
</a>
|
78
|
-
</div>
|
79
|
-
{% endif %}
|
80
|
-
</form>
|
81
|
-
|
82
|
-
{% block login_after %}{% endblock %}
|
83
|
-
</div>
|
84
|
-
|
85
|
-
<div class="absolute flex flex-row items-center justify-between left-0 m-4 right-0 top-0">
|
86
|
-
{% if site_url %}
|
87
|
-
<a href="{{ site_url }}" class="flex font-medium items-center text-sm text-primary-600 dark:text-primary-500">
|
88
|
-
<span class="material-symbols-outlined mr-2">arrow_back</span> {% trans 'Return to site' %}
|
89
|
-
</a>
|
90
|
-
{% endif %}
|
91
|
-
|
92
|
-
{% if not theme %}
|
93
|
-
<div class="ml-auto">
|
94
|
-
{% include "unfold/helpers/theme_switch.html" %}
|
95
|
-
</div>
|
96
|
-
{% endif %}
|
97
|
-
</div>
|
53
|
+
{% if password_reset_url or unfold_password_reset_url %}
|
54
|
+
{% component "unfold/components/button.html" with href=password_reset_url|default:unfold_password_reset_url variant="secondary" class="password-reset-link w-full" %}
|
55
|
+
{% translate 'Forgotten your password or username?' %}
|
56
|
+
{% endcomponent %}
|
57
|
+
{% endif %}
|
98
58
|
</div>
|
59
|
+
</form>
|
99
60
|
|
100
|
-
|
101
|
-
<div class="bg-cover grow hidden max-w-3xl xl:max-w-4xl xl:block" style="background-image: url('{{ image }}')">
|
102
|
-
</div>
|
103
|
-
{% endif %}
|
104
|
-
</div>
|
61
|
+
{% block login_after %}{% endblock %}
|
105
62
|
{% endblock %}
|
@@ -2,13 +2,22 @@
|
|
2
2
|
|
3
3
|
{% if cl.search_fields %}
|
4
4
|
<div id="toolbar">
|
5
|
-
<form id="changelist-search" method="get" role="search">
|
6
|
-
<div class="bg-white border border-base-200 flex rounded-default
|
7
|
-
<
|
8
|
-
|
9
|
-
<button type="submit" class="flex items-center px-2 focus:outline-hidden" id="searchbar-submit">
|
5
|
+
<form id="changelist-search" method="get" role="search" x-data="searchForm()">
|
6
|
+
<div class="bg-white border border-base-200 flex flex-row items-center px-3 rounded-default relative shadow-xs w-full focus-within:outline-2 focus-within:-outline-offset-2 focus-within:outline-primary-600 lg:w-96 dark:bg-base-900 dark:border-base-700">
|
7
|
+
<button type="submit" class="flex items-center focus:outline-hidden" id="searchbar-submit">
|
10
8
|
<span class="material-symbols-outlined md-18 text-base-400 dark:text-base-500">search</span>
|
11
9
|
</button>
|
10
|
+
|
11
|
+
<input type="text"
|
12
|
+
x-ref="searchInput"
|
13
|
+
x-on:keydown.window="applyShortcut($event)"
|
14
|
+
class="grow font-medium min-w-0 overflow-hidden p-2 placeholder-font-subtle-light truncate focus:outline-hidden dark:bg-base-900 dark:placeholder-font-subtle-dark dark:text-font-default-dark"
|
15
|
+
name="{{ search_var }}"
|
16
|
+
value="{{ cl.query }}"
|
17
|
+
id="searchbar"
|
18
|
+
placeholder="{% if cl.search_help_text %}{{ cl.search_help_text }}{% else %}{% trans "Type to search" %}{% endif %}" />
|
19
|
+
|
20
|
+
{% include "unfold/helpers/shortcut.html" with shortcut="/" %}
|
12
21
|
</div>
|
13
22
|
|
14
23
|
{% for pair in cl.filter_params.items %}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{% load i18n admin_urls %}
|
2
2
|
|
3
3
|
<div {% if not is_popup %}id="submit-row"{% endif %} class="relative lg:sticky lg:bottom-0 z-40">
|
4
|
-
<div class="backdrop-blur-xs bg-white/80 rounded-b-default pb-4 px-4 dark:bg-base-900/80
|
4
|
+
<div class="backdrop-blur-xs bg-white/80 rounded-b-default pb-4 px-4 dark:bg-base-900/80 lg:border-t lg:border-base-200 relative lg:scrollable-top lg:py-0 dark:border-base-800">
|
5
5
|
<div class="flex flex-col-reverse gap-3 items-center mx-auto lg:flex-row-reverse container lg:h-[64px]">
|
6
6
|
{% block submit-row %}
|
7
7
|
{% if show_save %}
|
@@ -1,4 +1,13 @@
|
|
1
1
|
<{% if href %}a href="{{ href }}"{% else %}button{% endif%} {% if submit %}type="submit"{% endif%} {% if name %}name="{{ name }}"{% endif %}
|
2
|
-
class="
|
2
|
+
class="font-medium flex group items-center gap-2 px-3 py-2 rounded-default justify-center whitespace-nowrap {% if attrs.disabled %}cursor-not-allowed opacity-50{% else %}cursor-pointer{% endif %}
|
3
|
+
{% if variant == "default" %}
|
4
|
+
border border-base-200 bg-white text-font-important-light dark:border-base-700 dark:bg-transparent dark:text-font-important-dark
|
5
|
+
{% elif variant == "secondary" %}
|
6
|
+
bg-gray-100 border border-transparent dark:bg-base-800
|
7
|
+
{% elif variant == "ghost" %}
|
8
|
+
bg-transparent text-font-important-light dark:text-font-important-dark
|
9
|
+
{% else %}
|
10
|
+
border border-base-200 bg-primary-600 border-transparent text-white
|
11
|
+
{% endif %}{% if class %} {{ class }}{% endif %}" {% include "unfold/helpers/attrs.html" %}>
|
3
12
|
{{ children }}
|
4
13
|
</{% if href %}a{% else %}button{% endif%}>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
</h2>
|
6
6
|
{% endif %}
|
7
7
|
|
8
|
-
<
|
8
|
+
<div class="grow relative {% if icon %} pl-6{% endif %}">
|
9
9
|
{{ children }}
|
10
10
|
|
11
11
|
{% if label %}
|
@@ -17,11 +17,11 @@
|
|
17
17
|
{% if icon %}
|
18
18
|
<span class="material-symbols-outlined absolute -left-6 text-base-300 top-1/2 -translate-x-1/3 -translate-y-1/2 text-6xl! dark:text-base-500">{{ icon }}</span>
|
19
19
|
{% endif %}
|
20
|
-
</
|
20
|
+
</div>
|
21
21
|
|
22
22
|
{% if footer %}
|
23
|
-
<
|
23
|
+
<div class="border-t border-base-200 flex items-center -mb-6 -mx-6 mt-6 pb-2 pt-2 px-6 text-sm dark:border-base-800">
|
24
24
|
{{ footer }}
|
25
|
-
</
|
25
|
+
</div>
|
26
26
|
{% endif %}
|
27
27
|
</{% if href %}a{% else %}div{% endif %}>
|
@@ -10,7 +10,9 @@
|
|
10
10
|
|
11
11
|
{% if add_url %}
|
12
12
|
<div class="flex flex-row items-center">
|
13
|
-
|
13
|
+
{% if not hide_separator %}
|
14
|
+
<span class="block bg-base-200 h-5 mx-4 w-px dark:bg-base-700"></span>
|
15
|
+
{% endif %}
|
14
16
|
|
15
17
|
<a href="{% add_preserved_filters add_url is_popup to_field %}" class="addlink bg-primary-600 flex items-center h-9 justify-center -my-1 rounded-full w-9" title="{{ title }}">
|
16
18
|
<span class="material-symbols-outlined text-white">add</span>
|
@@ -57,7 +57,7 @@
|
|
57
57
|
{% endfor %}
|
58
58
|
</div>
|
59
59
|
|
60
|
-
{% if sidebar_show_all_applications %}
|
60
|
+
{% if sidebar_show_all_applications and app_list|length > 0 %}
|
61
61
|
<div class="mt-auto" x-data="{ openAllApplications: false }">
|
62
62
|
<a class="cursor-pointer flex items-center h-[64px] px-6 py-3 text-sm dark:text-font-default-dark hover:text-primary-600 dark:hover:text-primary-500" x-on:click="openAllApplications = !openAllApplications">
|
63
63
|
<span class="material-symbols-outlined md-18 mr-3">
|
@@ -95,5 +95,8 @@
|
|
95
95
|
</div>
|
96
96
|
{% endif %}
|
97
97
|
{% else %}
|
98
|
-
<p>
|
98
|
+
<p>
|
99
|
+
{% trans "You don’t have permission to view or edit anything." as error_message %}
|
100
|
+
{% include "unfold/helpers/messages/error.html" with error=error_message %}
|
101
|
+
</p>
|
99
102
|
{% endif %}
|
@@ -56,6 +56,7 @@
|
|
56
56
|
{% endfor %}
|
57
57
|
{% else %}
|
58
58
|
<p>
|
59
|
-
{%
|
59
|
+
{% trans "You don’t have permission to view or edit anything." as error_message %}
|
60
|
+
{% include "unfold/helpers/messages/error.html" with error=error_message %}
|
60
61
|
</p>
|
61
62
|
{% endif %}
|
@@ -13,10 +13,12 @@
|
|
13
13
|
{% include "unfold/helpers/help_text.html" with help_text=field.help_text %}
|
14
14
|
</div>
|
15
15
|
{% else %}
|
16
|
-
<div class="{% if field.errors %}errors {% endif %}flex flex-col
|
17
|
-
|
16
|
+
<div class="{% if field.errors %}errors {% endif %}flex flex-col group mb-5 last:mb-4">
|
17
|
+
<div class="flex flex-col gap-2">
|
18
|
+
{% include "unfold/helpers/form_label.html" with field=field %}
|
18
19
|
|
19
|
-
|
20
|
+
{{ field }}
|
21
|
+
</div>
|
20
22
|
|
21
23
|
{% include "unfold/helpers/form_errors.html" with errors=field.errors %}
|
22
24
|
|
@@ -3,12 +3,12 @@
|
|
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-base-100 flex gap-
|
6
|
+
<ul class="bg-base-100 flex gap-1 mb-6 px-1.5 py-1.5 rounded-default text-font-default-light 2xl:-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-base-700 dark:hover:text-white"
|
9
|
+
<a class="block cursor-pointer font-semibold px-2.5 py-2 rounded-default hover:text-base-700 dark:hover:text-white"
|
10
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-font-important-light dark:text-font-important-dark' : ''">
|
11
|
+
x-bind:class="openTab == '{{ forloop.counter0 }}-{{ fieldset.name|slugify }}'{% if forloop.first %} || openTab == null{% endif %} ? 'bg-white text-font-important-light shadow-xs dark:bg-base-900 dark:text-font-important-dark' : ''">
|
12
12
|
{{ fieldset.name }}
|
13
13
|
</a>
|
14
14
|
</li>
|