django-unfold 0.42.0__py3-none-any.whl → 0.44.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.42.0.dist-info → django_unfold-0.44.0.dist-info}/METADATA +1 -1
- django_unfold-0.44.0.dist-info/RECORD +227 -0
- {django_unfold-0.42.0.dist-info → django_unfold-0.44.0.dist-info}/WHEEL +1 -1
- unfold/admin.py +2 -0
- unfold/components.py +47 -0
- unfold/contrib/filters/admin.py +5 -5
- 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 +3 -3
- unfold/contrib/forms/templates/unfold/forms/array.html +3 -3
- unfold/contrib/forms/templates/unfold/forms/helpers/toolbar.html +25 -25
- unfold/contrib/forms/widgets.py +5 -5
- unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage.html +1 -1
- unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_group.html +2 -2
- unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_user.html +2 -2
- unfold/contrib/guardian/templates/unfold/guardian/group_form.html +8 -8
- unfold/contrib/guardian/templates/unfold/guardian/user_form.html +8 -8
- unfold/contrib/import_export/templates/admin/import_export/change_form.html +1 -1
- unfold/contrib/import_export/templates/admin/import_export/export.html +4 -4
- unfold/contrib/import_export/templates/admin/import_export/import_confirm.html +4 -4
- unfold/contrib/import_export/templates/admin/import_export/import_errors.html +2 -2
- unfold/contrib/import_export/templates/admin/import_export/import_form.html +2 -2
- unfold/contrib/import_export/templates/admin/import_export/import_preview.html +5 -5
- unfold/contrib/import_export/templates/admin/import_export/import_validation.html +30 -25
- unfold/contrib/import_export/templates/admin/import_export/resource_fields_list.html +5 -3
- unfold/contrib/simple_history/templates/simple_history/object_history.html +2 -2
- unfold/contrib/simple_history/templates/simple_history/object_history_form.html +1 -1
- unfold/contrib/simple_history/templates/simple_history/object_history_list.html +9 -9
- unfold/contrib/simple_history/templates/simple_history/submit_line.html +4 -4
- unfold/forms.py +13 -2
- unfold/settings.py +20 -7
- unfold/sites.py +23 -8
- unfold/static/admin/js/inlines.js +2 -2
- unfold/static/unfold/css/styles.css +1 -1
- unfold/static/unfold/js/alpine.resize.js +1 -0
- unfold/static/unfold/js/app.js +52 -71
- unfold/static/unfold/js/htmx.js +1 -1
- unfold/styles.css +67 -71
- unfold/templates/admin/actions.html +19 -17
- unfold/templates/admin/app_list.html +3 -3
- unfold/templates/admin/auth/user/add_form.html +1 -1
- unfold/templates/admin/auth/user/change_password.html +2 -2
- unfold/templates/admin/base.html +1 -1
- unfold/templates/admin/change_form.html +8 -0
- unfold/templates/admin/change_list.html +24 -30
- unfold/templates/admin/change_list_results.html +40 -6
- unfold/templates/admin/date_hierarchy.html +1 -1
- unfold/templates/admin/delete_confirmation.html +7 -7
- unfold/templates/admin/delete_selected_confirmation.html +7 -7
- unfold/templates/admin/edit_inline/stacked.html +4 -4
- unfold/templates/admin/edit_inline/tabular.html +8 -151
- unfold/templates/admin/filter.html +7 -7
- unfold/templates/admin/includes/fieldset.html +2 -2
- unfold/templates/admin/includes/object_delete_summary.html +1 -1
- unfold/templates/admin/login.html +4 -4
- unfold/templates/admin/nav_sidebar.html +1 -17
- unfold/templates/admin/object_history.html +7 -7
- unfold/templates/admin/pagination.html +36 -30
- unfold/templates/admin/search_form.html +11 -9
- unfold/templates/admin/submit_line.html +11 -11
- unfold/templates/auth/widgets/read_only_password_hash.html +1 -1
- unfold/templates/registration/logged_out.html +3 -3
- unfold/templates/registration/password_change_done.html +1 -1
- unfold/templates/registration/password_change_form.html +1 -1
- unfold/templates/unfold/components/button.html +1 -1
- unfold/templates/unfold/components/card.html +4 -4
- unfold/templates/unfold/components/chart/cohort.html +59 -0
- unfold/templates/unfold/components/navigation.html +2 -2
- unfold/templates/unfold/components/separator.html +1 -1
- unfold/templates/unfold/components/table.html +6 -6
- unfold/templates/unfold/components/tracker.html +5 -0
- unfold/templates/unfold/helpers/account_links.html +6 -6
- unfold/templates/unfold/helpers/actions_row.html +5 -5
- unfold/templates/unfold/helpers/add_link.html +1 -1
- unfold/templates/unfold/helpers/app_list.html +10 -10
- unfold/templates/unfold/helpers/app_list_default.html +10 -10
- unfold/templates/unfold/helpers/boolean.html +1 -1
- unfold/templates/unfold/helpers/breadcrumb_item.html +1 -1
- unfold/templates/unfold/helpers/change_list_actions.html +13 -0
- unfold/templates/unfold/helpers/change_list_filter.html +31 -0
- unfold/templates/unfold/helpers/change_list_filter_actions.html +23 -0
- unfold/templates/unfold/helpers/delete_submit_line.html +2 -2
- unfold/templates/unfold/helpers/display_header.html +3 -3
- unfold/templates/unfold/helpers/edit_inline/tabular_delete.html +13 -0
- unfold/templates/unfold/helpers/edit_inline/tabular_error.html +8 -0
- unfold/templates/unfold/helpers/edit_inline/tabular_field.html +25 -0
- unfold/templates/unfold/helpers/edit_inline/tabular_heading.html +25 -0
- unfold/templates/unfold/helpers/edit_inline/tabular_row.html +27 -0
- unfold/templates/unfold/helpers/edit_inline/tabular_title.html +49 -0
- unfold/templates/unfold/helpers/field_readonly.html +1 -1
- unfold/templates/unfold/helpers/field_readonly_value.html +1 -1
- unfold/templates/unfold/helpers/fieldset_row.html +5 -73
- unfold/templates/unfold/helpers/fieldset_row_checkbox.html +45 -0
- unfold/templates/unfold/helpers/fieldset_row_field.html +21 -0
- unfold/templates/unfold/helpers/fieldsets_tabs.html +2 -2
- unfold/templates/unfold/helpers/header.html +1 -1
- unfold/templates/unfold/helpers/history.html +4 -4
- unfold/templates/unfold/helpers/label.html +1 -1
- unfold/templates/unfold/helpers/language_switch.html +3 -3
- unfold/templates/unfold/helpers/messages/debug.html +3 -0
- unfold/templates/unfold/helpers/messages/error.html +5 -3
- unfold/templates/unfold/helpers/messages/errornote.html +1 -1
- unfold/templates/unfold/helpers/messages/info.html +2 -2
- unfold/templates/unfold/helpers/messages/success.html +3 -0
- unfold/templates/unfold/helpers/messages/warning.html +3 -0
- unfold/templates/unfold/helpers/messages.html +13 -14
- unfold/templates/unfold/helpers/navigation.html +3 -11
- unfold/templates/unfold/helpers/navigation_header.html +13 -0
- unfold/templates/unfold/helpers/pagination_ellipsis.html +1 -1
- unfold/templates/unfold/helpers/search.html +5 -5
- unfold/templates/unfold/helpers/search_results.html +2 -2
- unfold/templates/unfold/helpers/site_icon.html +7 -5
- unfold/templates/unfold/helpers/site_logo.html +1 -1
- unfold/templates/unfold/helpers/submit.html +1 -1
- unfold/templates/unfold/helpers/tab_action.html +2 -2
- unfold/templates/unfold/helpers/tab_list.html +9 -9
- unfold/templates/unfold/helpers/theme_switch.html +5 -5
- unfold/templates/unfold/helpers/userlinks.html +4 -0
- unfold/templates/unfold/helpers/welcomemsg.html +13 -1
- unfold/templates/unfold/layouts/base_simple.html +2 -2
- unfold/templates/unfold/layouts/skeleton.html +12 -6
- unfold/templates/unfold/widgets/clearable_file_input.html +6 -6
- unfold/templates/unfold/widgets/clearable_file_input_small.html +7 -7
- unfold/templates/unfold/widgets/foreign_key_raw_id.html +1 -1
- unfold/templates/unfold/widgets/radio.html +1 -1
- unfold/templates/unfold/widgets/range.html +1 -1
- unfold/templates/unfold/widgets/related_widget_wrapper.html +4 -4
- unfold/templates/unfold/widgets/textarea_expandable.html +1 -1
- unfold/templatetags/unfold.py +130 -7
- unfold/templatetags/unfold_list.py +9 -4
- unfold/widgets.py +31 -28
- django_unfold-0.42.0.dist-info/RECORD +0 -209
- unfold/templates/unfold/change_list_filter.html +0 -59
- {django_unfold-0.42.0.dist-info → django_unfold-0.44.0.dist-info}/LICENSE.md +0 -0
unfold/sites.py
CHANGED
@@ -49,14 +49,23 @@ class UnfoldAdminSite(AdminSite):
|
|
49
49
|
self.site_url = get_config(self.settings_name)["SITE_URL"]
|
50
50
|
|
51
51
|
def get_urls(self) -> List[URLPattern]:
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
52
|
+
extra_urls = []
|
53
|
+
|
54
|
+
if hasattr(self, "extra_urls") and callable(self.extra_urls):
|
55
|
+
extra_urls = self.extra_urls()
|
56
|
+
|
57
|
+
urlpatterns = (
|
58
|
+
[
|
59
|
+
path("search/", self.admin_view(self.search), name="search"),
|
60
|
+
path(
|
61
|
+
"toggle-sidebar/",
|
62
|
+
self.admin_view(self.toggle_sidebar),
|
63
|
+
name="toggle_sidebar",
|
64
|
+
),
|
65
|
+
]
|
66
|
+
+ extra_urls
|
67
|
+
+ super().get_urls()
|
68
|
+
)
|
60
69
|
|
61
70
|
return urlpatterns
|
62
71
|
|
@@ -89,6 +98,9 @@ class UnfoldAdminSite(AdminSite):
|
|
89
98
|
"colors": self._process_colors(
|
90
99
|
get_config(self.settings_name)["COLORS"]
|
91
100
|
),
|
101
|
+
"border_radius": get_config(self.settings_name).get(
|
102
|
+
"BORDER_RADIUS", "6px"
|
103
|
+
),
|
92
104
|
"tab_list": self.get_tabs_list(request),
|
93
105
|
"styles": [
|
94
106
|
self._get_value(style, request)
|
@@ -120,6 +132,9 @@ class UnfoldAdminSite(AdminSite):
|
|
120
132
|
except ImportError:
|
121
133
|
pass
|
122
134
|
|
135
|
+
if hasattr(self, "extra_context") and callable(self.extra_context):
|
136
|
+
return self.extra_context(context, request)
|
137
|
+
|
123
138
|
return context
|
124
139
|
|
125
140
|
def index(
|
@@ -252,9 +252,9 @@
|
|
252
252
|
const showAddButton =
|
253
253
|
maxForms.val() === "" || maxForms.val() - totalForms.val() > 0;
|
254
254
|
if ($this.length && showAddButton) {
|
255
|
-
addButton.parent().show();
|
255
|
+
addButton.parent().parent().show(); // !CHANGED from original
|
256
256
|
} else {
|
257
|
-
addButton.parent().hide();
|
257
|
+
addButton.parent().parent().hide(); // !CHANGED from original
|
258
258
|
}
|
259
259
|
|
260
260
|
return this;
|