django-unfold 0.36.0__py3-none-any.whl → 0.37.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. {django_unfold-0.36.0.dist-info → django_unfold-0.37.0.dist-info}/METADATA +1 -1
  2. {django_unfold-0.36.0.dist-info → django_unfold-0.37.0.dist-info}/RECORD +41 -41
  3. unfold/contrib/forms/widgets.py +1 -0
  4. unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_group.html +1 -1
  5. unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_user.html +1 -1
  6. unfold/contrib/import_export/forms.py +1 -0
  7. unfold/contrib/import_export/templates/admin/import_export/import.html +13 -13
  8. unfold/contrib/import_export/templates/admin/import_export/import_errors.html +2 -2
  9. unfold/contrib/inlines/admin.py +1 -0
  10. unfold/static/unfold/css/styles.css +1 -1
  11. unfold/static/unfold/js/app.js +7 -1
  12. unfold/templates/admin/app_list.html +1 -1
  13. unfold/templates/admin/auth/user/add_form.html +1 -1
  14. unfold/templates/admin/base_site.html +1 -1
  15. unfold/templates/admin/change_form.html +1 -1
  16. unfold/templates/admin/change_list.html +10 -10
  17. unfold/templates/admin/delete_confirmation.html +1 -1
  18. unfold/templates/admin/edit_inline/stacked.html +5 -3
  19. unfold/templates/admin/nav_sidebar.html +1 -1
  20. unfold/templates/admin/search_form.html +1 -1
  21. unfold/templates/registration/password_change_done.html +3 -3
  22. unfold/templates/unfold/change_list_filter.html +12 -12
  23. unfold/templates/unfold/helpers/actions_row.html +14 -14
  24. unfold/templates/unfold/helpers/app_list.html +1 -1
  25. unfold/templates/unfold/helpers/display_header.html +1 -1
  26. unfold/templates/unfold/helpers/fieldset_row.html +2 -2
  27. unfold/templates/unfold/helpers/fieldsets_tabs.html +3 -3
  28. unfold/templates/unfold/helpers/label.html +13 -13
  29. unfold/templates/unfold/helpers/messages.html +11 -11
  30. unfold/templates/unfold/helpers/navigation.html +1 -1
  31. unfold/templates/unfold/helpers/tab_list.html +2 -0
  32. unfold/templates/unfold/layouts/skeleton.html +47 -47
  33. unfold/templates/unfold/widgets/clearable_file_input_small.html +9 -1
  34. unfold/templates/unfold/widgets/foreign_key_raw_id.html +6 -4
  35. unfold/templates/unfold/widgets/radio_option.html +3 -3
  36. unfold/templates/unfold/widgets/range.html +8 -8
  37. unfold/templates/unfold/widgets/related_widget_wrapper.html +6 -6
  38. unfold/templatetags/unfold_list.py +1 -1
  39. unfold/utils.py +6 -1
  40. {django_unfold-0.36.0.dist-info → django_unfold-0.37.0.dist-info}/LICENSE.md +0 -0
  41. {django_unfold-0.36.0.dist-info → django_unfold-0.37.0.dist-info}/WHEEL +0 -0
@@ -22,8 +22,8 @@
22
22
 
23
23
  {% block content %}
24
24
  <div id="content-main">
25
- <p class="bg-primary-100 mb-8 text-primary-600 px-3 py-3 rounded-md text-sm">
26
- {% translate 'Your password was changed.' %}
27
- </p>
25
+ <p class="bg-primary-100 mb-8 text-primary-600 px-3 py-3 rounded-md text-sm">
26
+ {% translate 'Your password was changed.' %}
27
+ </p>
28
28
  </div>
29
29
  {% endblock %}
@@ -3,7 +3,7 @@
3
3
  <div id="changelist-filter" class="backdrop-blur-sm bg-opacity-80 bg-gray-900 flex fixed inset-0 z-50" x-show="filterOpen">
4
4
  <label for="show-filters" id="changelist-filter-close" class="flex-grow"></label>
5
5
 
6
- <div class="bg-white flex mr-4 my-4 overflow-hidden rounded shadow-sm w-96 dark:bg-gray-800" x-on:click.outside="filterOpen = false">
6
+ <div class="bg-white flex mx-4 my-4 overflow-hidden rounded shadow-sm w-96 dark:bg-gray-800" x-on:click.outside="filterOpen = false">
7
7
  <div class="flex-grow h-full overflow-auto relative">
8
8
  <h3 class="border-b flex font-semibold mb-6 px-6 py-4 text-gray-900 text-sm dark:text-gray-100 dark:border-gray-700">
9
9
  {% trans "Filter results" %}
@@ -23,13 +23,13 @@
23
23
  {% if cl.model_admin.list_filter_submit %}
24
24
  <form id="filter-form" method="get">
25
25
 
26
- {% if request.GET.q %}
27
- <input type="hidden" name="q" value="{{ request.GET.q }}">
28
- {% endif %}
26
+ {% if request.GET.q %}
27
+ <input type="hidden" name="q" value="{{ request.GET.q }}">
28
+ {% endif %}
29
29
 
30
- {% if request.GET.o %}
31
- <input type="hidden" name="o" value="{{ request.GET.o }}">
32
- {% endif %}
30
+ {% if request.GET.o %}
31
+ <input type="hidden" name="o" value="{{ request.GET.o }}">
32
+ {% endif %}
33
33
  {% endif %}
34
34
 
35
35
 
@@ -38,11 +38,11 @@
38
38
  {% endfor %}
39
39
 
40
40
  {% if cl.model_admin.list_filter_submit %}
41
- <div class="bg-gray-50 border-gray-200 border-t bottom-4 fixed px-6 py-3 right-4 rounded-b w-96 dark:bg-gray-700 dark:border-gray-600">
42
- <button type="submit" class="bg-primary-600 block border border-transparent font-medium px-3 py-2 rounded-md self-end text-sm text-white w-full">
43
- {% trans "Apply Filters" %}
44
- </button>
45
- </div>
41
+ <div class="bg-gray-50 border-gray-200 border-t bottom-4 fixed px-6 py-3 right-4 rounded-b w-96 dark:bg-gray-700 dark:border-gray-600">
42
+ <button type="submit" class="bg-primary-600 block border border-transparent font-medium px-3 py-2 rounded-md self-end text-sm text-white w-full">
43
+ {% trans "Apply Filters" %}
44
+ </button>
45
+ </div>
46
46
  </form>
47
47
  {% endif %}
48
48
  </div>
@@ -2,20 +2,20 @@
2
2
 
3
3
  {% if actions %}
4
4
  <td data-label="{% trans "More actions" %}" class="field-actions_holder align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:block before:capitalize before:content-[attr(data-label)] before:mr-auto before:text-gray-500 dark:before:text-gray-300 lg:before:hidden lg:py-3 lg:table-cell dark:border-gray-800 lg:w-px">
5
- {% with action_id=instance_pk|cut:"-" %}
6
- <div class="group leading-none relative" x-data="{ openActionsId{{ action_id }}: false }">
7
- <span x-ref="rowDropdown{{ action_id }}" class="cursor-pointer flex h-7 material-symbols-outlined md-18 -my-1 !leading-7 rounded text-center text-gray-400 w-7 group-hover:bg-gray-100 group-hover:text-gray-700 dark:text-gray-300 group-hover:dark:bg-gray-800 group-hover:dark:text-white" @click="openActionsId{{ action_id }} = !openActionsId{{ action_id }}">
8
- more_horiz
9
- </span>
5
+ {% with action_id=instance_pk|cut:"-" %}
6
+ <div class="group leading-none relative" x-data="{ openActionsId{{ action_id }}: false }">
7
+ <span x-ref="rowDropdown{{ action_id }}" class="cursor-pointer flex h-7 material-symbols-outlined md-18 -my-1 !leading-7 rounded text-center text-gray-400 w-7 group-hover:bg-gray-100 group-hover:text-gray-700 dark:text-gray-300 group-hover:dark:bg-gray-800 group-hover:dark:text-white" @click="openActionsId{{ action_id }} = !openActionsId{{ action_id }}">
8
+ more_horiz
9
+ </span>
10
10
 
11
- <nav x-anchor.offset.4="$refs.rowDropdown{{ action_id }}" class="bg-white border flex flex-col leading-none py-1 rounded-md shadow-lg text-sm top-7 z-50 w-48 dark:bg-gray-800 dark:border-gray-700" x-cloak x-show="openActionsId{{ action_id }}" @click.outside="openActionsId{{ action_id }} = false">
12
- {% for action in actions %}
13
- <a href="{% url action.raw_path instance_pk %}" class="mx-1 px-3 py-2 rounded-md truncate hover:bg-gray-100 dark:hover:bg-gray-700 dark:hover:text-gray-200"{% for attr_name, attr_value in action.attrs.items %} {{ attr_name }}="{{ attr_value }}"{% endfor %}>
14
- {{ action.title }}
15
- </a>
16
- {% endfor %}
17
- </nav>
18
- </div>
19
- {% endwith %}
11
+ <nav x-anchor.offset.4="$refs.rowDropdown{{ action_id }}" class="bg-white border flex flex-col leading-none py-1 rounded-md shadow-lg text-sm top-7 z-50 w-48 dark:bg-gray-800 dark:border-gray-700" x-cloak x-show="openActionsId{{ action_id }}" @click.outside="openActionsId{{ action_id }} = false">
12
+ {% for action in actions %}
13
+ <a href="{% url action.raw_path instance_pk %}" class="mx-1 px-3 py-2 rounded-md truncate hover:bg-gray-100 dark:hover:bg-gray-700 dark:hover:text-gray-200"{% for attr_name, attr_value in action.attrs.items %} {{ attr_name }}="{{ attr_value }}"{% endfor %}>
14
+ {{ action.title }}
15
+ </a>
16
+ {% endfor %}
17
+ </nav>
18
+ </div>
19
+ {% endwith %}
20
20
  </td>
21
21
  {% endif %}
@@ -52,7 +52,7 @@
52
52
  {% endif %}
53
53
  {% endfor %}
54
54
  </ol>
55
- {% endif %}
55
+ {% endif %}
56
56
  </div>
57
57
  {% endfor %}
58
58
  </div>
@@ -3,7 +3,7 @@
3
3
  <span class="flex gap-4 items-center">
4
4
  {% if value.3 and value.3.path %}
5
5
  <span class="bg-center bg-cover bg-white flex font-medium justify-center overflow-hidden dark:bg-gray-900 dark:border-gray-700 {% if value.3.squared %}rounded-sm{% else %}rounded-full{% endif %}{% if not value.3.borderless %} border{% endif %}{% if not value.3.width or not value.3.height %} h-8 max-w-8 min-w-8{% endif %}">
6
- <img loading="lazy" src="{{ value.3.path }}" class="object-cover" {% if value.3.width %}width="{{ value.3.width }}"{% endif %} {% if value.3.height %}height="{{ value.3.height }}"{% endif %} alt="{% trans "Record picture" %}" />
6
+ <img loading="lazy" src="{{ value.3.path }}" class="max-w-none object-cover" {% if value.3.width %}width="{{ value.3.width }}"{% endif %} {% if value.3.height %}height="{{ value.3.height }}"{% endif %} alt="{% trans "Record picture" %}" />
7
7
  </span>
8
8
  {% elif value.2 %}
9
9
  <span class="bg-white border flex font-medium h-8 justify-center items-center rounded-full text-xs uppercase w-8 dark:bg-gray-900 dark:border-gray-700">
@@ -21,7 +21,7 @@
21
21
  {% include "unfold/helpers/help_text.html" with help_text=field.field.help_text %}
22
22
  </div>
23
23
  {% endif %}
24
- </div>
24
+ </div>
25
25
 
26
26
  {% if field.errors %}
27
27
  <div class="mt-1 text-red-600 text-sm dark:text-red-500">
@@ -52,7 +52,7 @@
52
52
  </div>
53
53
  {% endif %}
54
54
  {% else %}
55
- <div class="{% if adminform.model_admin.compressed_fields %} min-w-48 lg:mt-2 w-48{% endif %}">
55
+ <div class="{% if adminform.model_admin.compressed_fields %}lg:min-w-48 lg:mt-2 lg:w-48{% endif %}">
56
56
  {{ field.label_tag }}
57
57
  </div>
58
58
 
@@ -7,8 +7,8 @@
7
7
  {% for fieldset in tabs %}
8
8
  <li>
9
9
  <a class="cursor-pointer font-semibold hover:text-gray-700 dark:hover:text-white"
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-gray-700 dark:text-white' : ''">
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-gray-700 dark:text-white' : ''">
12
12
  {{ fieldset.name }}
13
13
  </a>
14
14
  </li>
@@ -17,7 +17,7 @@
17
17
 
18
18
  {% for fieldset in tabs %}
19
19
  <div class="tab-wrapper{% if fieldset.name %} fieldset-{{ fieldset.name|slugify }} fieldset-{{ forloop.counter0 }}-{{ fieldset.name|slugify }}{% endif %}"
20
- x-show="openTab == '{{ forloop.counter0 }}-{{ fieldset.name|slugify }}'{% if forloop.first %} || openTab == null{% endif %}">
20
+ x-show="openTab == '{{ forloop.counter0 }}-{{ fieldset.name|slugify }}'{% if forloop.first %} || openTab == null{% endif %}">
21
21
  {% include 'admin/includes/fieldset.html' %}
22
22
  </div>
23
23
  {% endfor %}
@@ -1,16 +1,16 @@
1
1
  <span class="inline-block font-semibold leading-normal px-2 py-1 rounded text-xxs uppercase whitespace-nowrap
2
- {% if type == 'info' %}
3
- bg-blue-100 text-blue-700 dark:bg-blue-500/20 dark:text-blue-400
4
- {% elif type == 'danger' %}
5
- bg-red-100 text-red-700 dark:bg-red-500/20 dark:text-red-400
6
- {% elif type == 'warning' %}
7
- bg-orange-100 text-orange-700 dark:bg-orange-500/20 dark:text-orange-400
8
- {% elif type == 'success' %}
9
- bg-green-100 text-green-700 dark:bg-green-500/20 dark:text-green-400
10
- {% elif type == 'primary' %}
11
- bg-primary-100 text-primary-700 dark:bg-primary-500/20 dark:text-primary-400
12
- {% else %}
13
- bg-gray-100 text-gray-700 dark:bg-gray-500/20 dark:text-gray-400
14
- {% endif %}">
2
+ {% if type == 'info' %}
3
+ bg-blue-100 text-blue-700 dark:bg-blue-500/20 dark:text-blue-400
4
+ {% elif type == 'danger' %}
5
+ bg-red-100 text-red-700 dark:bg-red-500/20 dark:text-red-400
6
+ {% elif type == 'warning' %}
7
+ bg-orange-100 text-orange-700 dark:bg-orange-500/20 dark:text-orange-400
8
+ {% elif type == 'success' %}
9
+ bg-green-100 text-green-700 dark:bg-green-500/20 dark:text-green-400
10
+ {% elif type == 'primary' %}
11
+ bg-primary-100 text-primary-700 dark:bg-primary-500/20 dark:text-primary-400
12
+ {% else %}
13
+ bg-gray-100 text-gray-700 dark:bg-gray-500/20 dark:text-gray-400
14
+ {% endif %}">
15
15
  {{ text }}
16
16
  </span>
@@ -2,17 +2,17 @@
2
2
  <ul>
3
3
  {% for message in messages %}
4
4
  <li class="mb-3 px-3 py-3 rounded-md text-sm last:mb-8
5
- {% if message.tags == 'success' %}
6
- bg-green-100 text-green-700 dark:bg-green-500/20 dark:text-green-400
7
- {% elif message.tags == 'warning' %}
8
- bg-orange-100 text-orange-700 dark:bg-orange-500/20 dark:text-orange-400
9
- {% elif message.tags == 'error' %}
10
- bg-red-100 text-red-700 dark:bg-red-500/20 dark:text-red-400
11
- {% elif message.tags == 'info' %}
12
- bg-blue-100 text-blue-700 dark:bg-blue-500/20 dark:text-blue-400
13
- {% else %}
14
- bg-gray-100 text-gray-700 dark:bg-gray-500/20 dark:text-gray-400
15
- {% endif %}">
5
+ {% if message.tags == 'success' %}
6
+ bg-green-100 text-green-700 dark:bg-green-500/20 dark:text-green-400
7
+ {% elif message.tags == 'warning' %}
8
+ bg-orange-100 text-orange-700 dark:bg-orange-500/20 dark:text-orange-400
9
+ {% elif message.tags == 'error' %}
10
+ bg-red-100 text-red-700 dark:bg-red-500/20 dark:text-red-400
11
+ {% elif message.tags == 'info' %}
12
+ bg-blue-100 text-blue-700 dark:bg-blue-500/20 dark:text-blue-400
13
+ {% else %}
14
+ bg-gray-100 text-gray-700 dark:bg-gray-500/20 dark:text-gray-400
15
+ {% endif %}">
16
16
  {{ message|capfirst }}
17
17
  </li>
18
18
  {% endfor %}
@@ -1,7 +1,7 @@
1
1
  {% load i18n %}
2
2
 
3
3
  <div class="relative min-w-sidebar transition-width w-sidebar z-30">
4
- <nav id="nav-sidebar" class="bg-gray-50 border-r border-gray-200 fixed max-h-screen transition-width w-sidebar dark:bg-gray-900 dark:border-gray-800">
4
+ <nav id="nav-sidebar" class="bg-gray-50 border-r border-gray-200 bottom-0 fixed max-h-screen top-0 transition-width w-sidebar dark:bg-gray-900 dark:border-gray-800">
5
5
  <div class="flex flex-col min-h-screen min-w-sidebar dark:bg-gray-950/20">
6
6
  <div class="border-b border-gray-200 mb-5 py-3 dark:border-gray-800">
7
7
  <div class="flex font-medium h-10 items-center px-6 text-gray-900 tracking-tight dark:text-gray-100 xl:text-base">
@@ -18,6 +18,7 @@
18
18
  {% if inlines_list %}
19
19
  <li class="border-b last:border-b-0 md:border-b-0 md:mr-8 dark:border-gray-800">
20
20
  <a class="block cursor-pointer font-medium px-3 py-2 md:py-4 md:px-0"
21
+ href="#general"
21
22
  x-on:click="activeTab = 'general'"
22
23
  x-bind:class="{'border-b border-gray-200 dark:border-gray-800 md:border-primary-500 dark:md:!border-primary-600 font-semibold -mb-px text-primary-600 dark:text-primary-500': activeTab == 'general', 'hover:text-gray-700 dark:hover:text-gray-200 dark:border-gray-800': activeTab != 'general'}">
23
24
  {% trans "General" %}
@@ -27,6 +28,7 @@
27
28
  {% for inline in inlines_list %}
28
29
  <li class="border-b last:border-b-0 md:border-b-0 md:mr-8 dark:border-gray-800">
29
30
  <a class="block cursor-pointer font-medium px-3 py-2 md:py-4 md:px-0"
31
+ href="#{{ inline.opts.verbose_name|slugify }}"
30
32
  x-on:click="activeTab = '{{ inline.opts.verbose_name|slugify }}'"
31
33
  x-bind:class="{'border-b border-gray-200 dark:border-gray-800 md:border-primary-500 dark:md:!border-primary-600 font-semibold -mb-px text-primary-600 dark:text-primary-500': activeTab == '{{ inline.opts.verbose_name|slugify }}', 'hover:text-gray-700 dark:hover:text-gray-200 dark:border-gray-800': activeTab != '{{ inline.opts.verbose_name|slugify }}'}">
32
34
  {% if inline.formset.max_num == 1 %}
@@ -14,65 +14,65 @@
14
14
  <!DOCTYPE html>
15
15
  <html lang="{{ LANGUAGE_CODE|default:"en-us" }}" dir="{{ LANGUAGE_BIDI|yesno:"rtl,ltr,auto" }}" {% if theme %}class="{{ theme }}"{% else %}x-data="{ adminTheme: $persist('auto').as('adminTheme') }" x-bind:class="{'dark': adminTheme === 'dark' || (adminTheme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches)}" x-cloak{% endif %}>
16
16
 
17
- <head>
18
- <title>{% block title %}{% endblock %}</title>
17
+ <head>
18
+ <title>{% block title %}{% endblock %}</title>
19
19
 
20
- <link href="{% static "unfold/fonts/inter/styles.css" %}" rel="stylesheet">
21
- <link href="{% static "unfold/fonts/material-symbols/styles.css" %}" rel="stylesheet">
20
+ <link href="{% static "unfold/fonts/inter/styles.css" %}" rel="stylesheet">
21
+ <link href="{% static "unfold/fonts/material-symbols/styles.css" %}" rel="stylesheet">
22
22
 
23
- {% for style in styles %}
24
- <link href="{{ style }}" rel="stylesheet">
25
- {% endfor %}
23
+ {% for style in styles %}
24
+ <link href="{{ style }}" rel="stylesheet">
25
+ {% endfor %}
26
26
 
27
- {% for favicon in site_favicons %}
28
- <link {% if favicon.rel %}rel="{{ favicon.rel }}"{% endif %} {% if favicon.href %}href="{{ favicon.href }}"{% endif %} {% if favicon.type %}type="{{ favicon.type }}"{% endif %} {% if favicon.sizes %}sizes="{{ favicon.sizes }}"{% endif %}>
29
- {% endfor %}
27
+ {% for favicon in site_favicons %}
28
+ <link {% if favicon.rel %}rel="{{ favicon.rel }}"{% endif %} {% if favicon.href %}href="{{ favicon.href }}"{% endif %} {% if favicon.type %}type="{{ favicon.type }}"{% endif %} {% if favicon.sizes %}sizes="{{ favicon.sizes }}"{% endif %}>
29
+ {% endfor %}
30
30
 
31
- <link href="{% static 'unfold/css/styles.css' %}" rel="stylesheet">
32
- <link href="{% static 'unfold/css/simplebar.css' %}" rel="stylesheet">
31
+ <link href="{% static 'unfold/css/styles.css' %}" rel="stylesheet">
32
+ <link href="{% static 'unfold/css/simplebar.css' %}" rel="stylesheet">
33
33
 
34
- <script src="{% static 'unfold/js/alpine.anchor.js' %}" defer></script>
35
- <script src="{% static 'unfold/js/alpine.persist.js' %}" defer></script>
36
- <script src="{% static 'unfold/js/alpine.js' %}" defer></script>
37
- <script src="{% static 'unfold/js/htmx.js' %}"></script>
38
- <script src="{% static 'unfold/js/chart.js' %}"></script>
34
+ <script src="{% static 'unfold/js/alpine.anchor.js' %}" defer></script>
35
+ <script src="{% static 'unfold/js/alpine.persist.js' %}" defer></script>
36
+ <script src="{% static 'unfold/js/alpine.js' %}" defer></script>
37
+ <script src="{% static 'unfold/js/htmx.js' %}"></script>
38
+ <script src="{% static 'unfold/js/chart.js' %}"></script>
39
39
 
40
- {% for script in scripts %}
41
- <script src="{{ script }}"></script>
42
- {% endfor %}
40
+ {% for script in scripts %}
41
+ <script src="{{ script }}"></script>
42
+ {% endfor %}
43
43
 
44
- {% block extrastyle %}{% endblock %}
44
+ {% block extrastyle %}{% endblock %}
45
45
 
46
- {% block extrahead %}{% endblock %}
46
+ {% block extrahead %}{% endblock %}
47
47
 
48
- <script src="{% static 'unfold/js/app.js' %}"></script>
48
+ <script src="{% static 'unfold/js/app.js' %}"></script>
49
49
 
50
- {% block responsive %}
51
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
52
- {% endblock %}
50
+ {% block responsive %}
51
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
52
+ {% endblock %}
53
53
 
54
- {% block blockbots %}
55
- <meta name="robots" content="NONE,NOARCHIVE">
56
- {% endblock %}
54
+ {% block blockbots %}
55
+ <meta name="robots" content="NONE,NOARCHIVE">
56
+ {% endblock %}
57
57
 
58
- {% if colors %}
59
- <style>
60
- html {
61
- {% for name, weights in colors.items %}
62
- {% for weight, value in weights.items %}
63
- --color-{{ name }}-{{ weight }}: {{ value }};
58
+ {% if colors %}
59
+ <style>
60
+ html {
61
+ {% for name, weights in colors.items %}
62
+ {% for weight, value in weights.items %}
63
+ --color-{{ name }}-{{ weight }}: {{ value }};
64
+ {% endfor %}
64
65
  {% endfor %}
65
- {% endfor %}
66
- }
67
- </style>
68
- {% endif %}
69
- </head>
70
-
71
- <body class="antialiased bg-white font-sans text-gray-600 text-sm dark:bg-gray-900 dark:text-gray-300 {% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}" data-admin-utc-offset="{% now "Z" %}" x-data="{ activeTab: 'general', sidebarMobileOpen: false, sidebarDesktopOpen: {% if request.session.toggle_sidebar == False %}false{% else %}true{% endif %} }">
72
- {% block base %}{% endblock %}
73
-
74
- <div id="modal-overlay" class="backdrop-blur-sm bg-opacity-80 bg-gray-900 bottom-0 fixed hidden left-0 mr-1 right-0 top-0 z-50"></div>
75
- <script src="{% static 'unfold/js/simplebar.js' %}"></script>
76
- </body>
66
+ }
67
+ </style>
68
+ {% endif %}
69
+ </head>
70
+
71
+ <body class="antialiased bg-white font-sans text-gray-600 text-sm dark:bg-gray-900 dark:text-gray-300 {% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}" data-admin-utc-offset="{% now "Z" %}" x-data="{ activeTab: 'general', sidebarMobileOpen: false, sidebarDesktopOpen: {% if request.session.toggle_sidebar == False %}false{% else %}true{% endif %} }" x-init="activeTab = window.location.hash?.replace('#', '') || 'general'">
72
+ {% block base %}{% endblock %}
73
+
74
+ <div id="modal-overlay" class="backdrop-blur-sm bg-opacity-80 bg-gray-900 bottom-0 fixed hidden left-0 mr-1 right-0 top-0 z-50"></div>
75
+ <script src="{% static 'unfold/js/simplebar.js' %}"></script>
76
+ </body>
77
77
 
78
78
  </html>
@@ -17,7 +17,15 @@
17
17
  <input type="text" aria-label="{% trans 'Choose file to upload' %}" value="{% if widget.value %}{{ widget.value.url }}{% else %}{% trans 'Choose file to upload' %}{% endif %}" disabled class="bg-white flex-grow font-medium px-3 py-2 text-ellipsis dark:bg-gray-900 {% if widget.value %}text-gray-500 dark:text-gray-300{% else %}text-gray-300 dark:text-gray-300{% endif %}">
18
18
 
19
19
  <div class="flex flex-none items-center leading-none self-stretch">
20
- <input type="{{ widget.type }}" name="{{ widget.name }}" class="{{ widget.file_input_class }}" {% include "django/forms/widgets/attrs.html" %} />
20
+ <div class="hidden">
21
+ <input type="{{ widget.type }}" name="{{ widget.name }}" {% include "django/forms/widgets/attrs.html" %} />
22
+ </div>
23
+
24
+ {% if widget.is_initial %}
25
+ <a href="{{ widget.value.url }}" class="border-r cursor-pointer text-gray-400 px-3 hover:text-gray-700 dark:border-gray-700 dark:text-gray-500 dark:hover:text-gray-200" target="_blank">
26
+ <span class="material-symbols-outlined">download</span>
27
+ </a>
28
+ {% endif %}
21
29
 
22
30
  <label for="{{ widget.attrs.id }}" class="cursor-pointer text-gray-400 px-3 hover:text-gray-700 dark:text-gray-500 dark:hover:text-gray-200">
23
31
  <span class="material-symbols-outlined">file_upload</span>
@@ -8,12 +8,14 @@
8
8
  {% endif %}
9
9
 
10
10
  {% if link_url %}
11
- <a href="{{ link_url }}" title="{{ link_label }}" class="flex items-center h-9.5 justify-center ml-4 rounded shrink-0 text-primary-600 text-sm dark:text-primary-500">
11
+ <a href="{{ link_url }}" title="{{ link_label }}" class="flex items-center h-9.5 justify-center ml-4 rounded shrink-0 text-primary-600 text-sm truncate dark:text-primary-500">
12
12
  {{ link_label }}
13
13
  </a>
14
14
  {% else %}
15
- <span title="{{ link_label }}" class="bg-white flex items-center h-9.5 justify-center ml-4 rounded shrink-0 text-sm">
16
- {{ link_label }}
17
- </span>
15
+ {% if link_label %}
16
+ <span title="{{ link_label }}" class="flex items-center h-9.5 justify-center ml-4 rounded shrink-0 text-sm truncate">
17
+ {{ link_label }}
18
+ </span>
19
+ {% endif %}
18
20
  {% endif %}
19
21
  </div>
@@ -5,8 +5,8 @@
5
5
  {% include "django/forms/widgets/input.html" %}
6
6
 
7
7
  {% if widget.wrap_label %}
8
- <span>
9
- {{ widget.label }}
10
- </span>
8
+ <span>
9
+ {{ widget.label }}
10
+ </span>
11
11
  </label>
12
12
  {% endif %}
@@ -1,11 +1,11 @@
1
1
  <div class="flex flex-row items-center max-w-2xl">
2
- {% for widget in widget.subwidgets %}
3
- {% include widget.template_name %}
2
+ {% for widget in widget.subwidgets %}
3
+ {% include widget.template_name %}
4
4
 
5
- {% if forloop.first %}
6
- <div class="px-4 text-gray-300">
7
- -
8
- </div>
9
- {% endif %}
10
- {% endfor %}
5
+ {% if forloop.first %}
6
+ <div class="px-4 text-gray-300">
7
+ -
8
+ </div>
9
+ {% endif %}
10
+ {% endfor %}
11
11
  </div>
@@ -22,8 +22,8 @@
22
22
  <a class="related-widget-wrapper-link add-related bg-white border cursor-pointer flex items-center h-9.5 justify-center ml-2 rounded shadow-sm shrink-0 text-gray-400 text-sm w-9.5 hover:text-gray-700 dark:bg-gray-900 dark:border-gray-700 dark:text-gray-500 dark:hover:text-gray-200"
23
23
  data-popup="yes"
24
24
  id="add_id_{{ name }}"
25
- href="{{ add_related_url }}?{{ url_params }}"
26
- title="{% blocktranslate %}Add another {{ model }}{% endblocktranslate %}">
25
+ href="{{ add_related_url }}?{{ url_params }}"
26
+ title="{% blocktranslate %}Add another {{ model }}{% endblocktranslate %}">
27
27
  <span class="material-symbols-outlined text-sm">add</span>
28
28
  </a>
29
29
  {% endif %}
@@ -38,11 +38,11 @@
38
38
  {% endif %}
39
39
 
40
40
  {% if can_delete_related %}
41
- <a class="related-widget-wrapper-link delete-related bg-white border cursor-pointer flex items-center h-9.5 justify-center ml-2 rounded shadow-sm shrink-0 text-red-600 text-sm w-9.5 dark:bg-gray-900 dark:border-gray-700 dark:text-red-500"
41
+ <a class="related-widget-wrapper-link delete-related bg-white border cursor-pointer flex items-center h-9.5 justify-center ml-2 rounded shadow-sm shrink-0 text-red-600 text-sm w-9.5 dark:bg-gray-900 dark:border-gray-700 dark:text-red-500"
42
42
  id="delete_id_{{ name }}"
43
- data-href-template="{{ delete_related_template_url }}?{{ url_params }}"
44
- data-popup="yes"
45
- title="{% blocktranslate %}Delete selected {{ model }}{% endblocktranslate %}">
43
+ data-href-template="{{ delete_related_template_url }}?{{ url_params }}"
44
+ data-popup="yes"
45
+ title="{% blocktranslate %}Delete selected {{ model }}{% endblocktranslate %}">
46
46
  <span class="material-symbols-outlined text-sm">delete</span>
47
47
  </a>
48
48
  {% endif %}
@@ -82,7 +82,7 @@ CHECKBOX_CLASSES = [
82
82
  "before:content-[attr(data-label)]",
83
83
  "before:font-semibold",
84
84
  "before:mr-auto",
85
- "before:text-gray-100",
85
+ "before:text-gray-900",
86
86
  "lg:before:hidden",
87
87
  "lg:border-t",
88
88
  "lg:border-gray-200",
unfold/utils.py CHANGED
@@ -132,7 +132,12 @@ def prettify_json(data: Any) -> Optional[str]:
132
132
  return None
133
133
 
134
134
  def format_response(response: str, theme: str) -> str:
135
- formatter = HtmlFormatter(style=theme, noclasses=True, nobackground=True)
135
+ formatter = HtmlFormatter(
136
+ style=theme,
137
+ noclasses=True,
138
+ nobackground=True,
139
+ prestyles="white-space: pre-wrap; word-wrap: break-word;",
140
+ )
136
141
  return highlight(response, JsonLexer(), formatter)
137
142
 
138
143
  response = json.dumps(data, sort_keys=True, indent=4)