django-unfold 0.36.0__py3-none-any.whl → 0.38.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- django_unfold-0.38.0.dist-info/METADATA +70 -0
- {django_unfold-0.36.0.dist-info → django_unfold-0.38.0.dist-info}/RECORD +75 -74
- unfold/admin.py +2 -1
- unfold/contrib/filters/templates/unfold/filters/filters_date_range.html +1 -1
- unfold/contrib/filters/templates/unfold/filters/filters_datetime_range.html +1 -1
- unfold/contrib/filters/templates/unfold/filters/filters_numeric_range.html +1 -1
- unfold/contrib/filters/templates/unfold/filters/filters_numeric_single.html +1 -1
- unfold/contrib/filters/templates/unfold/filters/filters_numeric_slider.html +4 -4
- unfold/contrib/forms/templates/unfold/forms/helpers/toolbar.html +6 -6
- unfold/contrib/forms/widgets.py +1 -0
- unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_group.html +1 -1
- unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_user.html +1 -1
- unfold/contrib/guardian/templates/unfold/guardian/group_form.html +5 -5
- unfold/contrib/guardian/templates/unfold/guardian/user_form.html +5 -5
- unfold/contrib/import_export/forms.py +1 -0
- unfold/contrib/import_export/templates/admin/import_export/change_form.html +1 -1
- unfold/contrib/import_export/templates/admin/import_export/import.html +13 -13
- unfold/contrib/import_export/templates/admin/import_export/import_errors.html +3 -3
- unfold/contrib/inlines/admin.py +1 -0
- unfold/contrib/simple_history/templates/simple_history/object_history.html +1 -1
- unfold/contrib/simple_history/templates/simple_history/object_history_list.html +8 -8
- unfold/contrib/simple_history/templates/simple_history/submit_line.html +1 -1
- unfold/settings.py +26 -1
- unfold/static/unfold/css/styles.css +1 -1
- unfold/static/unfold/js/app.js +7 -1
- unfold/styles.css +1 -1
- unfold/templates/admin/app_list.html +3 -3
- unfold/templates/admin/auth/user/add_form.html +1 -1
- unfold/templates/admin/base_site.html +1 -1
- unfold/templates/admin/change_form.html +1 -1
- unfold/templates/admin/change_list.html +8 -13
- unfold/templates/admin/change_list_results.html +2 -2
- unfold/templates/admin/delete_confirmation.html +6 -6
- unfold/templates/admin/delete_selected_confirmation.html +5 -5
- unfold/templates/admin/edit_inline/stacked.html +7 -5
- unfold/templates/admin/edit_inline/tabular.html +3 -3
- unfold/templates/admin/filter.html +1 -1
- unfold/templates/admin/includes/fieldset.html +1 -1
- unfold/templates/admin/includes/object_delete_summary.html +1 -1
- unfold/templates/admin/login.html +2 -2
- unfold/templates/admin/nav_sidebar.html +1 -1
- unfold/templates/admin/search_form.html +1 -1
- unfold/templates/auth/widgets/read_only_password_hash.html +2 -2
- unfold/templates/registration/logged_out.html +1 -1
- unfold/templates/registration/password_change_done.html +3 -3
- unfold/templates/unfold/change_list_filter.html +31 -15
- unfold/templates/unfold/components/card.html +1 -1
- unfold/templates/unfold/components/navigation.html +1 -1
- unfold/templates/unfold/components/title.html +1 -1
- unfold/templates/unfold/helpers/actions_row.html +14 -14
- unfold/templates/unfold/helpers/app_list.html +8 -8
- unfold/templates/unfold/helpers/display_header.html +1 -1
- unfold/templates/unfold/helpers/fieldset_row.html +2 -2
- unfold/templates/unfold/helpers/fieldsets_tabs.html +4 -4
- unfold/templates/unfold/helpers/form_label.html +1 -1
- unfold/templates/unfold/helpers/label.html +13 -13
- unfold/templates/unfold/helpers/messages.html +12 -12
- unfold/templates/unfold/helpers/navigation.html +2 -2
- unfold/templates/unfold/helpers/search.html +1 -1
- unfold/templates/unfold/helpers/tab_action.html +1 -1
- unfold/templates/unfold/helpers/tab_list.html +2 -0
- unfold/templates/unfold/helpers/welcomemsg.html +3 -3
- unfold/templates/unfold/layouts/skeleton.html +47 -47
- unfold/templates/unfold/widgets/clearable_file_input.html +2 -2
- unfold/templates/unfold/widgets/clearable_file_input_small.html +10 -2
- unfold/templates/unfold/widgets/foreign_key_raw_id.html +6 -4
- unfold/templates/unfold/widgets/radio_option.html +3 -3
- unfold/templates/unfold/widgets/range.html +8 -8
- unfold/templates/unfold/widgets/related_widget_wrapper.html +6 -6
- unfold/templates/unfold/widgets/url.html +7 -0
- unfold/templatetags/unfold_list.py +0 -7
- unfold/utils.py +6 -1
- unfold/widgets.py +26 -6
- django_unfold-0.36.0.dist-info/METADATA +0 -1455
- {django_unfold-0.36.0.dist-info → django_unfold-0.38.0.dist-info}/LICENSE.md +0 -0
- {django_unfold-0.36.0.dist-info → django_unfold-0.38.0.dist-info}/WHEEL +0 -0
@@ -5,6 +5,6 @@
|
|
5
5
|
{{ block.super }}
|
6
6
|
|
7
7
|
{% if show_change_form_export %}
|
8
|
-
<input type="submit" value="{% translate 'Export' %}" name="_export-item" class="bg-white text-gray-500 border cursor-pointer flex font-medium items-center px-3 py-2 mr-3 rounded-md shadow-sm text-sm dark:bg-gray-900 dark:border dark:border-gray-700 dark:text-
|
8
|
+
<input type="submit" value="{% translate 'Export' %}" name="_export-item" class="bg-white text-gray-500 border cursor-pointer flex font-medium items-center px-3 py-2 mr-3 rounded-md shadow-sm text-sm dark:bg-gray-900 dark:border dark:border-gray-700 dark:text-font-default-dark">
|
9
9
|
{% endif %}
|
10
10
|
{% endblock %}
|
@@ -44,19 +44,19 @@
|
|
44
44
|
{% endblock %}
|
45
45
|
|
46
46
|
{% block content %}
|
47
|
-
|
48
|
-
|
49
|
-
{% else %}
|
50
|
-
{% include "admin/import_export/import_form.html" %}
|
51
|
-
{% endif %}
|
52
|
-
|
53
|
-
{% if result %}
|
54
|
-
{% if result.has_errors %}
|
55
|
-
{% include "admin/import_export/import_errors.html" %}
|
56
|
-
{% elif result.has_validation_errors %}
|
57
|
-
{% include "admin/import_export/import_validation.html" %}
|
47
|
+
{% if confirm_form %}
|
48
|
+
{% include "admin/import_export/import_confirm.html" %}
|
58
49
|
{% else %}
|
59
|
-
|
50
|
+
{% include "admin/import_export/import_form.html" %}
|
51
|
+
{% endif %}
|
52
|
+
|
53
|
+
{% if result %}
|
54
|
+
{% if result.has_errors %}
|
55
|
+
{% include "admin/import_export/import_errors.html" %}
|
56
|
+
{% elif result.has_validation_errors %}
|
57
|
+
{% include "admin/import_export/import_validation.html" %}
|
58
|
+
{% else %}
|
59
|
+
{% include "admin/import_export/import_preview.html" %}
|
60
|
+
{% endif %}
|
60
61
|
{% endif %}
|
61
|
-
{% endif %}
|
62
62
|
{% endblock %}
|
@@ -6,9 +6,9 @@
|
|
6
6
|
<ul>
|
7
7
|
{% for error in result.base_errors %}
|
8
8
|
<li>
|
9
|
-
|
9
|
+
{{ error.error }}
|
10
10
|
|
11
|
-
|
11
|
+
<div class="traceback">{{ error.traceback|linebreaks }}</div></li>
|
12
12
|
{% endfor %}
|
13
13
|
|
14
14
|
{% for line, errors in result.row_errors %}
|
@@ -26,7 +26,7 @@
|
|
26
26
|
</div>
|
27
27
|
</div>
|
28
28
|
|
29
|
-
<div class="block border leading-relaxed mb-4 rounded p-4 traceback dark:border-gray-800 dark:text-
|
29
|
+
<div class="block border leading-relaxed mb-4 rounded p-4 traceback dark:border-gray-800 dark:text-font-default-dark " x-show="open">
|
30
30
|
{{ error.traceback|linebreaks }}
|
31
31
|
</div>
|
32
32
|
</li>
|
unfold/contrib/inlines/admin.py
CHANGED
@@ -11,6 +11,7 @@ from django.forms.models import modelform_defines_fields
|
|
11
11
|
from django.http import HttpRequest
|
12
12
|
from django.utils.text import get_text_list
|
13
13
|
from django.utils.translation import gettext_lazy as _
|
14
|
+
|
14
15
|
from unfold.admin import StackedInline, TabularInline
|
15
16
|
|
16
17
|
from .checks import NonrelatedModelAdminChecks
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
{% block content %}
|
6
6
|
{% if not revert_disabled %}
|
7
|
-
<p class="px-3 py-3 rounded-md text-sm last:mb-8
|
7
|
+
<p class="px-3 py-3 rounded-md text-sm last:mb-8 mb-8 bg-blue-100 text-blue-700 dark:bg-blue-500/20 dark:text-blue-400">
|
8
8
|
{% blocktrans %}Choose a date from the list below to revert to a previous version of this object.{% endblocktrans %}
|
9
9
|
</p>
|
10
10
|
{% endif %}
|
@@ -4,35 +4,35 @@
|
|
4
4
|
{% load getattribute from getattributes %}
|
5
5
|
|
6
6
|
<table id="change-history" class="border-gray-200 border-spacing-none border-separate mb-6 w-full lg:border lg:rounded-md lg:shadow-sm lg:dark:border-gray-800">
|
7
|
-
<thead class="hidden text-
|
7
|
+
<thead class="hidden text-font-important-light lg:table-header-group dark:text-font-important-dark">
|
8
8
|
<tr>
|
9
|
-
<th class="align-middle font-
|
9
|
+
<th class="align-middle font-semibold px-3 py-2 text-left ">
|
10
10
|
{% trans 'Object' %}
|
11
11
|
</th>
|
12
12
|
|
13
13
|
{% for column in history_list_display %}
|
14
|
-
<th class="align-middle font-
|
14
|
+
<th class="align-middle font-semibold px-3 py-2 text-left ">
|
15
15
|
{% trans column %}
|
16
16
|
</th>
|
17
17
|
{% endfor %}
|
18
18
|
|
19
|
-
<th class="align-middle font-
|
19
|
+
<th class="align-middle font-semibold px-3 py-2 text-left">
|
20
20
|
{% trans 'Date/time' %}
|
21
21
|
</th>
|
22
22
|
|
23
|
-
<th class="align-middle font-
|
23
|
+
<th class="align-middle font-semibold px-3 py-2 text-left">
|
24
24
|
{% trans 'Comment' %}
|
25
25
|
</th>
|
26
26
|
|
27
|
-
<th class="align-middle font-
|
27
|
+
<th class="align-middle font-semibold px-3 py-2 text-left">
|
28
28
|
{% trans 'Changed by' %}
|
29
29
|
</th>
|
30
30
|
|
31
|
-
<th class="align-middle font-
|
31
|
+
<th class="align-middle font-semibold px-3 py-2 text-left">
|
32
32
|
{% trans 'Change reason' %}
|
33
33
|
</th>
|
34
34
|
|
35
|
-
<th class="align-middle font-
|
35
|
+
<th class="align-middle font-semibold px-3 py-2 text-left">
|
36
36
|
{% trans 'Changes' %}
|
37
37
|
</th>
|
38
38
|
</tr>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
</button>
|
17
17
|
{% endif %}
|
18
18
|
|
19
|
-
<a href="{{ history_url }}" class="border font-medium mr-auto px-3 py-2 rounded-md text-sm text-gray-500 text-center transition-all w-full hover:bg-gray-50 lg:block lg:w-auto dark:border-gray-700 dark:text-
|
19
|
+
<a href="{{ history_url }}" class="border font-medium mr-auto px-3 py-2 rounded-md text-sm text-gray-500 text-center transition-all w-full hover:bg-gray-50 lg:block lg:w-auto dark:border-gray-700 dark:text-font-default-dark dark:hover:text-gray-200 dark:hover:bg-gray-900">
|
20
20
|
{% trans 'Close' %}
|
21
21
|
</a>
|
22
22
|
</div>
|
unfold/settings.py
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
from typing import Any, Dict
|
2
|
+
|
1
3
|
from django.conf import settings
|
2
4
|
|
3
5
|
CONFIG_DEFAULTS = {
|
@@ -11,6 +13,14 @@ CONFIG_DEFAULTS = {
|
|
11
13
|
"SHOW_HISTORY": True,
|
12
14
|
"SHOW_VIEW_ON_SITE": True,
|
13
15
|
"COLORS": {
|
16
|
+
"font": {
|
17
|
+
"subtle-light": "107 114 128", # text-gray-500
|
18
|
+
"subtle-dark": "156 163 175", # text-gray-400
|
19
|
+
"default-light": "75 85 99", # text-gray-600
|
20
|
+
"default-dark": "209 213 219", # text-gray-300
|
21
|
+
"important-light": "17 24 39", # text-gray-900
|
22
|
+
"important-dark": "243 244 246", # text-gray-100
|
23
|
+
},
|
14
24
|
"primary": {
|
15
25
|
"50": "250 245 255",
|
16
26
|
"100": "243 232 255",
|
@@ -47,4 +57,19 @@ def get_config(settings_name=None):
|
|
47
57
|
if settings_name is None:
|
48
58
|
settings_name = "UNFOLD"
|
49
59
|
|
50
|
-
|
60
|
+
def merge_dicts(dict1: Dict[str, Any], dict2: Dict[str, Any]) -> Dict[str, Any]:
|
61
|
+
result = dict1.copy()
|
62
|
+
|
63
|
+
for key, value in dict2.items():
|
64
|
+
if (
|
65
|
+
key in result
|
66
|
+
and isinstance(result[key], dict)
|
67
|
+
and isinstance(value, dict)
|
68
|
+
):
|
69
|
+
result[key] = merge_dicts(result[key], value)
|
70
|
+
else:
|
71
|
+
result[key] = value
|
72
|
+
|
73
|
+
return result
|
74
|
+
|
75
|
+
return merge_dicts(CONFIG_DEFAULTS, getattr(settings, settings_name, {}))
|