django-unfold 0.27.0__tar.gz → 0.28.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {django_unfold-0.27.0 → django_unfold-0.28.0}/PKG-INFO +44 -4
- {django_unfold-0.27.0 → django_unfold-0.28.0}/README.md +43 -3
- {django_unfold-0.27.0 → django_unfold-0.28.0}/pyproject.toml +1 -1
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/admin.py +1 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/forms.py +21 -7
- django_unfold-0.28.0/src/unfold/contrib/import_export/templates/admin/import_export/change_list_export.html +5 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/templates/admin/import_export/export.html +1 -1
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/dataclasses.py +2 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/fields.py +9 -1
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/login.html +4 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/submit_line.html +1 -1
- django_unfold-0.28.0/src/unfold/templates/unfold/helpers/attrs.html +1 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/fieldset_row.html +1 -1
- django_unfold-0.28.0/src/unfold/templates/unfold/helpers/search_results.html +13 -0
- django_unfold-0.28.0/src/unfold/templates/unfold/layouts/base.html +11 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/layouts/base_simple.html +7 -1
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/widgets/clearable_file_input_small.html +1 -1
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/utils.py +21 -1
- django_unfold-0.28.0/src/unfold/views.py +34 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/widgets.py +12 -1
- django_unfold-0.27.0/src/unfold/templates/unfold/helpers/search_results.html +0 -13
- django_unfold-0.27.0/src/unfold/views.py +0 -22
- {django_unfold-0.27.0 → django_unfold-0.28.0}/LICENSE.md +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/__init__.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/apps.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/checks.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/__init__.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/__init__.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/admin.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/apps.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/forms.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/static/unfold/filters/css/nouislider.min.css +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/static/unfold/filters/js/DateTimeShortcuts.js +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/static/unfold/filters/js/admin-numeric-filter.js +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/static/unfold/filters/js/nouislider.min.js +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/static/unfold/filters/js/wNumb.min.js +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_date_range.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_datetime_range.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_field.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_numeric_range.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_numeric_single.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_numeric_slider.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/forms/__init__.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/forms/apps.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/forms/static/unfold/forms/css/trix.css +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/forms/static/unfold/forms/js/trix.config.js +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/forms/static/unfold/forms/js/trix.js +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/forms/templates/unfold/forms/array.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/forms/templates/unfold/forms/helpers/toolbar.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/forms/templates/unfold/forms/wysiwyg.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/forms/widgets.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/guardian/__init__.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/guardian/apps.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/change_form.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/field.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_group.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_user.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/guardian/templates/unfold/guardian/group_form.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/guardian/templates/unfold/guardian/user_form.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/__init__.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/apps.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/templates/admin/import_export/base.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/templates/admin/import_export/change_form.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/templates/admin/import_export/change_list_export_item.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/templates/admin/import_export/change_list_import_export.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/templates/admin/import_export/change_list_import_item.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/templates/admin/import_export/import.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_confirm.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_errors.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_form.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_preview.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_validation.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/import_export/templates/admin/import_export/resource_fields_list.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/inlines/__init__.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/inlines/admin.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/inlines/apps.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/inlines/checks.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/inlines/forms.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/simple_history/__init__.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/simple_history/apps.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/simple_history/templates/simple_history/_object_history_list.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/simple_history/templates/simple_history/object_history.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/simple_history/templates/simple_history/object_history_form.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/contrib/simple_history/templates/simple_history/submit_line.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/decorators.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/exceptions.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/forms.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/settings.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/sites.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/css/simplebar.css +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/css/styles.css +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/fonts/inter/Inter-Bold.woff2 +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/fonts/inter/Inter-Medium.woff2 +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/fonts/inter/Inter-Regular.woff2 +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/fonts/inter/Inter-SemiBold.woff2 +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/fonts/inter/styles.css +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/fonts/material-symbols/Material-Symbols-Outlined.woff2 +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/fonts/material-symbols/styles.css +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/js/alpine.js +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/js/alpine.persist.js +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/js/app.js +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/js/chart.js +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/js/htmx.js +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/static/unfold/js/simplebar.js +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/styles.css +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/actions.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/app_index.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/app_list.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/auth/user/add_form.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/auth/user/change_password.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/base.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/base_site.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/change_form.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/change_form_object_tools.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/change_list.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/change_list_object_tools.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/change_list_results.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/date_hierarchy.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/delete_confirmation.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/delete_selected_confirmation.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/edit_inline/stacked.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/edit_inline/tabular.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/filter.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/includes/fieldset.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/includes/object_delete_summary.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/index.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/nav_sidebar.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/object_history.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/pagination.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/admin/search_form.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/auth/widgets/read_only_password_hash.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/registration/logged_out.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/registration/password_change_done.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/registration/password_change_form.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/change_list_filter.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/components/card.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/components/chart/bar.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/components/chart/line.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/components/container.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/components/flex.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/components/navigation.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/components/progress.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/components/separator.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/components/text.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/components/title.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/account_links.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/actions_row.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/add_link.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/app_list.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/app_list_default.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/boolean.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/breadcrumb_item.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/display_header.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/display_label.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/field.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/field_readonly.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/field_readonly_value.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/fieldsets_tabs.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/form_errors.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/form_label.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/header.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/help_text.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/history.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/label.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/messages/error.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/messages/errornote.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/messages/info.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/messages.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/navigation.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/pagination_current_item.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/pagination_ellipsis.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/search.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/site_icon.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/site_logo.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/submit.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/tab_action.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/tab_list.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/theme_switch.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/userlinks.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/welcomemsg.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/layouts/skeleton.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/widgets/clearable_file_input.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/widgets/date.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/widgets/foreign_key_raw_id.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/widgets/radio.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/widgets/radio_option.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/widgets/range.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/widgets/related_widget_wrapper.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/widgets/split_datetime.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/widgets/split_datetime_vertical.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/widgets/split_money.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/widgets/textarea.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/widgets/textarea_expandable.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/widgets/time.html +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templatetags/__init__.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templatetags/unfold.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templatetags/unfold_list.py +0 -0
- {django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/typing.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: django-unfold
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.28.0
|
4
4
|
Summary: Modern Django admin theme for seamless interface development
|
5
5
|
Home-page: https://unfoldadmin.com
|
6
6
|
License: MIT
|
@@ -35,13 +35,13 @@ Description-Content-Type: text/markdown
|
|
35
35
|
|
36
36
|
Unfold is theme for Django admin incorporating most common practises for building full-fledged admin areas. It is designed to work at the top of default administration provided by Django.
|
37
37
|
|
38
|
-
- **Unfold:** demo site is available at [unfoldadmin.com](https://unfoldadmin.com)
|
38
|
+
- **Unfold:** demo site is available at [unfoldadmin.com](https://unfoldadmin.com?utm_medium=github&utm_source=unfold)
|
39
39
|
- **Formula:** repository with demo implementation at [github.com/unfoldadmin/formula](https://github.com/unfoldadmin/formula)
|
40
40
|
- **Turbo:** Django & Next.js boilerplate implementing Unfold at [github.com/unfoldadmin/turbo](https://github.com/unfoldadmin/turbo)
|
41
41
|
|
42
42
|
## Are you using Unfold and need a help?<!-- omit from toc -->
|
43
43
|
|
44
|
-
Did you decide to start using Unfold but you don't have time to make the switch from native Django admin? [Get in touch with us](https://unfoldadmin.com
|
44
|
+
Did you decide to start using Unfold but you don't have time to make the switch from native Django admin? [Get in touch with us](https://unfoldadmin.com/?utm_medium=github&utm_source=unfold) and let's supercharge development by using our know-how.
|
45
45
|
|
46
46
|
## Features <!-- omit from toc -->
|
47
47
|
|
@@ -62,7 +62,7 @@ Did you decide to start using Unfold but you don't have time to make the switch
|
|
62
62
|
- **Third party packages:** default support for multiple popular applications
|
63
63
|
- **Environment label**: distinguish between environments by displaying a label
|
64
64
|
- **Nonrelated inlines**: displays nonrelated model as inline in changeform
|
65
|
-
- **Parallel admin**: support for default admin in parallel with Unfold. [Admin migration guide](https://unfoldadmin.com/blog/migrating-django-admin-unfold
|
65
|
+
- **Parallel admin**: support for default admin in parallel with Unfold. [Admin migration guide](https://unfoldadmin.com/blog/migrating-django-admin-unfold/?utm_medium=github&utm_source=unfold)
|
66
66
|
- **VS Code**: project configuration and development container is included
|
67
67
|
|
68
68
|
## Table of contents <!-- omit from toc -->
|
@@ -81,6 +81,7 @@ Did you decide to start using Unfold but you don't have time to make the switch
|
|
81
81
|
- [Dropdown filters](#dropdown-filters)
|
82
82
|
- [Numeric filters](#numeric-filters)
|
83
83
|
- [Date/time filters](#datetime-filters)
|
84
|
+
- [Custom admin pages](#custom-admin-pages)
|
84
85
|
- [Nonrelated inlines](#nonrelated-inlines)
|
85
86
|
- [Display decorator](#display-decorator)
|
86
87
|
- [Change form tabs](#change-form-tabs)
|
@@ -645,6 +646,45 @@ class YourModelAdmin(ModelAdmin):
|
|
645
646
|
)
|
646
647
|
```
|
647
648
|
|
649
|
+
## Custom admin pages
|
650
|
+
|
651
|
+
By default, Unfold provides a basic view mixin which helps with creation of basic views which are part of Unfold UI. The implementation requires creation of class based view inheriting from `unfold.views.UnfoldModelAdminViewMixin`. It is important to add `title` and `permissions_required` properties.
|
652
|
+
|
653
|
+
```python
|
654
|
+
# admin.py
|
655
|
+
|
656
|
+
from django.views.generic import TemplateView
|
657
|
+
from unfold.admin import ModelAdmin
|
658
|
+
from unfold.views import UnfoldModelAdminViewMixin
|
659
|
+
|
660
|
+
|
661
|
+
class MyClassBasedView(UnfoldModelAdminViewMixin, TemplateView):
|
662
|
+
title = "Custom Title" # required: custom page header title
|
663
|
+
permissions_required = () # required: tuple of permissions
|
664
|
+
template_name = "some/template/path.html"
|
665
|
+
|
666
|
+
|
667
|
+
class CustomAdmin(ModelAdmin):
|
668
|
+
def get_urls(self):
|
669
|
+
return super().get_urls() + [
|
670
|
+
path(
|
671
|
+
"custom-url-path",
|
672
|
+
MyClassBasedView.as_view(model_admin=self), # IMPORTANT: model_admin is required
|
673
|
+
name="custom_name"
|
674
|
+
),
|
675
|
+
]
|
676
|
+
```
|
677
|
+
|
678
|
+
The template is straightforward, extend from `unfold/layouts/base.html` and the UI will display all Unfold components like header or sidebar with all menu items. Then all content needs to be located in `content` block.
|
679
|
+
|
680
|
+
```django-html
|
681
|
+
{% extends "unfold/layouts/base.html" %}
|
682
|
+
|
683
|
+
{% block content %}
|
684
|
+
Content here
|
685
|
+
{% endblock %}
|
686
|
+
```
|
687
|
+
|
648
688
|
## Nonrelated inlines
|
649
689
|
|
650
690
|
To display inlines which are not related (no foreign key pointing at the main model) to the model instance in changeform, you can use nonrelated inlines which are included in `unfold.contrib.inlines` module. Make sure this module is included in `INSTALLED_APPS` in settings.py.
|
@@ -11,13 +11,13 @@
|
|
11
11
|
|
12
12
|
Unfold is theme for Django admin incorporating most common practises for building full-fledged admin areas. It is designed to work at the top of default administration provided by Django.
|
13
13
|
|
14
|
-
- **Unfold:** demo site is available at [unfoldadmin.com](https://unfoldadmin.com)
|
14
|
+
- **Unfold:** demo site is available at [unfoldadmin.com](https://unfoldadmin.com?utm_medium=github&utm_source=unfold)
|
15
15
|
- **Formula:** repository with demo implementation at [github.com/unfoldadmin/formula](https://github.com/unfoldadmin/formula)
|
16
16
|
- **Turbo:** Django & Next.js boilerplate implementing Unfold at [github.com/unfoldadmin/turbo](https://github.com/unfoldadmin/turbo)
|
17
17
|
|
18
18
|
## Are you using Unfold and need a help?<!-- omit from toc -->
|
19
19
|
|
20
|
-
Did you decide to start using Unfold but you don't have time to make the switch from native Django admin? [Get in touch with us](https://unfoldadmin.com
|
20
|
+
Did you decide to start using Unfold but you don't have time to make the switch from native Django admin? [Get in touch with us](https://unfoldadmin.com/?utm_medium=github&utm_source=unfold) and let's supercharge development by using our know-how.
|
21
21
|
|
22
22
|
## Features <!-- omit from toc -->
|
23
23
|
|
@@ -38,7 +38,7 @@ Did you decide to start using Unfold but you don't have time to make the switch
|
|
38
38
|
- **Third party packages:** default support for multiple popular applications
|
39
39
|
- **Environment label**: distinguish between environments by displaying a label
|
40
40
|
- **Nonrelated inlines**: displays nonrelated model as inline in changeform
|
41
|
-
- **Parallel admin**: support for default admin in parallel with Unfold. [Admin migration guide](https://unfoldadmin.com/blog/migrating-django-admin-unfold
|
41
|
+
- **Parallel admin**: support for default admin in parallel with Unfold. [Admin migration guide](https://unfoldadmin.com/blog/migrating-django-admin-unfold/?utm_medium=github&utm_source=unfold)
|
42
42
|
- **VS Code**: project configuration and development container is included
|
43
43
|
|
44
44
|
## Table of contents <!-- omit from toc -->
|
@@ -57,6 +57,7 @@ Did you decide to start using Unfold but you don't have time to make the switch
|
|
57
57
|
- [Dropdown filters](#dropdown-filters)
|
58
58
|
- [Numeric filters](#numeric-filters)
|
59
59
|
- [Date/time filters](#datetime-filters)
|
60
|
+
- [Custom admin pages](#custom-admin-pages)
|
60
61
|
- [Nonrelated inlines](#nonrelated-inlines)
|
61
62
|
- [Display decorator](#display-decorator)
|
62
63
|
- [Change form tabs](#change-form-tabs)
|
@@ -621,6 +622,45 @@ class YourModelAdmin(ModelAdmin):
|
|
621
622
|
)
|
622
623
|
```
|
623
624
|
|
625
|
+
## Custom admin pages
|
626
|
+
|
627
|
+
By default, Unfold provides a basic view mixin which helps with creation of basic views which are part of Unfold UI. The implementation requires creation of class based view inheriting from `unfold.views.UnfoldModelAdminViewMixin`. It is important to add `title` and `permissions_required` properties.
|
628
|
+
|
629
|
+
```python
|
630
|
+
# admin.py
|
631
|
+
|
632
|
+
from django.views.generic import TemplateView
|
633
|
+
from unfold.admin import ModelAdmin
|
634
|
+
from unfold.views import UnfoldModelAdminViewMixin
|
635
|
+
|
636
|
+
|
637
|
+
class MyClassBasedView(UnfoldModelAdminViewMixin, TemplateView):
|
638
|
+
title = "Custom Title" # required: custom page header title
|
639
|
+
permissions_required = () # required: tuple of permissions
|
640
|
+
template_name = "some/template/path.html"
|
641
|
+
|
642
|
+
|
643
|
+
class CustomAdmin(ModelAdmin):
|
644
|
+
def get_urls(self):
|
645
|
+
return super().get_urls() + [
|
646
|
+
path(
|
647
|
+
"custom-url-path",
|
648
|
+
MyClassBasedView.as_view(model_admin=self), # IMPORTANT: model_admin is required
|
649
|
+
name="custom_name"
|
650
|
+
),
|
651
|
+
]
|
652
|
+
```
|
653
|
+
|
654
|
+
The template is straightforward, extend from `unfold/layouts/base.html` and the UI will display all Unfold components like header or sidebar with all menu items. Then all content needs to be located in `content` block.
|
655
|
+
|
656
|
+
```django-html
|
657
|
+
{% extends "unfold/layouts/base.html" %}
|
658
|
+
|
659
|
+
{% block content %}
|
660
|
+
Content here
|
661
|
+
{% endblock %}
|
662
|
+
```
|
663
|
+
|
624
664
|
## Nonrelated inlines
|
625
665
|
|
626
666
|
To display inlines which are not related (no foreign key pointing at the main model) to the model instance in changeform, you can use nonrelated inlines which are included in `unfold.contrib.inlines` module. Make sure this module is included in `INSTALLED_APPS` in settings.py.
|
@@ -464,6 +464,7 @@ class ModelAdmin(ModelAdminMixin, BaseModelAdmin):
|
|
464
464
|
method=method,
|
465
465
|
description=self._get_action_description(method, action),
|
466
466
|
path=self._get_action_url(method, action),
|
467
|
+
attrs=method.attrs if hasattr(method, "attrs") else None,
|
467
468
|
)
|
468
469
|
|
469
470
|
@staticmethod
|
@@ -15,23 +15,37 @@ class ImportForm(BaseImportForm):
|
|
15
15
|
def __init__(self, *args, **kwargs):
|
16
16
|
super().__init__(*args, **kwargs)
|
17
17
|
|
18
|
-
self.fields["resource"].widget.attrs["class"] = " ".join(
|
19
|
-
|
20
|
-
|
18
|
+
self.fields["resource"].widget.attrs["class"] = " ".join(
|
19
|
+
[self.fields["resource"].widget.attrs.get("class", ""), *SELECT_CLASSES]
|
20
|
+
)
|
21
|
+
self.fields["import_file"].widget = UnfoldAdminFileFieldWidget(
|
22
|
+
attrs=self.fields["import_file"].widget.attrs
|
23
|
+
)
|
24
|
+
self.fields["format"].widget.attrs["class"] = " ".join(
|
25
|
+
[self.fields["format"].widget.attrs.get("class", ""), *SELECT_CLASSES]
|
26
|
+
)
|
21
27
|
|
22
28
|
|
23
29
|
class ExportForm(BaseExportForm):
|
24
30
|
def __init__(self, *args, **kwargs):
|
25
31
|
super().__init__(*args, **kwargs)
|
26
|
-
self.fields["resource"].widget.attrs["class"] = " ".join(
|
27
|
-
|
32
|
+
self.fields["resource"].widget.attrs["class"] = " ".join(
|
33
|
+
[self.fields["resource"].widget.attrs.get("class", ""), *SELECT_CLASSES]
|
34
|
+
)
|
35
|
+
self.fields["format"].widget.attrs["class"] = " ".join(
|
36
|
+
[self.fields["format"].widget.attrs.get("class", ""), *SELECT_CLASSES]
|
37
|
+
)
|
28
38
|
|
29
39
|
|
30
40
|
class SelectableFieldsExportForm(BaseSelectableFieldsExportForm):
|
31
41
|
def __init__(self, formats, resources, **kwargs):
|
32
42
|
super().__init__(formats, resources, **kwargs)
|
33
|
-
self.fields["resource"].widget.attrs["class"] = " ".join(
|
34
|
-
|
43
|
+
self.fields["resource"].widget.attrs["class"] = " ".join(
|
44
|
+
[self.fields["resource"].widget.attrs.get("class", ""), *SELECT_CLASSES]
|
45
|
+
)
|
46
|
+
self.fields["format"].widget.attrs["class"] = " ".join(
|
47
|
+
[self.fields["format"].widget.attrs.get("class", ""), *SELECT_CLASSES]
|
48
|
+
)
|
35
49
|
|
36
50
|
for _key, field in self.fields.items():
|
37
51
|
if isinstance(field, BooleanField):
|
@@ -54,7 +54,7 @@
|
|
54
54
|
|
55
55
|
<fieldset class="border border-gray-200 mb-4 rounded-md pt-3 px-3 shadow-sm dark:border-gray-800">
|
56
56
|
{% for field in form.visible_fields %}
|
57
|
-
<div {% if field.field.is_selectable_field %}class="selectable-field-export-row" resource-index="{{ field.field.resource_index }}"{%
|
57
|
+
<div {% if field.field.is_selectable_field %}class="selectable-field-export-row" resource-index="{{ field.field.resource_index }}"{% endif %}>
|
58
58
|
{% if field.field.initial_field %}
|
59
59
|
<p class="block font-medium mb-2 text-gray-900 text-sm dark:text-gray-200">
|
60
60
|
{% trans "This exporter will export the following fields" %}
|
@@ -18,7 +18,7 @@ from django.utils.safestring import SafeText, mark_safe
|
|
18
18
|
from django.utils.text import capfirst
|
19
19
|
|
20
20
|
from .settings import get_config
|
21
|
-
from .utils import display_for_field
|
21
|
+
from .utils import display_for_field, prettify_json
|
22
22
|
from .widgets import CHECKBOX_LABEL_CLASSES, LABEL_CLASSES
|
23
23
|
|
24
24
|
|
@@ -138,6 +138,14 @@ class UnfoldAdminReadonlyField(helpers.AdminReadonlyField):
|
|
138
138
|
and value is not None
|
139
139
|
):
|
140
140
|
result_repr = self.get_admin_url(f.remote_field, value)
|
141
|
+
elif isinstance(f, models.JSONField):
|
142
|
+
formatted_output = prettify_json(value)
|
143
|
+
|
144
|
+
if formatted_output:
|
145
|
+
return formatted_output
|
146
|
+
|
147
|
+
result_repr = display_for_field(value, f, self.empty_value_display)
|
148
|
+
return conditional_escape(result_repr)
|
141
149
|
elif isinstance(f, models.URLField):
|
142
150
|
return format_html(
|
143
151
|
'<a href="{}" class="text-primary-600 underline whitespace-nowrap">{}</a>',
|
@@ -45,6 +45,8 @@
|
|
45
45
|
{% include "unfold/helpers/messages/error.html" with error=message %}
|
46
46
|
{% endif %}
|
47
47
|
|
48
|
+
{% block login_before %}{% endblock %}
|
49
|
+
|
48
50
|
<form action="{{ app_path }}" method="post" id="login-form">
|
49
51
|
{% csrf_token %}
|
50
52
|
|
@@ -70,6 +72,8 @@
|
|
70
72
|
</button>
|
71
73
|
</div>
|
72
74
|
</form>
|
75
|
+
|
76
|
+
{% block login_after %}{% endblock %}
|
73
77
|
</div>
|
74
78
|
|
75
79
|
<div class="absolute flex flex-row items-center justify-between left-0 m-4 right-0 top-0">
|
@@ -12,7 +12,7 @@
|
|
12
12
|
{% endif %}
|
13
13
|
|
14
14
|
{% for action in actions_submit_line %}
|
15
|
-
<button type="submit" name="{{ action.action_name }}" class="border font-medium px-3 py-2 rounded-md text-sm text-gray-500 transition-all
|
15
|
+
<button type="submit" {% if not action.attrs.name %}name="{{ action.action_name }}"{% endif %} class="border font-medium px-3 py-2 rounded-md text-sm text-gray-500 transition-all w-full hover:bg-gray-50 lg:w-auto dark:border-gray-700 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-900" {% include "unfold/helpers/attrs.html" with attrs=action.attrs %}>
|
16
16
|
{{ action.description }}
|
17
17
|
</button>
|
18
18
|
{% endfor %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% for name, value in attrs.items %}{% if value is not False %} {{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}{% endif %}{% endfor %}
|
{django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/helpers/fieldset_row.html
RENAMED
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="form-row
|
2
|
-
{% if adminform.model_admin.compressed_fields %} border-b border-gray-200 -mx-3 px-3 pt-3 first:pt-0 last:border-b-0{% endif %}
|
2
|
+
{% if adminform.model_admin.compressed_fields %} border-b border-gray-200 -mx-3 px-3 pt-3 first:pt-0 dark:border-gray-800 last:border-b-0{% endif %}
|
3
3
|
{% if not line.fields|length == 1 %} flex flex-row flex-wrap gap-x-8{% endif %}
|
4
4
|
{% if not line.has_visible_field %} hidden{% endif %}
|
5
5
|
{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{% if results %}
|
2
|
+
<ul class="absolute bg-white border left-0 mt-12 right-0 rounded top-0 shadow-sm text-sm z-10 dark:bg-gray-800 dark:border-gray-700">
|
3
|
+
{% for app in results %}
|
4
|
+
{% for model in app.models %}
|
5
|
+
<li>
|
6
|
+
<a href="{{ model.admin_url }}" class="block group overflow-hidden px-3 py-2 text-gray-500 text-ellipsis whitespace-nowrap hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200">
|
7
|
+
{{ app.name }} <span class="align-text-top material-symbols-outlined md-18 text-gray-300 group-hover:text-gray-400 dark:text-gray-600">arrow_right_alt</span> {{ model.name }}
|
8
|
+
</a>
|
9
|
+
</li>
|
10
|
+
{% endfor %}
|
11
|
+
{% endfor %}
|
12
|
+
</ul>
|
13
|
+
{% endif %}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
{% extends "unfold/layouts/base_simple.html" %}
|
2
|
+
|
3
|
+
{% block branding %}
|
4
|
+
<h1 id="site-name">
|
5
|
+
<a href="{% url 'admin:index' %}">
|
6
|
+
{{ site_header|default:_('Django administration') }}
|
7
|
+
</a>
|
8
|
+
</h1>
|
9
|
+
{% endblock %}
|
10
|
+
|
11
|
+
{% block title %}{% if subtitle %}{{ subtitle }} | {% endif %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}
|
{django_unfold-0.27.0 → django_unfold-0.28.0}/src/unfold/templates/unfold/layouts/base_simple.html
RENAMED
@@ -15,7 +15,13 @@
|
|
15
15
|
{% include "unfold/helpers/header.html" %}
|
16
16
|
{% endblock %}
|
17
17
|
|
18
|
-
|
18
|
+
{% if not is_popup %}
|
19
|
+
{% spaceless %}
|
20
|
+
{% block breadcrumbs %}{% endblock %}
|
21
|
+
{% endspaceless %}
|
22
|
+
{% endif %}
|
23
|
+
|
24
|
+
<div class="px-4 lg:px-12">
|
19
25
|
<div id="content" class="container mx-auto {% block coltype %}colM{% endblock %}">
|
20
26
|
{% block content %}
|
21
27
|
{% block object-tools %}{% endblock %}
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<input type="text" 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-400{% else %}text-gray-300 dark:text-gray-400{% endif %}">
|
18
18
|
|
19
19
|
<div class="flex flex-none items-center leading-none self-stretch">
|
20
|
-
<input id="{{ widget.name }}" type="{{ widget.type }}" name="{{ widget.name }}" class="
|
20
|
+
<input id="{{ widget.name }}" type="{{ widget.type }}" name="{{ widget.name }}" class="{{ widget.file_input_class }}" {% include "django/forms/widgets/attrs.html" %} />
|
21
21
|
|
22
22
|
<label for="{{ widget.name }}" class="cursor-pointer text-gray-400 px-3 hover:text-gray-700 dark:text-gray-500 dark:hover:text-gray-200">
|
23
23
|
<span class="material-symbols-outlined">file_upload</span>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import datetime
|
2
2
|
import decimal
|
3
3
|
import json
|
4
|
-
from typing import Any, Iterable, List
|
4
|
+
from typing import Any, Iterable, List, Optional
|
5
5
|
|
6
6
|
from django.db import models
|
7
7
|
from django.template.loader import render_to_string
|
@@ -121,3 +121,23 @@ def hex_to_rgb(hex_color: str) -> List[int]:
|
|
121
121
|
b = int(hex_color[4:6], 16)
|
122
122
|
|
123
123
|
return (r, g, b)
|
124
|
+
|
125
|
+
|
126
|
+
def prettify_json(data: Any) -> Optional[str]:
|
127
|
+
try:
|
128
|
+
from pygments import highlight
|
129
|
+
from pygments.formatters import HtmlFormatter
|
130
|
+
from pygments.lexers import JsonLexer
|
131
|
+
except ImportError:
|
132
|
+
return None
|
133
|
+
|
134
|
+
def format_response(response: str, theme: str) -> str:
|
135
|
+
formatter = HtmlFormatter(style=theme, noclasses=True, nobackground=True)
|
136
|
+
return highlight(response, JsonLexer(), formatter)
|
137
|
+
|
138
|
+
response = json.dumps(data, sort_keys=True, indent=4)
|
139
|
+
|
140
|
+
return mark_safe(
|
141
|
+
f'<div class="block dark:hidden">{format_response(response, "colorful")}</div>'
|
142
|
+
f'<div class="hidden dark:block">{format_response(response, "monokai")}</div>'
|
143
|
+
)
|
@@ -0,0 +1,34 @@
|
|
1
|
+
from typing import Any, Dict
|
2
|
+
|
3
|
+
from django.contrib.auth.mixins import PermissionRequiredMixin
|
4
|
+
|
5
|
+
from .exceptions import UnfoldException
|
6
|
+
|
7
|
+
|
8
|
+
class UnfoldModelAdminViewMixin(PermissionRequiredMixin):
|
9
|
+
"""
|
10
|
+
Prepares views to be displayed in admin
|
11
|
+
"""
|
12
|
+
|
13
|
+
model_admin = None
|
14
|
+
|
15
|
+
def __init__(self, model_admin, **kwargs):
|
16
|
+
self.model_admin = model_admin
|
17
|
+
super().__init__(**kwargs)
|
18
|
+
|
19
|
+
def get_context_data(self, **kwargs: Any) -> Dict[str, Any]:
|
20
|
+
if not hasattr(self, "model_admin"):
|
21
|
+
raise UnfoldException(
|
22
|
+
"UnfoldModelAdminViewMixin was not provided with 'model_admin' argument"
|
23
|
+
)
|
24
|
+
|
25
|
+
if not hasattr(self, "title"):
|
26
|
+
raise UnfoldException(
|
27
|
+
"UnfoldModelAdminViewMixin was not provided with 'title' attribute"
|
28
|
+
)
|
29
|
+
|
30
|
+
return super().get_context_data(
|
31
|
+
**kwargs,
|
32
|
+
**self.model_admin.admin_site.each_context(self.request),
|
33
|
+
**{"title": self.title},
|
34
|
+
)
|
@@ -288,7 +288,18 @@ class FileFieldMixin:
|
|
288
288
|
def get_context(self, name, value, attrs):
|
289
289
|
widget = super().get_context(name, value, attrs)
|
290
290
|
widget["widget"].update(
|
291
|
-
{
|
291
|
+
{
|
292
|
+
"class": " ".join([*CHECKBOX_CLASSES, *["form-check-input"]]),
|
293
|
+
"file_input_class": " ".join(
|
294
|
+
[
|
295
|
+
self.attrs.get("class", ""),
|
296
|
+
*[
|
297
|
+
"opacity-0",
|
298
|
+
"pointer-events-none",
|
299
|
+
],
|
300
|
+
]
|
301
|
+
),
|
302
|
+
}
|
292
303
|
)
|
293
304
|
return widget
|
294
305
|
|
@@ -1,13 +0,0 @@
|
|
1
|
-
{% if results %}
|
2
|
-
<ul class="absolute bg-white border left-0 mt-12 right-0 rounded top-0 shadow-sm text-sm dark:bg-gray-800 dark:border-gray-700">
|
3
|
-
{% for app in results %}
|
4
|
-
{% for model in app.models %}
|
5
|
-
<li>
|
6
|
-
<a href="{{ model.admin_url }}" class="block group overflow-hidden px-3 py-2 text-gray-500 text-ellipsis whitespace-nowrap hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200">
|
7
|
-
{{ app.name }} <span class="align-text-top material-symbols-outlined md-18 text-gray-300 group-hover:text-gray-400 dark:text-gray-600">arrow_right_alt</span> {{ model.name }}
|
8
|
-
</a>
|
9
|
-
</li>
|
10
|
-
{% endfor %}
|
11
|
-
{% endfor %}
|
12
|
-
</ul>
|
13
|
-
{% endif %}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
from typing import Any, Dict
|
2
|
-
|
3
|
-
from django.contrib.auth.mixins import PermissionRequiredMixin
|
4
|
-
|
5
|
-
from .exceptions import UnfoldException
|
6
|
-
|
7
|
-
|
8
|
-
class UnfoldModelAdminViewMixin(PermissionRequiredMixin):
|
9
|
-
"""
|
10
|
-
Prepares views to be displayed in admin
|
11
|
-
"""
|
12
|
-
|
13
|
-
def get_context_data(self, **kwargs) -> Dict[str, Any]:
|
14
|
-
if "model_admin" not in self.kwargs:
|
15
|
-
raise UnfoldException(
|
16
|
-
"UnfoldModelAdminViewMixin was not provided with 'model_admin' argument"
|
17
|
-
)
|
18
|
-
model_admin = self.kwargs["model_admin"]
|
19
|
-
context_data = super().get_context_data(
|
20
|
-
**kwargs, **model_admin.admin_site.each_context(self.request)
|
21
|
-
)
|
22
|
-
return context_data
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|