django-unfold 0.60.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.60.0.dist-info → django_unfold-0.61.0.dist-info}/METADATA +15 -6
- {django_unfold-0.60.0.dist-info → django_unfold-0.61.0.dist-info}/RECORD +40 -37
- unfold/admin.py +1 -1
- unfold/contrib/import_export/templates/admin/import_export/change_list_import.html +5 -0
- unfold/contrib/simple_history/templates/simple_history/submit_line.html +16 -18
- unfold/forms.py +2 -2
- unfold/mixins/base_model_admin.py +7 -2
- unfold/sites.py +15 -2
- unfold/static/unfold/css/styles.css +1 -1
- unfold/static/unfold/js/app.js +61 -0
- unfold/styles.css +3 -5
- 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 +8 -2
- unfold/templates/admin/edit_inline/tabular.html +2 -2
- unfold/templates/admin/includes/fieldset.html +9 -3
- unfold/templates/admin/search_form.html +14 -5
- unfold/templates/admin/submit_line.html +1 -1
- unfold/templates/unfold/components/card.html +4 -4
- unfold/templates/unfold/helpers/add_link.html +3 -1
- 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/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_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 +3 -3
- unfold/templatetags/unfold_list.py +4 -1
- unfold/widgets.py +2 -1
- {django_unfold-0.60.0.dist-info → django_unfold-0.61.0.dist-info}/LICENSE.md +0 -0
- {django_unfold-0.60.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{
|
@@ -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
|
|
@@ -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
|
|
@@ -26,6 +26,12 @@
|
|
26
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
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>
|
@@ -99,8 +105,8 @@
|
|
99
105
|
{% endfor %}
|
100
106
|
</div>
|
101
107
|
|
108
|
+
{% include "unfold/helpers/pagination_inline.html" %}
|
109
|
+
|
102
110
|
{% if inline_admin_formset.is_collapsible %}</details>{% endif %}
|
103
111
|
</fieldset>
|
104
|
-
|
105
|
-
{% include "unfold/helpers/pagination_inline.html" %}
|
106
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="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">
|
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>
|
@@ -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 %}
|
@@ -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>
|
@@ -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>
|
@@ -2,13 +2,13 @@
|
|
2
2
|
<ul class="flex flex-col gap-4 mb-8">
|
3
3
|
{% for message in messages %}
|
4
4
|
<li class="*:mb-0!">
|
5
|
-
{% if message.
|
5
|
+
{% if message.level == DEFAULT_MESSAGE_LEVELS.INFO %}
|
6
6
|
{% include "unfold/helpers/messages/info.html" with message=message %}
|
7
|
-
{% elif message.
|
7
|
+
{% elif message.level == DEFAULT_MESSAGE_LEVELS.SUCCESS %}
|
8
8
|
{% include "unfold/helpers/messages/success.html" with message=message %}
|
9
|
-
{% elif message.
|
9
|
+
{% elif message.level == DEFAULT_MESSAGE_LEVELS.WARNING %}
|
10
10
|
{% include "unfold/helpers/messages/warning.html" with message=message %}
|
11
|
-
{% elif message.
|
11
|
+
{% elif message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
|
12
12
|
{% include "unfold/helpers/messages/error.html" with message=message %}
|
13
13
|
{% else %}
|
14
14
|
{% include "unfold/helpers/messages/debug.html" with message=message %}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{% load admin_list unfold %}
|
2
2
|
|
3
3
|
{% if cl %}
|
4
|
-
<div
|
4
|
+
<div class="px-4 lg:backdrop-blur-xs lg:bg-white/80 lg:flex lg:items-center lg:dark:bg-base-900/80 lg:left-0 lg:right-0 lg:bottom-0 lg:sticky relative z-40 lg:border-t lg:border-base-200 lg:relative lg:scrollable-top lg:dark:border-base-800 {% element_classes 'pagination' %}">
|
5
5
|
{% pagination cl %}
|
6
6
|
</div>
|
7
7
|
{% endif %}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{% load i18n admin_urls unfold %}
|
2
|
+
|
3
|
+
{% if is_popup %}
|
4
|
+
<div class="flex flex-row items-center">
|
5
|
+
<h1 class="font-semibold overflow-hidden my-6 text-ellipsis whitespace-nowrap text-base text-font-important-light dark:text-font-important-dark">
|
6
|
+
<span class="tracking-tight">
|
7
|
+
{{ pretitle }}
|
8
|
+
|
9
|
+
{{ content_title }}
|
10
|
+
</span>
|
11
|
+
|
12
|
+
{% if cl and cl.full_result_count != cl.result_count and cl.paginator|class_name != "InfinitePaginator" %}
|
13
|
+
<span class="font-medium ml-2 text-font-subtle-light text-sm dark:text-font-subtle-dark">
|
14
|
+
{% blocktranslate count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktranslate %} (<a href="?{% if cl.is_popup %}_popup=1{% endif %}">{% if cl.show_full_result_count %}{% blocktranslate with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktranslate %}{% else %}{% translate "Show all" %}{% endif %}</a>)
|
15
|
+
</span>
|
16
|
+
{% endif %}
|
17
|
+
|
18
|
+
{% if content_subtitle %}
|
19
|
+
{{ content_subtitle }}
|
20
|
+
{% endif %}
|
21
|
+
</h1>
|
22
|
+
|
23
|
+
<div class="ml-auto">
|
24
|
+
{% include "unfold/helpers/add_link.html" with hide_separator=True %}
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
{% endif %}
|
@@ -1,24 +1,28 @@
|
|
1
1
|
{% load i18n %}
|
2
2
|
|
3
3
|
{% if sidebar_show_search %}
|
4
|
-
<div class="mb-2.5 mx-3 relative" x-data="
|
5
|
-
<div class="bg-white border border-base-200 flex items-center
|
6
|
-
<span class="material-symbols-outlined md-18
|
4
|
+
<div class="mb-2.5 mx-3 relative" x-data="searchDropdown()" x-on:keydown.window="applyShortcut($event)" x-on:click.outside="openSearchResults = false">
|
5
|
+
<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 dark:bg-base-900 dark:border-base-700">
|
6
|
+
<span class="material-symbols-outlined md-18 text-base-400">manage_search</span>
|
7
7
|
|
8
8
|
<input type="search"
|
9
9
|
id="nav-filter"
|
10
10
|
name="s"
|
11
|
-
x-
|
12
|
-
x-on:focus="openSearchResults=true"
|
11
|
+
x-ref="searchInput"
|
12
|
+
x-on:focus="openSearchResults = true; currentIndex = 0"
|
13
|
+
x-on:keydown.arrow-down.prevent="nextItem()"
|
14
|
+
x-on:keydown.arrow-up.prevent="prevItem()"
|
15
|
+
x-on:keydown.escape.prevent="openSearchResults=false"
|
16
|
+
x-on:keydown.enter.prevent="selectItem()"
|
17
|
+
x-on:search="currentIndex = 0"
|
13
18
|
hx-get="{% url "admin:search" %}"
|
14
|
-
hx-trigger="keyup changed delay:500ms
|
19
|
+
hx-trigger="keyup changed delay:500ms"
|
15
20
|
hx-target="#search-results"
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
</div>
|
21
|
+
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"
|
22
|
+
placeholder="{% translate 'Search apps and models...' %}"
|
23
|
+
aria-label="{% translate 'Filter navigation items' %}">
|
24
|
+
|
25
|
+
{% include "unfold/helpers/shortcut.html" with shortcut="t" %}
|
22
26
|
</div>
|
23
27
|
|
24
28
|
<div id="search-results" x-show="openSearchResults"></div>
|
@@ -1,13 +1,14 @@
|
|
1
1
|
{% if results %}
|
2
|
-
<ul class="absolute bg-white border border-base-200 left-0 mt-12 right-0 rounded-default top-0 shadow-xs text-sm z-10 dark:bg-base-800 dark:border-base-700">
|
3
|
-
{% for
|
4
|
-
|
5
|
-
<
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
2
|
+
<ul class="absolute bg-white border border-base-200 flex flex-col leading-none left-0 mt-12 py-1 right-0 rounded-default top-0 shadow-xs text-sm z-10 dark:bg-base-800 dark:border-base-700">
|
3
|
+
{% for item in results %}
|
4
|
+
<li class="mx-1">
|
5
|
+
<a href="{{ item.model.admin_url }}"
|
6
|
+
class="block items-center px-3 py-2 rounded-default truncate"
|
7
|
+
x-on:mouseenter="currentIndex = {{ forloop.counter }}"
|
8
|
+
x-bind:class="{'bg-base-100 text-base-700 dark:bg-base-700 dark:text-base-200': currentIndex === {{ forloop.counter }}}">
|
9
|
+
{{ item.app.name }} <span class="text-font-subtle-light mx-1 dark:text-font-subtle-dark">/</span> {{ item.model.name }}
|
10
|
+
</a>
|
11
|
+
</li>
|
11
12
|
{% endfor %}
|
12
13
|
</ul>
|
13
14
|
{% endif %}
|
@@ -1,11 +1,12 @@
|
|
1
1
|
{% load unfold %}
|
2
2
|
|
3
|
-
<li class="{% action_item_classes action %}" {% if not link %}x-data="{actionDropdownOpen: false}" x-ref="actionDropdown{{ action.method_name }}"{% endif %}>
|
3
|
+
<li class="{% action_item_classes action %}" {% if not link and action.items|length > 0 %}x-data="{actionDropdownOpen: false}" x-ref="actionDropdown{{ action.method_name }}"{% endif %}>
|
4
4
|
<a {% if link %}href="{{ link }}"{% endif %}class="cursor-pointer flex grow items-center gap-2 px-3 py-2 text-left whitespace-nowrap" {% if blank %} target="_blank"{% endif %} {% include "unfold/helpers/attrs.html" with attrs=action.attrs %}
|
5
5
|
{% if not link %}
|
6
6
|
x-on:click="actionDropdownOpen = !actionDropdownOpen"
|
7
7
|
x-bind:class="{'{% if action.variant.value == "default" %}text-primary-600 dark:text-primary-500{% endif %}': actionDropdownOpen }"
|
8
8
|
{% endif %}>
|
9
|
+
|
9
10
|
{% if action.icon %}
|
10
11
|
<span class="material-symbols-outlined">
|
11
12
|
{{ action.icon }}
|
@@ -14,7 +15,7 @@
|
|
14
15
|
|
15
16
|
{{ title }}
|
16
17
|
|
17
|
-
{% if not link %}
|
18
|
+
{% if not link and action.items|length > 0 %}
|
18
19
|
<span class="border-l border-base-200 flex items-center select-none self-stretch ml-auto -mr-1 -my-2 pl-2
|
19
20
|
{% if action.variant.value == "primary" %}
|
20
21
|
border-primary-700 dark:border-primary-500
|
@@ -36,7 +37,7 @@
|
|
36
37
|
{% endif %}
|
37
38
|
</a>
|
38
39
|
|
39
|
-
{% if not link %}
|
40
|
+
{% if not link and action.items|length > 0 %}
|
40
41
|
<template x-teleport="body">
|
41
42
|
<nav x-anchor.bottom-end.offset.4="$refs.actionDropdown{{ action.method_name }}" class="absolute bg-white border border-base-200 flex flex-col -mr-px py-1 right-0 rounded-default shadow-lg top-10 w-52 z-50 dark:bg-base-800 dark:border-base-700" x-transition x-show="actionDropdownOpen" x-on:click.outside="actionDropdownOpen = false">
|
42
43
|
{% for item in action.items %}
|
@@ -3,21 +3,23 @@
|
|
3
3
|
{% if field.is_hidden %}
|
4
4
|
{{ field }}
|
5
5
|
{% else %}
|
6
|
-
<{% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" class="group {% if tag == "td" %}align-top border-t border-base-200 font-normal gap-4 min-w-0 overflow-hidden px-3 py-3 text-left dark:border-base-800 dark:before:text-font-important-dark {% if form_show_labels and forloop.parentloop.first %}border-t-0{% endif %}{% endif %} {% if field.errors %}errors{% endif %} {% if field_class %} {{ field_class }}{% endif %} {% if field|is_checkbox and tag == "td" %}flex flex-row gap-2 items-center{% else %}{% if 'form-horizontal' in form_class %} row{% endif %}{% endif %}{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
|
6
|
+
<{% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" class="group {% if tag == "td" %}align-top border-t border-base-200 font-normal gap-4 min-w-0 overflow-hidden px-3 py-3 text-left dark:border-base-800 dark:before:text-font-important-dark {% if form_show_labels and forloop.parentloop.first %}border-t-0{% endif %}{% endif %} {% if field.errors %}errors{% endif %} {% if field_class %} {{ field_class }}{% endif %} {% if field|is_checkbox and tag == "td" %}flex flex-row gap-2 items-center{% else %} {% if 'form-horizontal' in form_class %} border-b border-base-200 border-dashed flex flex-col -mx-3 px-3 py-2.5 lg:flex-row last:-mb-3 dark:border-base-800 last:border-b-0 {% endif %}{% endif %}{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
|
7
7
|
{% if field.label and not field|is_checkbox and form_show_labels %}
|
8
|
-
<label {% if field.id_for_label %}for="{{ field.id_for_label }}"{% endif %} class="block font-semibold
|
8
|
+
<label {% if field.id_for_label %}for="{{ field.id_for_label }}"{% endif %} class="block font-semibold text-font-important-light dark:text-font-important-dark {% if 'form-horizontal' in form_class %}mb-2 lg:mb-0 lg:min-w-56 {% if not field|is_checkbox and not field|is_radioselect and not field|is_checkboxselectmultiple %}lg:mt-2{% endif %} lg:w-56{% else %}mb-2{% endif %} {% if label_class %} {{ label_class }}{% endif %}">
|
9
9
|
{{ field.label }}{% if field.field.required %} <span class="asteriskField">*</span>{% endif %}
|
10
10
|
</label>
|
11
11
|
{% endif %}
|
12
12
|
|
13
|
-
|
14
|
-
{%
|
15
|
-
|
16
|
-
{%
|
17
|
-
|
18
|
-
{%
|
13
|
+
<div class="grow">
|
14
|
+
{% if field|is_checkboxselectmultiple or field|is_radioselect %}
|
15
|
+
{% include 'unfold_crispy/layout/radio_checkbox_select.html' %}
|
16
|
+
{% elif field|is_checkbox %}
|
17
|
+
{% include 'unfold_crispy/layout/checkbox.html' %}
|
18
|
+
{% else %}
|
19
|
+
{% crispy_field field %}
|
19
20
|
|
20
|
-
|
21
|
-
|
21
|
+
{% include 'unfold_crispy/layout/help_text_and_errors.html' %}
|
22
|
+
{% endif %}
|
23
|
+
</div>
|
22
24
|
</{% if tag %}{{ tag }}{% else %}div{% endif %}>
|
23
25
|
{% endif %}
|
@@ -1,11 +1,27 @@
|
|
1
1
|
{% load crispy_forms_field unfold %}
|
2
2
|
|
3
3
|
{% if form_show_labels %}
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
{% if 'form-horizontal' in form_class %}
|
5
|
+
<div class="flex flex-col min-h-[38px] lg:flex-row lg:gap-3 lg:items-center">
|
6
|
+
<div class="flex flex-row max-lg:flex-row-reverse max-lg:justify-end gap-3 lg:items-center lg:gap-0 lg:justify-start">
|
7
|
+
<label for="{{ field.id_for_label }}" class="flex flex-row font-semibold gap-3 items-center text-base-900 lg:min-w-56 lg:w-56 dark:text-base-100 {% if tag == "td" %}mt-9{% endif %}">
|
8
|
+
<span>{{ field.label }}{% if field.field.required %} <span class="asteriskField">*</span>{% endif %}</span>
|
9
|
+
</label>
|
7
10
|
|
8
|
-
|
11
|
+
{% crispy_field field 'class' form_classes.switch %}
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="">
|
15
|
+
{% include 'unfold_crispy/layout/help_text_and_errors.html' %}
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
{% else %}
|
19
|
+
<label for="{{ field.id_for_label }}" class="flex flex-row font-semibold gap-3 items-center text-base-900 dark:text-base-100 {% if tag == "td" %}mt-9{% endif %}">
|
20
|
+
{% crispy_field field 'class' form_classes.switch %} <span>{{ field.label }}{% if field.field.required %} <span class="asteriskField">*</span>{% endif %}</span>
|
21
|
+
</label>
|
22
|
+
|
23
|
+
{% include 'unfold_crispy/layout/help_text_and_errors.html' %}
|
24
|
+
{% endif %}
|
9
25
|
{% else %}
|
10
26
|
{% with field=field|add_css_class:form_classes.switch %}
|
11
27
|
{% if tag == "td" %}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
<fieldset {% if fieldset.css_id %}id="{{ fieldset.css_id }}"{% endif %} class="fieldset group flex flex-col
|
1
|
+
<fieldset {% if fieldset.css_id %}id="{{ fieldset.css_id }}"{% endif %} class="fieldset group flex flex-col grow rounded-default border-base-200 shadow-xs aligned border p-3 relative dark:border-base-800 {% if fieldset.css_class %} {{ fieldset.css_class }}{% endif %}" {{ fieldset.flat_attrs }}>
|
2
2
|
{% if legend %}
|
3
|
-
<legend class="border-b border-base-200 font-semibold float-left
|
3
|
+
<legend class="border-b border-base-200 font-semibold float-left {% if 'form-horizontal' not in form_class %}mb-5{% endif %} -mx-3 pb-3 px-3 text-[15px] text-font-important-light dark:text-font-important-dark dark:border-base-800">
|
4
4
|
{{ legend|safe }}
|
5
5
|
</legend>
|
6
6
|
{% endif %}
|
7
7
|
|
8
|
-
<div class="flex flex-col gap-5">
|
8
|
+
<div class="flex flex-col {% if 'form-horizontal' not in form_class %} gap-5{% endif %}">
|
9
9
|
{{ fields|safe }}
|
10
10
|
</div>
|
11
11
|
</fieldset>
|