django-unfold 0.23.0__tar.gz → 0.24.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {django_unfold-0.23.0 → django_unfold-0.24.0}/PKG-INFO +97 -4
- {django_unfold-0.23.0 → django_unfold-0.24.0}/README.md +96 -3
- {django_unfold-0.23.0 → django_unfold-0.24.0}/pyproject.toml +2 -2
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/admin.py +3 -3
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/filters/admin.py +116 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/filters/forms.py +29 -1
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_date_range.html +1 -1
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_datetime_range.html +1 -1
- django_unfold-0.24.0/src/unfold/contrib/filters/templates/unfold/filters/filters_field.html +7 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_numeric_range.html +1 -1
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_numeric_single.html +1 -1
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_numeric_slider.html +1 -1
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/import_export/admin.py +1 -1
- django_unfold-0.24.0/src/unfold/contrib/import_export/forms.py +15 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/import_export/templates/admin/import_export/export.html +1 -1
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_form.html +2 -2
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/filter.html +2 -2
- django_unfold-0.24.0/src/unfold/templates/unfold/helpers/display_header.html +20 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/widgets.py +2 -2
- django_unfold-0.23.0/src/unfold/contrib/import_export/forms.py +0 -16
- django_unfold-0.23.0/src/unfold/templates/unfold/helpers/display_header.html +0 -17
- {django_unfold-0.23.0 → django_unfold-0.24.0}/LICENSE.md +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/__init__.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/apps.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/checks.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/__init__.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/filters/__init__.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/filters/apps.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/filters/static/unfold/filters/css/nouislider.min.css +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/filters/static/unfold/filters/js/DateTimeShortcuts.js +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/filters/static/unfold/filters/js/admin-numeric-filter.js +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/filters/static/unfold/filters/js/nouislider.min.js +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/filters/static/unfold/filters/js/wNumb.min.js +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/forms/__init__.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/forms/apps.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/forms/static/unfold/forms/css/trix.css +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/forms/static/unfold/forms/js/trix.config.js +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/forms/static/unfold/forms/js/trix.js +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/forms/templates/unfold/forms/helpers/toolbar.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/forms/templates/unfold/forms/wysiwyg.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/forms/widgets.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/guardian/__init__.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/guardian/apps.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/change_form.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/field.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_group.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_user.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/guardian/templates/unfold/guardian/group_form.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/guardian/templates/unfold/guardian/user_form.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/import_export/__init__.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/import_export/apps.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/import_export/templates/admin/import_export/base.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/import_export/templates/admin/import_export/change_list_export_item.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/import_export/templates/admin/import_export/change_list_import_export.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/import_export/templates/admin/import_export/change_list_import_item.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/import_export/templates/admin/import_export/import.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_confirm.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_errors.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_preview.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_validation.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/simple_history/__init__.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/simple_history/apps.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/simple_history/templates/simple_history/_object_history_list.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/simple_history/templates/simple_history/object_history.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/simple_history/templates/simple_history/object_history_form.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/contrib/simple_history/templates/simple_history/submit_line.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/dataclasses.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/decorators.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/exceptions.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/forms.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/settings.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/sites.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/static/unfold/css/styles.css +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/static/unfold/fonts/inter/Inter-Bold.woff2 +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/static/unfold/fonts/inter/Inter-Medium.woff2 +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/static/unfold/fonts/inter/Inter-Regular.woff2 +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/static/unfold/fonts/inter/Inter-SemiBold.woff2 +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/static/unfold/fonts/inter/styles.css +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/static/unfold/fonts/material-symbols/Material-Symbols-Outlined.woff2 +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/static/unfold/fonts/material-symbols/styles.css +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/static/unfold/js/alpine.js +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/static/unfold/js/alpine.persist.js +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/static/unfold/js/app.js +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/static/unfold/js/chart.js +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/static/unfold/js/htmx.js +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/styles.css +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/actions.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/app_index.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/app_list.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/auth/user/add_form.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/auth/user/change_password.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/base.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/base_site.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/change_form.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/change_form_object_tools.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/change_list.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/change_list_object_tools.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/change_list_results.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/date_hierarchy.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/delete_confirmation.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/delete_selected_confirmation.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/edit_inline/stacked.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/edit_inline/tabular.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/includes/fieldset.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/includes/object_delete_summary.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/index.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/login.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/nav_sidebar.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/object_history.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/pagination.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/search_form.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/admin/submit_line.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/auth/widgets/read_only_password_hash.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/registration/logged_out.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/registration/password_change_done.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/registration/password_change_form.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/change_list_filter.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/components/card.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/components/chart/bar.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/components/chart/line.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/components/container.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/components/flex.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/components/navigation.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/components/progress.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/components/separator.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/components/text.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/components/title.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/account_links.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/actions_row.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/add_link.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/app_list.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/app_list_default.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/boolean.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/breadcrumb_item.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/display_label.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/field.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/field_readonly.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/fieldsets_tabs.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/form_errors.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/form_label.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/header.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/help_text.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/history.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/label.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/messages/error.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/messages/errornote.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/messages/info.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/messages.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/navigation.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/pagination_current_item.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/pagination_ellipsis.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/search.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/search_results.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/site_icon.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/site_logo.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/submit.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/tab_action.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/tab_list.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/theme_switch.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/userlinks.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/helpers/welcomemsg.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/layouts/base_simple.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/layouts/skeleton.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/widgets/clearable_file_input.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/widgets/clearable_file_input_small.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/widgets/date.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/widgets/radio.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/widgets/radio_option.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/widgets/range.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/widgets/related_widget_wrapper.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/widgets/split_datetime.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/widgets/split_datetime_vertical.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/widgets/split_money.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/widgets/textarea.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templates/unfold/widgets/time.html +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templatetags/__init__.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templatetags/unfold.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/templatetags/unfold_list.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/typing.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/utils.py +0 -0
- {django_unfold-0.23.0 → django_unfold-0.24.0}/src/unfold/views.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: django-unfold
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.24.0
|
4
4
|
Summary: Modern Django admin theme for seamless interface development
|
5
5
|
Home-page: https://unfoldadmin.com
|
6
6
|
License: MIT
|
@@ -52,14 +52,14 @@ Did you decide to start using Unfold but you don't have time to make the switch
|
|
52
52
|
- **Dependencies:** completely based only on `django.contrib.admin`
|
53
53
|
- **Actions:** multiple ways how to define actions within different parts of admin
|
54
54
|
- **WYSIWYG:** built-in support for WYSIWYG (Trix)
|
55
|
-
- **
|
55
|
+
- **Filters:** custom dropdown, numeric, datetime, and text fields
|
56
56
|
- **Dashboard:** custom components for rapid dashboard development
|
57
57
|
- **Model tabs:** define custom tab navigations for models
|
58
58
|
- **Fieldset tabs:** merge several fielsets into tabs in change form
|
59
59
|
- **Colors:** possibility to override default color scheme
|
60
60
|
- **Third party packages:** default support for multiple popular applications
|
61
61
|
- **Environment label**: distinguish between environments by displaying a label
|
62
|
-
- **Parallel admin**: support for having default admin in parallel with Unfold
|
62
|
+
- **Parallel admin**: support for having default admin in parallel with Unfold. [Admin migration guide](https://unfoldadmin.com/blog/migrating-django-admin-unfold/)
|
63
63
|
- **VS Code**: project configuration and development container is included
|
64
64
|
|
65
65
|
## Table of contents <!-- omit from toc -->
|
@@ -74,6 +74,8 @@ Did you decide to start using Unfold but you don't have time to make the switch
|
|
74
74
|
- [Action handler functions](#action-handler-functions)
|
75
75
|
- [Action examples](#action-examples)
|
76
76
|
- [Filters](#filters)
|
77
|
+
- [Text filters](#text-filters)
|
78
|
+
- [Dropdown filters](#dropdown-filters)
|
77
79
|
- [Numeric filters](#numeric-filters)
|
78
80
|
- [Date/time filters](#datetime-filters)
|
79
81
|
- [Display decorator](#display-decorator)
|
@@ -481,6 +483,88 @@ By default, Django admin handles all filters as regular HTML links pointing at t
|
|
481
483
|
|
482
484
|
**Note:** when implementing a filter which contains input fields, there is a no way that user can submit the values, because default filters does not contain submit button. To implement submit button, `unfold.admin.ModelAdmin` contains boolean `list_filter_submit` flag which enables submit button in filter form.
|
483
485
|
|
486
|
+
### Text filters
|
487
|
+
|
488
|
+
Text input field which allows filtering by the free string submitted by the user. There are two different variants of this filter: `FieldTextFilter` and `TextFilter`.
|
489
|
+
|
490
|
+
`FieldTextFilter` requires just a model field name and the filter will make `__icontains` search on this field. There are no other things to configure so the integration in `list_filter` will be just one new row looking like `("model_field_name", FieldTextFilter)`.
|
491
|
+
|
492
|
+
In the case of the `TextFilter`, it is needed the write a whole new class inheriting from `TextFilter` with a custom implementation of the `queryset` method and the `parameter_name` attribute. This attribute will be a representation of the search query parameter name in URI. The benefit of the `TextFilter` is the possibility of writing complex queries.
|
493
|
+
|
494
|
+
```python
|
495
|
+
from django.contrib import admin
|
496
|
+
from django.contrib.auth.models import User
|
497
|
+
from django.core.validators import EMPTY_VALUES
|
498
|
+
from django.utils.translation import gettext_lazy as _
|
499
|
+
from unfold.admin import ModelAdmin
|
500
|
+
from unfold.contrib.filters.admin import TextFilter, FieldTextFilter
|
501
|
+
|
502
|
+
class CustomTextFilter(TextFilter):
|
503
|
+
title = _("Custom filter")
|
504
|
+
parameter_name = "query_param_in_uri"
|
505
|
+
|
506
|
+
def queryset(self, request, queryset):
|
507
|
+
if self.value() not in EMPTY_VALUES:
|
508
|
+
# Here write custom query
|
509
|
+
return queryset.filter(your_field=self.value())
|
510
|
+
|
511
|
+
return queryset
|
512
|
+
|
513
|
+
|
514
|
+
@admin.register(User)
|
515
|
+
class MyAdmin(ModelAdmin):
|
516
|
+
list_filter_submit = True
|
517
|
+
list_filter = [
|
518
|
+
("model_charfield", FieldTextFilter),
|
519
|
+
CustomTextFilter
|
520
|
+
]
|
521
|
+
```
|
522
|
+
|
523
|
+
### Dropdown filters
|
524
|
+
|
525
|
+
Dropdown filters will display a select field with a list of options. Unfold contains two types of dropdowns: `ChoicesDropdownFilter` and `RelatedDropdownFilter`.
|
526
|
+
|
527
|
+
The difference between them is that `ChoicesDropdownFilter` will collect a list of options based on the `choices` attribute of the model field so most commonly it will be used in combination with `CharField` with specified `choices`. On the other side, `RelatedDropdownFilter` needs a one-to-many or many-to-many foreign key to display options.
|
528
|
+
|
529
|
+
**Note:** At the moment Unfold does not implement a dropdown with an autocomplete functionality, so it is important not to use dropdowns displaying large datasets.
|
530
|
+
|
531
|
+
```python
|
532
|
+
# admin.py
|
533
|
+
|
534
|
+
from django.contrib import admin
|
535
|
+
from django.contrib.auth.models import User
|
536
|
+
from unfold.admin import ModelAdmin
|
537
|
+
from unfold.contrib.filters.admin import ChoicesDropdownFilter, RelatedDropdownFilter, DropdownFilter
|
538
|
+
|
539
|
+
|
540
|
+
class CustomDropdownFilter(DropdownFilter):
|
541
|
+
title = _("Custom dropdown filter")
|
542
|
+
parameter_name = "query_param_in_uri"
|
543
|
+
|
544
|
+
def lookups(self, request, model_admin):
|
545
|
+
return [
|
546
|
+
["option_1", _("Option 1")],
|
547
|
+
["option_2", _("Option 2")],
|
548
|
+
]
|
549
|
+
|
550
|
+
def queryset(self, request, queryset):
|
551
|
+
if self.value() not in EMPTY_VALUES:
|
552
|
+
# Here write custom query
|
553
|
+
return queryset.filter(your_field=self.value())
|
554
|
+
|
555
|
+
return queryset
|
556
|
+
|
557
|
+
|
558
|
+
@admin.register(User)
|
559
|
+
class MyAdmin(ModelAdmin):
|
560
|
+
list_filter_submit = True
|
561
|
+
list_filter = [
|
562
|
+
CustomDropdownFilter,
|
563
|
+
("modelfield_with_choices", ChoicesDropdownFilter),
|
564
|
+
("modelfield_with_foreign_key", RelatedDropdownFilter)
|
565
|
+
]
|
566
|
+
```
|
567
|
+
|
484
568
|
### Numeric filters
|
485
569
|
|
486
570
|
Currently, Unfold implements numeric filters inside `unfold.contrib.filters` application. In order to use these filters, it is required to add this application into `INSTALLED_APPS` in `settings.py` right after `unfold` application.
|
@@ -611,7 +695,16 @@ class UserAdmin(ModelAdmin):
|
|
611
695
|
"""
|
612
696
|
Third argument is short text which will appear as prefix in circle
|
613
697
|
"""
|
614
|
-
return
|
698
|
+
return [
|
699
|
+
"First main heading",
|
700
|
+
"Smaller additional description", # Use None in case you don't need it
|
701
|
+
"AB", # Short text which will appear in front of
|
702
|
+
# Image instead of initials. Initials are ignored if image is available
|
703
|
+
{
|
704
|
+
"path": "some/path/picture.jpg,
|
705
|
+
"squared": True, # Picture is displayed in square format, if empty circle
|
706
|
+
}
|
707
|
+
]
|
615
708
|
```
|
616
709
|
|
617
710
|
## Change form tabs
|
@@ -28,14 +28,14 @@ Did you decide to start using Unfold but you don't have time to make the switch
|
|
28
28
|
- **Dependencies:** completely based only on `django.contrib.admin`
|
29
29
|
- **Actions:** multiple ways how to define actions within different parts of admin
|
30
30
|
- **WYSIWYG:** built-in support for WYSIWYG (Trix)
|
31
|
-
- **
|
31
|
+
- **Filters:** custom dropdown, numeric, datetime, and text fields
|
32
32
|
- **Dashboard:** custom components for rapid dashboard development
|
33
33
|
- **Model tabs:** define custom tab navigations for models
|
34
34
|
- **Fieldset tabs:** merge several fielsets into tabs in change form
|
35
35
|
- **Colors:** possibility to override default color scheme
|
36
36
|
- **Third party packages:** default support for multiple popular applications
|
37
37
|
- **Environment label**: distinguish between environments by displaying a label
|
38
|
-
- **Parallel admin**: support for having default admin in parallel with Unfold
|
38
|
+
- **Parallel admin**: support for having default admin in parallel with Unfold. [Admin migration guide](https://unfoldadmin.com/blog/migrating-django-admin-unfold/)
|
39
39
|
- **VS Code**: project configuration and development container is included
|
40
40
|
|
41
41
|
## Table of contents <!-- omit from toc -->
|
@@ -50,6 +50,8 @@ Did you decide to start using Unfold but you don't have time to make the switch
|
|
50
50
|
- [Action handler functions](#action-handler-functions)
|
51
51
|
- [Action examples](#action-examples)
|
52
52
|
- [Filters](#filters)
|
53
|
+
- [Text filters](#text-filters)
|
54
|
+
- [Dropdown filters](#dropdown-filters)
|
53
55
|
- [Numeric filters](#numeric-filters)
|
54
56
|
- [Date/time filters](#datetime-filters)
|
55
57
|
- [Display decorator](#display-decorator)
|
@@ -457,6 +459,88 @@ By default, Django admin handles all filters as regular HTML links pointing at t
|
|
457
459
|
|
458
460
|
**Note:** when implementing a filter which contains input fields, there is a no way that user can submit the values, because default filters does not contain submit button. To implement submit button, `unfold.admin.ModelAdmin` contains boolean `list_filter_submit` flag which enables submit button in filter form.
|
459
461
|
|
462
|
+
### Text filters
|
463
|
+
|
464
|
+
Text input field which allows filtering by the free string submitted by the user. There are two different variants of this filter: `FieldTextFilter` and `TextFilter`.
|
465
|
+
|
466
|
+
`FieldTextFilter` requires just a model field name and the filter will make `__icontains` search on this field. There are no other things to configure so the integration in `list_filter` will be just one new row looking like `("model_field_name", FieldTextFilter)`.
|
467
|
+
|
468
|
+
In the case of the `TextFilter`, it is needed the write a whole new class inheriting from `TextFilter` with a custom implementation of the `queryset` method and the `parameter_name` attribute. This attribute will be a representation of the search query parameter name in URI. The benefit of the `TextFilter` is the possibility of writing complex queries.
|
469
|
+
|
470
|
+
```python
|
471
|
+
from django.contrib import admin
|
472
|
+
from django.contrib.auth.models import User
|
473
|
+
from django.core.validators import EMPTY_VALUES
|
474
|
+
from django.utils.translation import gettext_lazy as _
|
475
|
+
from unfold.admin import ModelAdmin
|
476
|
+
from unfold.contrib.filters.admin import TextFilter, FieldTextFilter
|
477
|
+
|
478
|
+
class CustomTextFilter(TextFilter):
|
479
|
+
title = _("Custom filter")
|
480
|
+
parameter_name = "query_param_in_uri"
|
481
|
+
|
482
|
+
def queryset(self, request, queryset):
|
483
|
+
if self.value() not in EMPTY_VALUES:
|
484
|
+
# Here write custom query
|
485
|
+
return queryset.filter(your_field=self.value())
|
486
|
+
|
487
|
+
return queryset
|
488
|
+
|
489
|
+
|
490
|
+
@admin.register(User)
|
491
|
+
class MyAdmin(ModelAdmin):
|
492
|
+
list_filter_submit = True
|
493
|
+
list_filter = [
|
494
|
+
("model_charfield", FieldTextFilter),
|
495
|
+
CustomTextFilter
|
496
|
+
]
|
497
|
+
```
|
498
|
+
|
499
|
+
### Dropdown filters
|
500
|
+
|
501
|
+
Dropdown filters will display a select field with a list of options. Unfold contains two types of dropdowns: `ChoicesDropdownFilter` and `RelatedDropdownFilter`.
|
502
|
+
|
503
|
+
The difference between them is that `ChoicesDropdownFilter` will collect a list of options based on the `choices` attribute of the model field so most commonly it will be used in combination with `CharField` with specified `choices`. On the other side, `RelatedDropdownFilter` needs a one-to-many or many-to-many foreign key to display options.
|
504
|
+
|
505
|
+
**Note:** At the moment Unfold does not implement a dropdown with an autocomplete functionality, so it is important not to use dropdowns displaying large datasets.
|
506
|
+
|
507
|
+
```python
|
508
|
+
# admin.py
|
509
|
+
|
510
|
+
from django.contrib import admin
|
511
|
+
from django.contrib.auth.models import User
|
512
|
+
from unfold.admin import ModelAdmin
|
513
|
+
from unfold.contrib.filters.admin import ChoicesDropdownFilter, RelatedDropdownFilter, DropdownFilter
|
514
|
+
|
515
|
+
|
516
|
+
class CustomDropdownFilter(DropdownFilter):
|
517
|
+
title = _("Custom dropdown filter")
|
518
|
+
parameter_name = "query_param_in_uri"
|
519
|
+
|
520
|
+
def lookups(self, request, model_admin):
|
521
|
+
return [
|
522
|
+
["option_1", _("Option 1")],
|
523
|
+
["option_2", _("Option 2")],
|
524
|
+
]
|
525
|
+
|
526
|
+
def queryset(self, request, queryset):
|
527
|
+
if self.value() not in EMPTY_VALUES:
|
528
|
+
# Here write custom query
|
529
|
+
return queryset.filter(your_field=self.value())
|
530
|
+
|
531
|
+
return queryset
|
532
|
+
|
533
|
+
|
534
|
+
@admin.register(User)
|
535
|
+
class MyAdmin(ModelAdmin):
|
536
|
+
list_filter_submit = True
|
537
|
+
list_filter = [
|
538
|
+
CustomDropdownFilter,
|
539
|
+
("modelfield_with_choices", ChoicesDropdownFilter),
|
540
|
+
("modelfield_with_foreign_key", RelatedDropdownFilter)
|
541
|
+
]
|
542
|
+
```
|
543
|
+
|
460
544
|
### Numeric filters
|
461
545
|
|
462
546
|
Currently, Unfold implements numeric filters inside `unfold.contrib.filters` application. In order to use these filters, it is required to add this application into `INSTALLED_APPS` in `settings.py` right after `unfold` application.
|
@@ -587,7 +671,16 @@ class UserAdmin(ModelAdmin):
|
|
587
671
|
"""
|
588
672
|
Third argument is short text which will appear as prefix in circle
|
589
673
|
"""
|
590
|
-
return
|
674
|
+
return [
|
675
|
+
"First main heading",
|
676
|
+
"Smaller additional description", # Use None in case you don't need it
|
677
|
+
"AB", # Short text which will appear in front of
|
678
|
+
# Image instead of initials. Initials are ignored if image is available
|
679
|
+
{
|
680
|
+
"path": "some/path/picture.jpg,
|
681
|
+
"squared": True, # Picture is displayed in square format, if empty circle
|
682
|
+
}
|
683
|
+
]
|
591
684
|
```
|
592
685
|
|
593
686
|
## Change form tabs
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "django-unfold"
|
3
|
-
version = "0.
|
3
|
+
version = "0.24.0"
|
4
4
|
description = "Modern Django admin theme for seamless interface development"
|
5
5
|
license = "MIT"
|
6
6
|
readme = "README.md"
|
@@ -62,7 +62,7 @@ version_toml = ["pyproject.toml:tool.poetry.version"]
|
|
62
62
|
|
63
63
|
[tool.semantic_release.changelog]
|
64
64
|
template_dir = ".github/templates"
|
65
|
-
exclude_commit_patterns = ["chore: version bump"]
|
65
|
+
exclude_commit_patterns = ["chore: version bump", "chore(deps)", "chore(deps-dev)"]
|
66
66
|
|
67
67
|
[tool.semantic_release.changelog.environment]
|
68
68
|
trim_blocks = true
|
@@ -62,7 +62,7 @@ from .widgets import (
|
|
62
62
|
UnfoldAdminMoneyWidget,
|
63
63
|
UnfoldAdminNullBooleanSelectWidget,
|
64
64
|
UnfoldAdminRadioSelectWidget,
|
65
|
-
|
65
|
+
UnfoldAdminSelectWidget,
|
66
66
|
UnfoldAdminSingleDateWidget,
|
67
67
|
UnfoldAdminSingleTimeWidget,
|
68
68
|
UnfoldAdminSplitDateTimeWidget,
|
@@ -294,7 +294,7 @@ class ModelAdminMixin:
|
|
294
294
|
radio_style=self.radio_fields[db_field.name]
|
295
295
|
)
|
296
296
|
else:
|
297
|
-
kwargs["widget"] =
|
297
|
+
kwargs["widget"] = UnfoldAdminSelectWidget()
|
298
298
|
|
299
299
|
kwargs["choices"] = db_field.get_choices(
|
300
300
|
include_blank=db_field.blank, blank_choice=[("", _("Select value"))]
|
@@ -313,7 +313,7 @@ class ModelAdminMixin:
|
|
313
313
|
db_field.name not in self.get_autocomplete_fields(request)
|
314
314
|
and db_field.name not in self.radio_fields
|
315
315
|
):
|
316
|
-
kwargs["widget"] =
|
316
|
+
kwargs["widget"] = UnfoldAdminSelectWidget()
|
317
317
|
kwargs["empty_label"] = _("Select value")
|
318
318
|
|
319
319
|
return super().formfield_for_foreignkey(db_field, request, **kwargs)
|
@@ -17,16 +17,132 @@ from django.db.models.fields import (
|
|
17
17
|
from django.forms import ValidationError
|
18
18
|
from django.http import HttpRequest
|
19
19
|
from django.utils.dateparse import parse_datetime
|
20
|
+
from django.utils.translation import gettext_lazy as _
|
20
21
|
|
21
22
|
from .forms import (
|
23
|
+
DropdownForm,
|
22
24
|
RangeDateForm,
|
23
25
|
RangeDateTimeForm,
|
24
26
|
RangeNumericForm,
|
27
|
+
SearchForm,
|
25
28
|
SingleNumericForm,
|
26
29
|
SliderNumericForm,
|
27
30
|
)
|
28
31
|
|
29
32
|
|
33
|
+
class ValueMixin:
|
34
|
+
def value(self) -> Optional[str]:
|
35
|
+
return (
|
36
|
+
self.lookup_val[0]
|
37
|
+
if self.lookup_val not in EMPTY_VALUES
|
38
|
+
and isinstance(self.lookup_val, List)
|
39
|
+
and len(self.lookup_val) > 0
|
40
|
+
else self.lookup_val
|
41
|
+
)
|
42
|
+
|
43
|
+
|
44
|
+
class DropdownMixin:
|
45
|
+
template = "unfold/filters/filters_field.html"
|
46
|
+
form_class = DropdownForm
|
47
|
+
all_option = ["", _("All")]
|
48
|
+
|
49
|
+
def queryset(self, request, queryset) -> QuerySet:
|
50
|
+
if self.value() not in EMPTY_VALUES:
|
51
|
+
return super().queryset(request, queryset)
|
52
|
+
|
53
|
+
return queryset
|
54
|
+
|
55
|
+
|
56
|
+
class TextFilter(admin.SimpleListFilter):
|
57
|
+
template = "unfold/filters/filters_field.html"
|
58
|
+
form_class = SearchForm
|
59
|
+
|
60
|
+
def has_output(self) -> bool:
|
61
|
+
return True
|
62
|
+
|
63
|
+
def lookups(self, request: HttpRequest, model_admin: ModelAdmin) -> Tuple:
|
64
|
+
return ()
|
65
|
+
|
66
|
+
def choices(self, changelist: ChangeList) -> Tuple[Dict[str, Any], ...]:
|
67
|
+
return (
|
68
|
+
{
|
69
|
+
"form": self.form_class(
|
70
|
+
name=self.parameter_name,
|
71
|
+
label=_("By {}").format(self.title),
|
72
|
+
data={self.parameter_name: self.value()},
|
73
|
+
),
|
74
|
+
},
|
75
|
+
)
|
76
|
+
|
77
|
+
|
78
|
+
class FieldTextFilter(ValueMixin, admin.FieldListFilter):
|
79
|
+
template = "unfold/filters/filters_field.html"
|
80
|
+
form_class = SearchForm
|
81
|
+
|
82
|
+
def __init__(self, field, request, params, model, model_admin, field_path):
|
83
|
+
self.lookup_kwarg = f"{field_path}__icontains"
|
84
|
+
self.lookup_val = params.get(self.lookup_kwarg)
|
85
|
+
super().__init__(field, request, params, model, model_admin, field_path)
|
86
|
+
|
87
|
+
def expected_parameters(self) -> List[str]:
|
88
|
+
return [self.lookup_kwarg]
|
89
|
+
|
90
|
+
def choices(self, changelist: ChangeList) -> Tuple[Dict[str, Any], ...]:
|
91
|
+
return (
|
92
|
+
{
|
93
|
+
"form": self.form_class(
|
94
|
+
label=_("By {}").format(self.title),
|
95
|
+
name=self.lookup_kwarg,
|
96
|
+
data={self.lookup_kwarg: self.value()},
|
97
|
+
),
|
98
|
+
},
|
99
|
+
)
|
100
|
+
|
101
|
+
|
102
|
+
class DropdownFilter(admin.SimpleListFilter):
|
103
|
+
template = "unfold/filters/filters_field.html"
|
104
|
+
form_class = DropdownForm
|
105
|
+
all_option = ["", _("All")]
|
106
|
+
|
107
|
+
def choices(self, changelist: ChangeList) -> Tuple[Dict[str, Any], ...]:
|
108
|
+
return (
|
109
|
+
{
|
110
|
+
"form": self.form_class(
|
111
|
+
label=_("By {}").format(self.title),
|
112
|
+
name=self.parameter_name,
|
113
|
+
choices=[self.all_option, *self.lookup_choices],
|
114
|
+
data={self.parameter_name: self.value()},
|
115
|
+
),
|
116
|
+
},
|
117
|
+
)
|
118
|
+
|
119
|
+
|
120
|
+
class ChoicesDropdownFilter(ValueMixin, DropdownMixin, admin.ChoicesFieldListFilter):
|
121
|
+
def choices(self, changelist: ChangeList):
|
122
|
+
choices = [self.all_option, *self.field.flatchoices]
|
123
|
+
|
124
|
+
yield {
|
125
|
+
"form": self.form_class(
|
126
|
+
label=_("By {}").format(self.title),
|
127
|
+
name=self.lookup_kwarg,
|
128
|
+
choices=choices,
|
129
|
+
data={self.lookup_kwarg: self.value()},
|
130
|
+
),
|
131
|
+
}
|
132
|
+
|
133
|
+
|
134
|
+
class RelatedDropdownFilter(ValueMixin, DropdownMixin, admin.RelatedFieldListFilter):
|
135
|
+
def choices(self, changelist: ChangeList):
|
136
|
+
yield {
|
137
|
+
"form": self.form_class(
|
138
|
+
label=_("By {}").format(self.title),
|
139
|
+
name=self.lookup_kwarg,
|
140
|
+
choices=[self.all_option, *self.lookup_choices],
|
141
|
+
data={self.lookup_kwarg: self.value()},
|
142
|
+
),
|
143
|
+
}
|
144
|
+
|
145
|
+
|
30
146
|
class SingleNumericFilter(admin.FieldListFilter):
|
31
147
|
request = None
|
32
148
|
parameter_name = None
|
@@ -1,7 +1,35 @@
|
|
1
1
|
from django import forms
|
2
2
|
from django.utils.translation import gettext_lazy as _
|
3
3
|
|
4
|
-
from ...widgets import
|
4
|
+
from ...widgets import (
|
5
|
+
INPUT_CLASSES,
|
6
|
+
UnfoldAdminSelectWidget,
|
7
|
+
UnfoldAdminSplitDateTimeVerticalWidget,
|
8
|
+
UnfoldAdminTextInputWidget,
|
9
|
+
)
|
10
|
+
|
11
|
+
|
12
|
+
class SearchForm(forms.Form):
|
13
|
+
def __init__(self, name, label, *args, **kwargs):
|
14
|
+
super().__init__(*args, **kwargs)
|
15
|
+
|
16
|
+
self.fields[name] = forms.CharField(
|
17
|
+
label=label,
|
18
|
+
required=False,
|
19
|
+
widget=UnfoldAdminTextInputWidget,
|
20
|
+
)
|
21
|
+
|
22
|
+
|
23
|
+
class DropdownForm(forms.Form):
|
24
|
+
def __init__(self, name, label, choices, *args, **kwargs):
|
25
|
+
super().__init__(*args, **kwargs)
|
26
|
+
|
27
|
+
self.fields[name] = forms.ChoiceField(
|
28
|
+
label=label,
|
29
|
+
required=False,
|
30
|
+
choices=choices,
|
31
|
+
widget=UnfoldAdminSelectWidget,
|
32
|
+
)
|
5
33
|
|
6
34
|
|
7
35
|
class SingleNumericForm(forms.Form):
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
{% with choices.0 as choice %}
|
4
4
|
<div class="flex flex-col mb-6">
|
5
|
-
<h3 class="font-medium mb-
|
5
|
+
<h3 class="font-medium mb-2 text-gray-700 text-sm dark:text-gray-200">{% blocktrans with filter_title=title %}By {{ filter_title }}{% endblocktrans %}</h3>
|
6
6
|
|
7
7
|
<div class="flex flex-col space-y-4">
|
8
8
|
{% for field in choice.form %}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
{% with choices.0 as choice %}
|
4
4
|
<div class="flex flex-col mb-6">
|
5
|
-
<h3 class="font-medium mb-
|
5
|
+
<h3 class="font-medium mb-2 text-gray-700 text-sm dark:text-gray-200">{% blocktrans with filter_title=title %}By {{ filter_title }}{% endblocktrans %}</h3>
|
6
6
|
|
7
7
|
<div class="flex flex-col space-y-4">
|
8
8
|
{% for field in choice.form %}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
{% with choices.0 as choice %}
|
4
4
|
<div class="flex flex-col mb-6">
|
5
|
-
<h3 class="font-medium mb-
|
5
|
+
<h3 class="font-medium mb-2 text-gray-700 text-sm dark:text-gray-200">{% blocktrans with filter_title=title %}By {{ filter_title }}{% endblocktrans %}</h3>
|
6
6
|
|
7
7
|
<div class="flex flex-row gap-4">
|
8
8
|
{% for field in choice.form %}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
{% with choices.0 as choice %}
|
4
4
|
<div class="flex flex-col mb-6">
|
5
|
-
<h3 class="font-medium mb-
|
5
|
+
<h3 class="font-medium mb-2 text-gray-700 text-sm dark:text-gray-200">{% blocktrans with filter_title=title %}By {{ filter_title }}{% endblocktrans %}</h3>
|
6
6
|
|
7
7
|
{% for field in choice.form %}
|
8
8
|
<div class="flex flex-row flex-wrap group relative{% if field.errors %} errors{% endif %}">
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
{% with choices.0 as choice %}
|
5
5
|
<div class="admin-numeric-filter-wrapper mb-6">
|
6
|
-
<h3 class="font-medium mb-
|
6
|
+
<h3 class="font-medium mb-2 text-gray-700 text-sm dark:text-gray-200">
|
7
7
|
{% blocktrans with filter_title=title %}By {{ filter_title }}{% endblocktrans %}
|
8
8
|
</h3>
|
9
9
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
from import_export.forms import ImportExportFormBase as BaseImportExportFormBase
|
2
|
+
from unfold.widgets import SELECT_CLASSES, UnfoldAdminFileFieldWidget
|
3
|
+
|
4
|
+
|
5
|
+
class ImportForm(BaseImportExportFormBase):
|
6
|
+
def __init__(self, *args, **kwargs):
|
7
|
+
super().__init__(*args, **kwargs)
|
8
|
+
self.fields["resource"].widget = UnfoldAdminFileFieldWidget()
|
9
|
+
self.fields["format"].widget.attrs["class"] = " ".join(SELECT_CLASSES)
|
10
|
+
|
11
|
+
|
12
|
+
class ExportForm(BaseImportExportFormBase):
|
13
|
+
def __init__(self, *args, **kwargs):
|
14
|
+
super().__init__(*args, **kwargs)
|
15
|
+
self.fields["format"].widget.attrs["class"] = " ".join(SELECT_CLASSES)
|
@@ -37,7 +37,7 @@
|
|
37
37
|
{% csrf_token %}
|
38
38
|
|
39
39
|
<fieldset class="border border-gray-200 mb-8 rounded-md pt-3 px-3 shadow-sm dark:border-gray-800">
|
40
|
-
{% include "unfold/helpers/field.html" with field=form.
|
40
|
+
{% include "unfold/helpers/field.html" with field=form.format %}
|
41
41
|
</fieldset>
|
42
42
|
|
43
43
|
<button type="submit" class="bg-primary-600 border border-transparent font-medium px-3 py-2 rounded-md text-sm text-white">
|
@@ -22,9 +22,9 @@
|
|
22
22
|
</p>
|
23
23
|
|
24
24
|
<fieldset class="border border-gray-200 mb-8 rounded-md pt-3 px-3 shadow-sm dark:border-gray-800">
|
25
|
-
{% include "unfold/helpers/field.html" with field=form.
|
25
|
+
{% include "unfold/helpers/field.html" with field=form.resource %}
|
26
26
|
|
27
|
-
{% include "unfold/helpers/field.html" with field=form.
|
27
|
+
{% include "unfold/helpers/field.html" with field=form.format %}
|
28
28
|
</fieldset>
|
29
29
|
|
30
30
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
{% load i18n unfold %}
|
2
2
|
|
3
3
|
<div class="mb-6">
|
4
|
-
<h3 class="font-medium mb-
|
4
|
+
<h3 class="font-medium mb-2 text-gray-700 text-sm dark:text-gray-200">
|
5
5
|
{% blocktranslate with filter_title=title %} By {{ filter_title }} {% endblocktranslate %}
|
6
6
|
</h3>
|
7
7
|
|
8
8
|
{% for choice in choices %}
|
9
|
-
{% if choice.selected %}
|
9
|
+
{% if choice.selected and spec.lookup_val.0 %}
|
10
10
|
<input type="hidden" name="{{ spec.lookup_kwarg }}" value="{{ spec.lookup_val.0 }}" />
|
11
11
|
{% endif %}
|
12
12
|
{% endfor %}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="flex gap-4 items-center">
|
2
|
+
{% if value.3 and value.3.path %}
|
3
|
+
<div class="bg-center bg-cover bg-white border flex font-medium h-8 w-8 dark:bg-gray-900 dark:border-gray-700 {% if value.3.squared %}rounded-sm{% else %}rounded-full{% endif %}" style="background-image: url('{{ value.3.path }}')">
|
4
|
+
</div>
|
5
|
+
{% elif value.2 %}
|
6
|
+
<div 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">
|
7
|
+
{{ value.2 }}
|
8
|
+
</div>
|
9
|
+
{% endif %}
|
10
|
+
|
11
|
+
<div class="flex flex-col text-right lg:text-left">
|
12
|
+
<h3>{{ value.0 }}</h3>
|
13
|
+
|
14
|
+
{% if value.1 %}
|
15
|
+
<p class="text-gray-500">
|
16
|
+
{{ value.1 }}
|
17
|
+
</p>
|
18
|
+
{% endif %}
|
19
|
+
</div>
|
20
|
+
</div>
|
@@ -444,7 +444,7 @@ class UnfoldAdminNullBooleanSelectWidget(NullBooleanSelect):
|
|
444
444
|
super().__init__(attrs)
|
445
445
|
|
446
446
|
|
447
|
-
class
|
447
|
+
class UnfoldAdminSelectWidget(Select):
|
448
448
|
def __init__(self, attrs=None, choices=()):
|
449
449
|
if attrs is None:
|
450
450
|
attrs = {}
|
@@ -482,7 +482,7 @@ try:
|
|
482
482
|
def __init__(self, *args, **kwargs):
|
483
483
|
super().__init__(
|
484
484
|
amount_widget=UnfoldAdminTextInputWidget,
|
485
|
-
currency_widget=
|
485
|
+
currency_widget=UnfoldAdminSelectWidget(choices=CURRENCY_CHOICES),
|
486
486
|
)
|
487
487
|
|
488
488
|
except ImportError:
|