django-unfold 0.61.0__py3-none-any.whl → 0.63.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.
Files changed (36) hide show
  1. {django_unfold-0.61.0.dist-info → django_unfold-0.63.0.dist-info}/METADATA +15 -2
  2. {django_unfold-0.61.0.dist-info → django_unfold-0.63.0.dist-info}/RECORD +36 -31
  3. unfold/contrib/constance/__init__.py +0 -0
  4. unfold/contrib/constance/apps.py +6 -0
  5. unfold/contrib/constance/settings.py +32 -0
  6. unfold/contrib/constance/templates/admin/constance/change_list.html +70 -0
  7. unfold/contrib/constance/templates/admin/constance/includes/results_list.html +71 -0
  8. unfold/contrib/forms/widgets.py +12 -1
  9. unfold/fields.py +1 -1
  10. unfold/static/admin/js/inlines.js +42 -17
  11. unfold/static/unfold/css/styles.css +2 -2
  12. unfold/static/unfold/js/select2.init.js +4 -0
  13. unfold/styles.css +5 -6
  14. unfold/templates/admin/base.html +1 -1
  15. unfold/templates/admin/change_form.html +12 -6
  16. unfold/templates/admin/change_list_results.html +2 -2
  17. unfold/templates/admin/edit_inline/stacked.html +2 -2
  18. unfold/templates/admin/edit_inline/tabular.html +2 -2
  19. unfold/templates/admin/includes/fieldset.html +1 -1
  20. unfold/templates/admin/login.html +1 -1
  21. unfold/templates/registration/logged_out.html +12 -7
  22. unfold/templates/unfold/helpers/fieldsets_tabs.html +1 -1
  23. unfold/templates/unfold/helpers/navigation_header.html +2 -2
  24. unfold/templates/unfold/helpers/pagination_inline.html +28 -20
  25. unfold/templates/unfold/helpers/search.html +1 -1
  26. unfold/templates/unfold/helpers/submit.html +1 -1
  27. unfold/templates/unfold/helpers/tab_actions.html +1 -1
  28. unfold/templates/unfold/helpers/tab_list.html +1 -1
  29. unfold/templates/unfold/helpers/unauthenticated_header.html +2 -2
  30. unfold/templates/unfold/helpers/unauthenticated_title.html +1 -1
  31. unfold/templates/unfold/widgets/related_widget_wrapper.html +4 -4
  32. unfold/templates/unfold/widgets/text.html +1 -1
  33. unfold/templatetags/unfold.py +0 -1
  34. unfold/widgets.py +6 -1
  35. {django_unfold-0.61.0.dist-info → django_unfold-0.63.0.dist-info}/LICENSE.md +0 -0
  36. {django_unfold-0.61.0.dist-info → django_unfold-0.63.0.dist-info}/WHEEL +0 -0
@@ -8,6 +8,10 @@
8
8
  return;
9
9
  }
10
10
 
11
+ if ($(element).hasClass("select2-hidden-accessible")) {
12
+ return;
13
+ }
14
+
11
15
  $(element).select2();
12
16
  });
13
17
 
unfold/styles.css CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  }
11
11
 
12
- @source inline("h-3 w-3 h-[64px] w-[65px]! left-[65px] dark:hover:bg-white/[.06] translate-x-1/4 -translate-y-1/4");
12
+ @source inline("bg-white/[.06] border-white/40 h-3 w-3 h-[64px] w-[65px]! left-[65px] {dark:,}text-base-{50,{100..900},950} dark:hover:bg-white/[.06] translate-x-1/4 -translate-y-1/4");
13
13
  @source inline("{-,}{top,bottom,left,right}-{0..6}");
14
14
  @source inline("rounded rounded-{t,r,b,l} rounded-{t,r,b,l}-default");
15
15
  @source inline("{md:,lg:,2xl:,}relative {md:,lg:,2xl:,}flex {md:,lg:,2xl:,}absolute {md:,lg:,2xl:,}sticky");
@@ -35,8 +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
+ --shadow-raised: 0 2px 12px rgb(var(--color-base-300));
39
+ --shadow-raised-dark: 0 2px 12px rgb(var(--color-base-700));
40
40
  }
41
41
 
42
42
  @theme inline{
@@ -378,7 +378,7 @@ td .inline-deletelink {
378
378
 
379
379
  .select2-container.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__clear:after,
380
380
  .select2-container.select2-container--admin-autocomplete .select2-selection--single .select2-selection__clear:after {
381
- @apply material-symbols-outlined transition-all content-['close'] text-[18px] ;
381
+ @apply material-symbols-outlined transition-all content-['close\_small'] text-[18px] ;
382
382
  }
383
383
 
384
384
  .select2-container.select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow {
@@ -446,9 +446,8 @@ td .inline-deletelink {
446
446
  }
447
447
 
448
448
  .select2-container--admin-autocomplete .select2-selection--multiple li.select2-selection__choice .select2-selection__choice__remove:after {
449
- @apply h-7 leading-7! material-symbols-outlined;
449
+ @apply content-['close\_small'] h-7 leading-7! material-symbols-outlined;
450
450
 
451
- content: "close";
452
451
  font-size: 14px;
453
452
  }
454
453
 
@@ -38,7 +38,7 @@
38
38
  </div>
39
39
  {% endblock messages %}
40
40
 
41
- <div class="px-4 pb-4 grow">
41
+ <div class="@container px-4 pb-4 grow">
42
42
  <div id="content" class="{% if not cl.model_admin.list_fullwidth %}container{% endif %} mx-auto {% block coltype %}colM{% endblock %}">
43
43
  {% if cl %}
44
44
  {% tab_list "changelist" cl.opts %}
@@ -76,7 +76,7 @@
76
76
 
77
77
  {% block form_top %}{% endblock %}
78
78
 
79
- <div>
79
+ <div class="flex flex-col gap-8">
80
80
  {% if is_popup %}
81
81
  <input type="hidden" name="{{ is_popup_var }}" value="1">
82
82
  {% endif %}
@@ -104,22 +104,28 @@
104
104
 
105
105
  {% block inline_field_sets %}
106
106
  {% for inline_admin_formset in inline_admin_formsets %}
107
- {% include inline_admin_formset.opts.template %}
107
+ {% if request.headers.hx_request %}
108
+ {% if inline_admin_formset.formset.get_pagination_key in request.GET %}
109
+ {% include inline_admin_formset.opts.template %}
110
+ {% endif %}
111
+ {% else %}
112
+ {% include inline_admin_formset.opts.template %}
113
+ {% endif %}
108
114
  {% endfor %}
109
115
  {% endblock %}
110
116
 
111
117
  {% block after_related_objects %}{% endblock %}
112
118
 
113
- {% if adminform.model_admin.change_form_after_template %}
114
- {% include adminform.model_admin.change_form_after_template %}
115
- {% endif %}
116
-
117
119
  {% block admin_change_form_document_ready %}
118
120
  <script id="django-admin-form-add-constants" src="{% static 'admin/js/change_form.js' %}"{% if adminform and add %} data-model-name="{{ opts.model_name }}"{% endif %} async></script>
119
121
  {% endblock %}
120
122
 
121
123
  {% prepopulated_fields_js %}
122
124
  </div>
125
+
126
+ {% if adminform.model_admin.change_form_after_template %}
127
+ {% include adminform.model_admin.change_form_after_template %}
128
+ {% endif %}
123
129
  </form>
124
130
 
125
131
  {% if adminform.model_admin.change_form_outer_after_template %}
@@ -70,7 +70,7 @@
70
70
  </thead>
71
71
 
72
72
  {% for result in results %}
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}">
73
+ <tbody class="block relative lg:table-row-group lg:hover:shadow-raised lg:dark:hover:shadow-raised-dark lg:hover:z-20 {% cycle '' 'bg-base-50 dark:bg-white/[.02]' %}" 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="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">
82
+ <tr class="block border border-base-200 mb-3 relative rounded-default shadow-xs 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" %}"
@@ -4,7 +4,7 @@
4
4
  <fieldset class="module relative {{ inline_admin_formset.classes }}" aria-labelledby="{{ inline_admin_formset.formset.prefix }}-heading">
5
5
  {% if inline_admin_formset.is_collapsible %}<details><summary>{% endif %}
6
6
 
7
- <h2 id="{{ inline_admin_formset.formset.prefix }}-heading" class="inline-heading bg-base-100 font-semibold mb-6 px-4 py-3 rounded-default text-font-important-light 2xl:-mx-4 dark:bg-white/[.02] dark:text-font-important-dark {% if inline_admin_formset.opts.tab %}hidden{% endif %} {% if inline_admin_formset.is_collapsible %} cursor-pointer{% endif %}">
7
+ <h2 id="{{ inline_admin_formset.formset.prefix }}-heading" class="inline-heading bg-base-100 font-semibold mb-6 px-4 py-3 rounded-default text-font-important-light @min-[1570px]:-mx-4 dark:bg-white/[.02] dark:text-font-important-dark {% if inline_admin_formset.opts.tab %}hidden{% endif %} {% if inline_admin_formset.is_collapsible %} cursor-pointer{% endif %}">
8
8
  {% if inline_admin_formset.formset.max_num == 1 %}
9
9
  {{ inline_admin_formset.opts.verbose_name|capfirst }}
10
10
  {% else %}
@@ -17,7 +17,7 @@
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 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 %}>
@@ -7,7 +7,7 @@
7
7
  <fieldset class="module relative {{ inline_admin_formset.classes }} min-w-0" aria-labelledby="{{ inline_admin_formset.formset.prefix }}-heading">
8
8
  {% if inline_admin_formset.is_collapsible %}<details><summary>{% endif %}
9
9
 
10
- <h2 id="{{ inline_admin_formset.formset.prefix }}-heading" class="bg-base-100 border border-transparent 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 inline_admin_formset.opts.tab %}hidden{% endif %} {% if inline_admin_formset.is_collapsible %} cursor-pointer{% endif %}">
10
+ <h2 id="{{ inline_admin_formset.formset.prefix }}-heading" class="bg-base-100 border border-transparent font-semibold mb-6 px-4 py-3 rounded-default text-font-important-light text-sm @min-[1570px]:-mx-4 dark:bg-white/[.02] dark:text-font-important-dark {% if inline_admin_formset.opts.tab %}hidden{% endif %} {% if inline_admin_formset.is_collapsible %} cursor-pointer{% endif %}">
11
11
  {% if inline_admin_formset.formset.max_num == 1 %}
12
12
  {{ inline_admin_formset.opts.verbose_name|capfirst }}
13
13
  {% else %}
@@ -18,7 +18,7 @@
18
18
  {% if inline_admin_formset.is_collapsible %}</summary>{% endif %}
19
19
 
20
20
  {{ inline_admin_formset.formset.non_form_errors }}
21
- <div class="border border-base-200 mb-6 overflow-x-auto rounded-default shadow-xs dark:border-base-800" data-simplebar data-simplebar-auto-hide="false">
21
+ <div class="border border-base-200 overflow-x-auto rounded-default shadow-xs dark:border-base-800" data-simplebar data-simplebar-auto-hide="false">
22
22
  <table class="tabular-table w-full [&>tbody:nth-child(odd)]:bg-base-50 dark:[&>tbody:nth-child(odd)]:bg-white/[.02]" {% if inline_admin_formset.opts.ordering_field %}data-ordering-field="{{ inline_admin_formset.opts.ordering_field }}" x-on:end="sortRecords" x-sort.ghost x-sort:config="{preventOnFilter: false}"{% endif %}>
23
23
  {% include "unfold/helpers/edit_inline/tabular_heading.html" %}
24
24
 
@@ -9,7 +9,7 @@
9
9
  {{ fieldset.name }}
10
10
  </h2>
11
11
  {% else %}
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 %}">
12
+ <h2 class="bg-base-100 font-semibold mb-6 px-4 py-3 rounded-default text-font-important-light text-sm @min-[1570px]:-mx-4 dark:bg-white/[.02] dark:text-font-important-dark {% if fieldset.is_collapsible %}cursor-pointer{% endif %}">
13
13
  {{ fieldset.name }}
14
14
  </h2>
15
15
  {% endif %}
@@ -44,7 +44,7 @@
44
44
 
45
45
  <div class="flex flex-col gap-3 mt-6">
46
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>
47
+ {% translate 'Log in' %} <span class="material-symbols-outlined relative right-0 transition-all group-hover:-right-1 text-sm">arrow_forward</span>
48
48
  {% endcomponent %}
49
49
 
50
50
  {% url 'admin_password_reset' as password_reset_url %}
@@ -1,8 +1,12 @@
1
- {% extends "unfold/layouts/skeleton.html" %}
1
+ {% extends 'unfold/layouts/unauthenticated.html' %}
2
2
 
3
- {% load i18n %}
3
+ {% load i18n unfold %}
4
4
 
5
- {% block base %}
5
+ {% block title %}
6
+ {{ title }} | {{ site_title }}
7
+ {% endblock %}
8
+
9
+ {% block content %}
6
10
  <div id="page" class="bg-white flex min-h-screen dark:bg-base-900 ">
7
11
  <div class="flex grow items-center justify-center mx-auto px-4">
8
12
  <div class="w-full sm:w-96">
@@ -11,12 +15,13 @@
11
15
  </h1>
12
16
 
13
17
  <p class="leading-relaxed mb-10">
14
- {% translate "Thanks for spending some quality time with the web site today." %}
18
+ {% trans "Thanks for spending some quality time with the web site today." %}
15
19
  </p>
16
20
 
17
- <a href="{% url "admin:index" %}" class="bg-primary-600 block border border-transparent font-semibold py-2 rounded-default text-sm text-center text-white w-full">
18
- {% translate "Log in again" %}
19
- </a>
21
+ {% url "admin:index" as login_url %}
22
+ {% component "unfold/components/button.html" with href=login_url variant="primary" class="w-full" %}
23
+ {% trans "Log in again" %} <span class="material-symbols-outlined relative right-0 transition-all group-hover:-right-1 text-sm">arrow_forward</span>
24
+ {% endcomponent %}
20
25
  </div>
21
26
  </div>
22
27
  </div>
@@ -3,7 +3,7 @@
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-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">
6
+ <ul class="bg-base-100 flex gap-1 mb-6 px-1.5 py-1.5 rounded-default text-font-default-light @min-[1570px]:-mx-4 dark:bg-white/[.02] dark:text-font-default-dark">
7
7
  {% for fieldset in tabs %}
8
8
  <li>
9
9
  <a class="block cursor-pointer font-semibold px-2.5 py-2 rounded-default hover:text-base-700 dark:hover:text-white"
@@ -1,10 +1,10 @@
1
1
  {% load unfold %}
2
2
 
3
3
  <div class="border-b border-base-200 flex gap-3 items-center h-[65px] mb-5 dark:border-base-800 px-3 {% element_classes 'navigation_header' %}" {% if site_dropdown %}x-data="{ openDropdown: false }"{% endif %}>
4
- <div class="bg-transparent border border-transparent flex font-semibold gap-3 grow min-w-0 -mx-px h-[54px] items-center px-3 {% if site_dropdown %}cursor-pointer rounded-default transition-all hover:bg-white hover:border-base-200 hover:shadow-xs dark:hover:bg-base-800 dark:hover:border-base-700{% endif %}"
4
+ <div class="bg-transparent flex font-semibold gap-3 grow min-w-0 -mx-px h-[54px] items-center px-3 {% if site_dropdown %}cursor-pointer rounded-default transition-all hover:bg-base-100 dark:hover:bg-white/[.06]{% endif %}"
5
5
  {% if site_dropdown %}
6
6
  x-on:click="openDropdown = !openDropdown"
7
- x-bind:class="{'bg-white border-base-200 shadow-xs dark:bg-base-800 dark:border-base-700': openDropdown, 'bg-transparent border-transparent': !openDropdown}"
7
+ x-bind:class="{'bg-base-100 dark:bg-white/[.06]': openDropdown, 'bg-transparent': !openDropdown}"
8
8
  {% endif %}
9
9
  >
10
10
  {% if site_logo %}
@@ -1,28 +1,36 @@
1
1
  {% load i18n admin_urls unfold %}
2
2
 
3
- {% with page_obj=inline_admin_formset.formset.page has_tab=inline_admin_formset.opts.tab pagination_key=inline_admin_formset.formset.get_pagination_key %}
4
- {% elided_page_range page_obj.paginator page_obj.number as elided_page_range %}
5
- <input type="hidden" name="{{ inline_admin_formset.formset.get_pagination_key }}" value="{{ page_obj.number }}" />
3
+ {% with page_obj=inline_admin_formset.formset.page has_tab=inline_admin_formset.opts.tab pagination_key=inline_admin_formset.formset.get_pagination_key per_page=inline_admin_formset.opts.per_page %}
4
+ {% if pagination_key and per_page %}
5
+ {% elided_page_range page_obj.paginator page_obj.number as elided_page_range %}
6
6
 
7
- {% if page_obj.paginator.count and page_obj.paginator.num_pages > 1%}
8
- <div class="flex items-center gap-2 mb-6">
9
- {% for i in elided_page_range %}
10
- {% if i == page_obj.paginator.ELLIPSIS %}
11
- <span>{{ page_obj.paginator.ELLIPSIS }}</span>
12
- {% elif i == page_obj.number %}
13
- <span class="font-medium text-primary-600">{{ i }}</span>
14
- {% else %}
15
- <a href="?{% querystring_params pagination_key i %}{% if has_tab %}#{{ inline_admin_formset.formset.prefix|slugify }}{% endif %}">
16
- {{ i }}
17
- </a>
18
- {% endif %}
19
- {% endfor %}
7
+ <input type="hidden" name="{{ pagination_key }}" value="{{ page_obj.number }}" />
20
8
 
21
- <div>-</div>
9
+ {% if page_obj.paginator.count and page_obj.paginator.num_pages > 1 %}
10
+ <div class="flex items-center gap-2 mt-6">
11
+ {% for i in elided_page_range %}
12
+ {% if i == page_obj.paginator.ELLIPSIS %}
13
+ <span>{{ page_obj.paginator.ELLIPSIS }}</span>
14
+ {% elif i == page_obj.number %}
15
+ <span class="font-medium text-primary-600">{{ i }}</span>
16
+ {% else %}
17
+ <a class="cursor-pointer"
18
+ hx-get="?{% querystring_params pagination_key i %}{% if has_tab %}#{{ inline_admin_formset.formset.prefix|slugify }}{% endif %}"
19
+ hx-push-url="true"
20
+ hx-swap="outerHTML"
21
+ hx-select="#{{ inline_admin_formset.formset.prefix }}-group"
22
+ hx-target="#{{ inline_admin_formset.formset.prefix }}-group">
23
+ {{ i }}
24
+ </a>
25
+ {% endif %}
26
+ {% endfor %}
22
27
 
23
- <div>
24
- {{ page_obj.paginator.count }} {% if page_obj.paginator.count == 1 %}{{ inline_admin_formset.opts.verbose_name }}{% else %}{{ inline_admin_formset.opts.verbose_name_plural }}{% endif %}
28
+ <div>-</div>
29
+
30
+ <div>
31
+ {{ page_obj.paginator.count }} {% if page_obj.paginator.count == 1 %}{{ inline_admin_formset.opts.verbose_name }}{% else %}{{ inline_admin_formset.opts.verbose_name_plural }}{% endif %}
32
+ </div>
25
33
  </div>
26
- </div>
34
+ {% endif %}
27
35
  {% endif %}
28
36
  {% endwith %}
@@ -12,7 +12,7 @@
12
12
  x-on:focus="openSearchResults = true; currentIndex = 0"
13
13
  x-on:keydown.arrow-down.prevent="nextItem()"
14
14
  x-on:keydown.arrow-up.prevent="prevItem()"
15
- x-on:keydown.escape.prevent="openSearchResults=false"
15
+ x-on:keydown.escape.prevent="openSearchResults = false; if ($refs.searchInput.value === '') { $refs.searchInput.blur() } else { $refs.searchInput.value = '' }"
16
16
  x-on:keydown.enter.prevent="selectItem()"
17
17
  x-on:search="currentIndex = 0"
18
18
  hx-get="{% url "admin:search" %}"
@@ -1,3 +1,3 @@
1
- <button type="submit" {% if name %}name="{{ name}}"{% endif %} class="bg-primary-600 block border border-transparent font-medium px-3 py-2 rounded-default self-end text-sm text-white">
1
+ <button type="submit" {% if name %}name="{{ name}}"{% endif %} class="bg-primary-600 block border border-transparent cursor-pointer font-medium px-3 py-2 rounded-default self-end text-sm text-white">
2
2
  {{ title }}
3
3
  </button>
@@ -1,5 +1,5 @@
1
1
  {% if actions_list or actions_detail or actions_items or nav_global %}
2
- <ul class="flex flex-col font-medium mb-4 ml-auto mt-2 md:flex-row md:mb-2 md:mt-0 max-md:w-full">
2
+ <ul class="flex flex-col font-medium mb-4 ml-auto mt-2 md:flex-row md:mb-0 md:mt-0 max-md:w-full">
3
3
  {% if actions_items %}
4
4
  {{ actions_items }}
5
5
  {% endif %}
@@ -2,7 +2,7 @@
2
2
 
3
3
  {% if not is_popup %}
4
4
  {% if tabs_list or inlines_list or actions_list or actions_detail or actions_items or nav_global %}
5
- <div class="border-base-200 flex items-start flex-col mb-4 md:border-b dark:md:border-base-800 md:border-l-0 md:flex-row md:items-center">
5
+ <div class="border-base-200 flex items-start flex-col mb-4 min-h-13 md:border-b dark:md:border-base-800 md:border-l-0 md:flex-row md:items-center">
6
6
  {% include "unfold/helpers/tab_items.html" %}
7
7
 
8
8
  {% include "unfold/helpers/tab_actions.html" %}
@@ -2,8 +2,8 @@
2
2
 
3
3
  <div class="absolute flex flex-row items-center justify-between left-0 m-4 right-0 top-0">
4
4
  {% if site_url %}
5
- <a href="{{ site_url }}" class="flex font-medium items-center text-sm text-primary-600 dark:text-primary-500">
6
- <span class="material-symbols-outlined mr-2">arrow_back</span> {% trans 'Return to site' %}
5
+ <a href="{{ site_url }}" class="flex font-medium gap-2 group items-center text-sm text-primary-600 dark:text-primary-500">
6
+ <span class="material-symbols-outlined left-0 relative text-sm transition-all group-hover:-left-1">arrow_back</span> {% trans 'Return to site' %}
7
7
  </a>
8
8
  {% endif %}
9
9
 
@@ -6,6 +6,6 @@
6
6
  <span class="block text-font-important-light dark:text-font-important-dark">{{ subtitle }} </span>
7
7
  {% endif %}
8
8
 
9
- <span class="block text-primary-600 text-xl dark:text-primary-500">{{ title }}</span>
9
+ <span class="block font-semibold text-primary-600 tracking-tight text-xl dark:text-primary-500">{{ title }}</span>
10
10
  </h1>
11
11
  </div>
@@ -9,7 +9,7 @@
9
9
  {% if not is_hidden %}
10
10
  {% if can_add_related or can_change_related or can_delete_related or can_view_related%}
11
11
  {% if can_change_related %}
12
- <a class="related-widget-wrapper-link change-related bg-white border border-base-200 cursor-pointer flex items-center h-[38px] justify-center ml-2 rounded-default shadow-xs shrink-0 text-base-400 text-sm w-[38px] hover:text-base-700 dark:bg-base-900 dark:border-base-700 dark:text-base-500 dark:hover:text-base-200"
12
+ <a class="related-widget-wrapper-link change-related bg-white border border-base-200 cursor-pointer flex items-center h-[38px] justify-center ml-2 rounded-default shadow-xs shrink-0 text-base-400 text-sm w-[38px] hover:text-base-700 dark:bg-base-900 dark:border-base-700 dark:text-base-500 dark:hover:text-base-200 focus:outline-2 focus:-outline-offset-2 focus:outline-primary-600"
13
13
  id="change_id_{{ name }}"
14
14
  data-popup="yes"
15
15
  data-href-template="{{ change_related_template_url }}?{{ url_params }}"
@@ -19,7 +19,7 @@
19
19
  {% endif %}
20
20
 
21
21
  {% if can_add_related %}
22
- <a class="related-widget-wrapper-link add-related bg-white border border-base-200 cursor-pointer flex items-center h-[38px] justify-center ml-2 rounded-default shadow-xs shrink-0 text-base-400 text-sm w-[38px] hover:text-base-700 dark:bg-base-900 dark:border-base-700 dark:text-base-500 dark:hover:text-base-200"
22
+ <a class="related-widget-wrapper-link add-related bg-white border border-base-200 cursor-pointer flex items-center h-[38px] justify-center ml-2 rounded-default shadow-xs shrink-0 text-base-400 text-sm w-[38px] hover:text-base-700 dark:bg-base-900 dark:border-base-700 dark:text-base-500 dark:hover:text-base-200 focus:outline-2 focus:-outline-offset-2 focus:outline-primary-600"
23
23
  data-popup="yes"
24
24
  id="add_id_{{ name }}"
25
25
  href="{{ add_related_url }}?{{ url_params }}"
@@ -29,7 +29,7 @@
29
29
  {% endif %}
30
30
 
31
31
  {% if can_view_related %}
32
- <a class="related-widget-wrapper-link view-related bg-white border border-base-200 cursor-pointer flex items-center h-[38px] justify-center ml-2 rounded-default shadow-xs shrink-0 text-base-400 text-sm w-[38px] hover:text-base-700 dark:bg-base-900 dark:border-base-700 dark:text-base-500 dark:hover:text-base-200"
32
+ <a class="related-widget-wrapper-link view-related bg-white border border-base-200 cursor-pointer flex items-center h-[38px] justify-center ml-2 rounded-default shadow-xs shrink-0 text-base-400 text-sm w-[38px] hover:text-base-700 dark:bg-base-900 dark:border-base-700 dark:text-base-500 dark:hover:text-base-200 focus:outline-2 focus:-outline-offset-2 focus:outline-primary-600"
33
33
  id="view_id_{{ name }}"
34
34
  data-href-template="{{ change_related_template_url }}?{{ view_related_url_params }}"
35
35
  title="{% blocktranslate %}View selected {{ model }}{% endblocktranslate %}">
@@ -38,7 +38,7 @@
38
38
  {% endif %}
39
39
 
40
40
  {% if can_delete_related %}
41
- <a class="related-widget-wrapper-link delete-related bg-white border border-base-200 cursor-pointer flex items-center h-[38px] justify-center ml-2 rounded-default shadow-xs shrink-0 text-red-600 text-sm w-[38px] dark:bg-base-900 dark:border-base-700 dark:text-red-500"
41
+ <a class="related-widget-wrapper-link delete-related bg-white border border-base-200 cursor-pointer flex items-center h-[38px] justify-center ml-2 rounded-default shadow-xs shrink-0 text-red-600 text-sm w-[38px] dark:bg-base-900 dark:border-base-700 dark:text-red-500 focus:outline-2 focus:-outline-offset-2 focus:outline-red-500"
42
42
  id="delete_id_{{ name }}"
43
43
  data-href-template="{{ delete_related_template_url }}?{{ url_params }}"
44
44
  data-popup="yes"
@@ -1,5 +1,5 @@
1
1
 
2
- <div class="max-w-2xl relative">
2
+ <div class="max-w-2xl relative w-full">
3
3
  {% if widget.prefix %}
4
4
  <span class="absolute left-3 top-0 bottom-0 flex items-center justify-center">
5
5
  {{ widget.prefix }}
@@ -359,7 +359,6 @@ def fieldset_rows_classes(context: Context) -> str:
359
359
  [
360
360
  "border",
361
361
  "border-base-200",
362
- "mb-8",
363
362
  "rounded-default",
364
363
  "shadow-xs",
365
364
  "dark:border-base-800",
unfold/widgets.py CHANGED
@@ -244,13 +244,17 @@ RADIO_CLASSES = [
244
244
  SWITCH_CLASSES = [
245
245
  "appearance-none",
246
246
  "bg-base-300",
247
+ "block",
247
248
  "cursor-pointer",
248
249
  "h-5",
249
250
  "relative",
250
251
  "rounded-full",
251
- "transition-all",
252
+ "transition-colors",
252
253
  "w-8",
253
254
  "min-w-8",
255
+ "focus:outline-2",
256
+ "focus:outline-offset-2",
257
+ "focus:outline-primary-600",
254
258
  "after:absolute",
255
259
  "after:bg-white",
256
260
  "after:content-['']",
@@ -258,6 +262,7 @@ SWITCH_CLASSES = [
258
262
  "after:h-3",
259
263
  "after:rounded-full",
260
264
  "after:shadow-xs",
265
+ "after:transition-all",
261
266
  "after:left-1",
262
267
  "after:top-1",
263
268
  "after:w-3",