wagtail 6.2.2__py3-none-any.whl → 6.3rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wagtail/__init__.py +1 -1
- wagtail/actions/copy_for_translation.py +6 -0
- wagtail/actions/publish_revision.py +3 -3
- wagtail/admin/action_menu.py +5 -3
- wagtail/admin/forms/account.py +1 -1
- wagtail/admin/icons.py +2 -6
- wagtail/admin/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/cy/LC_MESSAGES/django.po +32 -0
- wagtail/admin/locale/dv/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/dv/LC_MESSAGES/django.po +28 -0
- wagtail/admin/locale/en/LC_MESSAGES/django.po +451 -485
- wagtail/admin/locale/en/LC_MESSAGES/djangojs.po +7 -7
- wagtail/admin/locale/sl/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/sl/LC_MESSAGES/django.po +150 -0
- wagtail/admin/locale/sl/LC_MESSAGES/djangojs.mo +0 -0
- wagtail/admin/locale/sl/LC_MESSAGES/djangojs.po +9 -2
- wagtail/admin/locale/ug/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/ug/LC_MESSAGES/django.po +3250 -196
- wagtail/admin/localization.py +8 -2
- wagtail/admin/panels/model_utils.py +1 -1
- wagtail/admin/site_summary.py +0 -2
- wagtail/admin/static/wagtailadmin/css/core.css +1 -1
- wagtail/admin/static/wagtailadmin/css/panels/draftail.css +1 -1
- wagtail/admin/static/wagtailadmin/images/email-header.jpg +0 -0
- wagtail/admin/static/wagtailadmin/js/bulk-actions.js +1 -1
- wagtail/admin/static/wagtailadmin/js/core.js +1 -1
- wagtail/admin/static/wagtailadmin/js/core.js.LICENSE.txt +12 -0
- wagtail/admin/static/wagtailadmin/js/draftail.js +1 -1
- wagtail/admin/static/wagtailadmin/js/sidebar.js +1 -1
- wagtail/admin/static/wagtailadmin/js/telepath/telepath.js +1 -1
- wagtail/admin/static/wagtailadmin/js/telepath/widgets.js +1 -1
- wagtail/admin/static/wagtailadmin/js/userbar.js +1 -1
- wagtail/admin/static/wagtailadmin/js/userbar.js.LICENSE.txt +1 -1
- wagtail/admin/static/wagtailadmin/js/vendor.js +1 -1
- wagtail/admin/static/wagtailadmin/js/wagtailadmin.js +1 -1
- wagtail/admin/static/wagtailadmin/js/workflow-action.js +1 -1
- wagtail/admin/staticfiles.py +6 -4
- wagtail/admin/templates/wagtailadmin/account/account.html +42 -59
- wagtail/admin/templates/wagtailadmin/admin_base.html +0 -28
- wagtail/admin/templates/wagtailadmin/bulk_actions/footer.html +1 -1
- wagtail/admin/templates/wagtailadmin/chooser/_search_results.html +7 -5
- wagtail/admin/templates/wagtailadmin/chooser/tables/page_navigate_to_children_cell.html +1 -1
- wagtail/admin/templates/wagtailadmin/generic/chooser/results.html +7 -5
- wagtail/admin/templates/wagtailadmin/generic/edit.html +0 -8
- wagtail/admin/templates/wagtailadmin/generic/form.html +60 -17
- wagtail/admin/templates/wagtailadmin/generic/index.html +17 -0
- wagtail/admin/templates/wagtailadmin/generic/index_results.html +9 -35
- wagtail/admin/templates/wagtailadmin/generic/inspect.html +2 -21
- wagtail/admin/templates/wagtailadmin/generic/listing.html +11 -17
- wagtail/admin/templates/wagtailadmin/generic/listing_results.html +19 -1
- wagtail/admin/templates/wagtailadmin/home/account_summary.html +26 -0
- wagtail/admin/templates/wagtailadmin/home/locked_pages.html +28 -18
- wagtail/admin/templates/wagtailadmin/home/recent_edits.html +28 -17
- wagtail/admin/templates/wagtailadmin/home/site_summary_pages.html +2 -2
- wagtail/admin/templates/wagtailadmin/home/upgrade_notification.html +35 -13
- wagtail/admin/templates/wagtailadmin/home/user_objects_in_workflow_moderation.html +28 -18
- wagtail/admin/templates/wagtailadmin/home/workflow_objects_to_moderate.html +43 -32
- wagtail/admin/templates/wagtailadmin/home.html +22 -5
- wagtail/admin/templates/wagtailadmin/pages/_editor_js.html +0 -1
- wagtail/admin/templates/wagtailadmin/pages/action_menu/menu.html +1 -11
- wagtail/admin/templates/wagtailadmin/pages/action_menu/menu_item.html +1 -6
- wagtail/admin/templates/wagtailadmin/pages/action_menu/page_locked.html +1 -1
- wagtail/admin/templates/wagtailadmin/pages/action_menu/publish.html +1 -1
- wagtail/admin/templates/wagtailadmin/pages/action_menu/save_draft.html +1 -1
- wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_delete.html +12 -6
- wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_move.html +12 -7
- wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_publish.html +17 -11
- wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_unpublish.html +15 -9
- wagtail/admin/templates/wagtailadmin/pages/confirm_delete.html +9 -9
- wagtail/admin/templates/wagtailadmin/pages/confirm_move.html +2 -2
- wagtail/admin/templates/wagtailadmin/pages/confirm_unpublish.html +4 -4
- wagtail/admin/templates/wagtailadmin/pages/create.html +15 -34
- wagtail/admin/templates/wagtailadmin/pages/edit.html +15 -30
- wagtail/admin/templates/wagtailadmin/pages/explorable_index.html +6 -0
- wagtail/admin/templates/wagtailadmin/pages/explorable_index_results.html +60 -0
- wagtail/admin/templates/wagtailadmin/pages/index.html +1 -36
- wagtail/admin/templates/wagtailadmin/pages/index_results.html +2 -50
- wagtail/admin/templates/wagtailadmin/pages/listing/_locked_indicator.html +1 -1
- wagtail/admin/templates/wagtailadmin/pages/listing/_ordering_cell.html +1 -1
- wagtail/admin/templates/wagtailadmin/pages/listing/_page_header_buttons.html +1 -1
- wagtail/admin/templates/wagtailadmin/pages/listing/_page_title_column_header.html +3 -3
- wagtail/admin/templates/wagtailadmin/pages/listing/_pagination.html +1 -1
- wagtail/admin/templates/wagtailadmin/pages/listing.html +24 -0
- wagtail/admin/templates/wagtailadmin/pages/search.html +1 -20
- wagtail/admin/templates/wagtailadmin/pages/search_results.html +27 -25
- wagtail/admin/templates/wagtailadmin/permissions/includes/collection_member_permissions_formset.html +0 -1
- wagtail/admin/templates/wagtailadmin/reports/listing/_list_page_report.html +2 -2
- wagtail/admin/templates/wagtailadmin/reports/listing/_list_page_types_usage.html +6 -6
- wagtail/admin/templates/wagtailadmin/reports/workflow_tasks_results.html +1 -1
- wagtail/admin/templates/wagtailadmin/shared/action_menu/menu.html +14 -0
- wagtail/admin/templates/wagtailadmin/shared/action_menu/menu_item.html +6 -0
- wagtail/admin/templates/wagtailadmin/shared/avatar.html +13 -3
- wagtail/admin/templates/wagtailadmin/shared/header.html +0 -5
- wagtail/admin/templates/wagtailadmin/shared/headers/slim_header.html +1 -1
- wagtail/admin/templates/wagtailadmin/shared/page_status_tag_new.html +4 -1
- wagtail/admin/templates/wagtailadmin/shared/pagination_nav.html +1 -1
- wagtail/admin/templates/wagtailadmin/shared/side_panel_toggle.html +1 -1
- wagtail/admin/templates/wagtailadmin/shared/side_panels/includes/status/locale.html +1 -1
- wagtail/admin/templates/wagtailadmin/shared/side_panels/includes/status/usage.html +2 -2
- wagtail/admin/templates/wagtailadmin/shared/side_panels/preview.html +94 -52
- wagtail/admin/templates/wagtailadmin/{pages/_unsaved_changes_warning.html → shared/unsaved_changes_warning.html} +4 -4
- wagtail/admin/templates/wagtailadmin/shared/usage_summary.html +2 -2
- wagtail/admin/templates/wagtailadmin/shared/workflow_history/detail.html +1 -7
- wagtail/admin/templates/wagtailadmin/shared/workflow_history/listing.html +1 -0
- wagtail/admin/templates/wagtailadmin/shared/workflow_history/{list.html → listing_results.html} +33 -35
- wagtail/admin/templates/wagtailadmin/tables/references_cell.html +1 -1
- wagtail/admin/templates/wagtailadmin/workflows/create.html +11 -36
- wagtail/admin/templates/wagtailadmin/workflows/create_task.html +0 -38
- wagtail/admin/templates/wagtailadmin/workflows/edit.html +44 -74
- wagtail/admin/templates/wagtailadmin/workflows/edit_task.html +27 -66
- wagtail/admin/templates/wagtailadmin/workflows/includes/task_usage_cell.html +4 -2
- wagtail/admin/templates/wagtailadmin/workflows/includes/workflow_tasks_cell.html +4 -4
- wagtail/admin/templates/wagtailadmin/workflows/includes/workflow_used_by_cell.html +15 -11
- wagtail/admin/templates/wagtailadmin/workflows/task_chooser/includes/results.html +7 -5
- wagtail/admin/templatetags/wagtailadmin_tags.py +51 -22
- wagtail/admin/tests/pages/test_content_type_use_view.py +82 -2
- wagtail/admin/tests/pages/test_edit_page.py +70 -0
- wagtail/admin/tests/pages/test_explorer_view.py +65 -4
- wagtail/admin/tests/pages/test_page_search.py +8 -7
- wagtail/admin/tests/pages/test_page_usage.py +3 -1
- wagtail/admin/tests/pages/test_preview.py +208 -63
- wagtail/admin/tests/pages/test_reorder_page.py +91 -1
- wagtail/admin/tests/pages/test_view_draft.py +32 -1
- wagtail/admin/tests/pages/test_workflow_history.py +288 -7
- wagtail/admin/tests/test_account_management.py +23 -3
- wagtail/admin/tests/test_audit_log.py +24 -2
- wagtail/admin/tests/test_collections_views.py +17 -5
- wagtail/admin/tests/test_dashboard.py +1 -1
- wagtail/admin/tests/test_edit_handlers.py +3 -2
- wagtail/admin/tests/test_icon_sprite.py +4 -0
- wagtail/admin/tests/test_privacy.py +5 -19
- wagtail/admin/tests/test_reports_views.py +1 -1
- wagtail/admin/tests/test_site_summary.py +3 -3
- wagtail/admin/tests/test_templatetags.py +27 -3
- wagtail/admin/tests/test_upgrade_notification.py +71 -18
- wagtail/admin/tests/test_views.py +2 -2
- wagtail/admin/tests/test_views_generic.py +13 -0
- wagtail/admin/tests/test_widgets.py +3 -3
- wagtail/admin/tests/test_workflows.py +172 -27
- wagtail/admin/tests/tests.py +1 -1
- wagtail/admin/tests/viewsets/test_model_viewset.py +55 -3
- wagtail/admin/ui/side_panels.py +19 -0
- wagtail/admin/ui/sidebar.py +4 -3
- wagtail/admin/ui/tables/__init__.py +14 -1
- wagtail/admin/ui/tables/pages.py +6 -1
- wagtail/admin/urls/pages.py +10 -1
- wagtail/admin/urls/workflows.py +6 -1
- wagtail/admin/views/account.py +5 -1
- wagtail/admin/views/collections.py +0 -2
- wagtail/admin/views/generic/base.py +118 -1
- wagtail/admin/views/generic/history.py +158 -26
- wagtail/admin/views/generic/models.py +113 -99
- wagtail/admin/views/home.py +24 -9
- wagtail/admin/views/page_privacy.py +54 -30
- wagtail/admin/views/pages/history.py +11 -4
- wagtail/admin/views/pages/listing.py +76 -89
- wagtail/admin/views/pages/preview.py +1 -1
- wagtail/admin/views/pages/search.py +27 -71
- wagtail/admin/views/pages/usage.py +63 -24
- wagtail/admin/views/pages/utils.py +4 -3
- wagtail/admin/views/reports/base.py +0 -6
- wagtail/admin/views/workflows.py +67 -25
- wagtail/admin/viewsets/model.py +4 -3
- wagtail/admin/widgets/chooser.py +2 -1
- wagtail/api/v2/tests/test_pages.py +15 -2
- wagtail/blocks/field_block.py +15 -3
- wagtail/blocks/static_block.py +3 -0
- wagtail/contrib/forms/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/cy/LC_MESSAGES/django.po +29 -1
- wagtail/contrib/forms/locale/en/LC_MESSAGES/django.po +15 -11
- wagtail/contrib/forms/templates/wagtailforms/confirm_delete.html +1 -0
- wagtail/contrib/forms/templates/wagtailforms/index.html +1 -1
- wagtail/contrib/forms/templates/wagtailforms/index_results.html +1 -1
- wagtail/contrib/forms/templates/wagtailforms/list_submissions.html +2 -1
- wagtail/contrib/forms/templates/wagtailforms/panels/form_responses_panel.html +2 -2
- wagtail/contrib/forms/tests/test_views.py +234 -35
- wagtail/contrib/forms/utils.py +8 -14
- wagtail/contrib/forms/views.py +72 -27
- wagtail/contrib/frontend_cache/backends/azure.py +1 -1
- wagtail/contrib/frontend_cache/backends/cloudfront.py +2 -2
- wagtail/contrib/frontend_cache/backends/dummy.py +11 -0
- wagtail/contrib/frontend_cache/tests.py +31 -37
- wagtail/contrib/frontend_cache/utils.py +12 -5
- wagtail/contrib/redirects/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/redirects/locale/cy/LC_MESSAGES/django.po +16 -1
- wagtail/contrib/redirects/locale/en/LC_MESSAGES/django.po +20 -24
- wagtail/contrib/redirects/models.py +16 -1
- wagtail/contrib/redirects/signal_handlers.py +18 -3
- wagtail/contrib/redirects/templates/wagtailredirects/add.html +5 -16
- wagtail/contrib/redirects/templates/wagtailredirects/import_summary.html +1 -1
- wagtail/contrib/redirects/tests/test_redirects.py +49 -6
- wagtail/contrib/redirects/tests/test_signal_handlers.py +42 -1
- wagtail/contrib/redirects/views.py +27 -3
- wagtail/contrib/search_promotions/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/search_promotions/locale/cy/LC_MESSAGES/django.po +60 -1
- wagtail/contrib/search_promotions/locale/en/LC_MESSAGES/django.po +12 -18
- wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/add.html +5 -8
- wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/edit.html +15 -10
- wagtail/contrib/search_promotions/tests.py +13 -2
- wagtail/contrib/search_promotions/views.py +15 -3
- wagtail/contrib/settings/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/settings/locale/cy/LC_MESSAGES/django.po +6 -1
- wagtail/contrib/settings/locale/en/LC_MESSAGES/django.po +2 -10
- wagtail/contrib/settings/templates/wagtailsettings/edit.html +12 -45
- wagtail/contrib/simple_translation/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/simple_translation/locale/cy/LC_MESSAGES/django.po +13 -1
- wagtail/contrib/simple_translation/locale/dv/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/simple_translation/locale/dv/LC_MESSAGES/django.po +3 -0
- wagtail/contrib/simple_translation/locale/en/LC_MESSAGES/django.po +4 -4
- wagtail/contrib/simple_translation/locale/sl/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/simple_translation/locale/sl/LC_MESSAGES/django.po +5 -2
- wagtail/contrib/simple_translation/tests/test_views.py +51 -0
- wagtail/contrib/simple_translation/wagtail_hooks.py +16 -11
- wagtail/contrib/styleguide/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/styleguide/locale/cy/LC_MESSAGES/django.po +5 -1
- wagtail/contrib/styleguide/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/table_block/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/table_block/locale/cy/LC_MESSAGES/django.po +27 -1
- wagtail/contrib/table_block/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/typed_table_block/blocks.py +25 -0
- wagtail/contrib/typed_table_block/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/typed_table_block/locale/cy/LC_MESSAGES/django.po +12 -1
- wagtail/contrib/typed_table_block/locale/en/LC_MESSAGES/django.po +10 -10
- wagtail/contrib/typed_table_block/tests.py +24 -1
- wagtail/coreutils.py +5 -11
- wagtail/documents/admin_urls.py +2 -2
- wagtail/documents/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/documents/locale/cy/LC_MESSAGES/django.po +10 -0
- wagtail/documents/locale/en/LC_MESSAGES/django.po +61 -76
- wagtail/documents/migrations/0014_alter_document_file_size.py +18 -0
- wagtail/documents/models.py +1 -1
- wagtail/documents/rich_text/__init__.py +1 -3
- wagtail/documents/static/wagtaildocs/js/add-multiple.js +1 -1
- wagtail/documents/templates/wagtaildocs/bulk_actions/confirm_bulk_add_tags.html +5 -1
- wagtail/documents/templates/wagtaildocs/bulk_actions/confirm_bulk_add_to_collection.html +5 -1
- wagtail/documents/templates/wagtaildocs/bulk_actions/confirm_bulk_delete.html +11 -5
- wagtail/documents/templates/wagtaildocs/documents/add.html +13 -41
- wagtail/documents/templates/wagtaildocs/documents/edit.html +28 -56
- wagtail/documents/templates/wagtaildocs/documents/index.html +1 -4
- wagtail/documents/templates/wagtaildocs/homepage/site_summary_documents.html +2 -2
- wagtail/documents/templates/wagtaildocs/multiple/add.html +36 -41
- wagtail/documents/tests/test_admin_views.py +64 -6
- wagtail/documents/tests/test_site_summary.py +3 -3
- wagtail/documents/views/documents.py +103 -113
- wagtail/documents/views/multiple.py +19 -1
- wagtail/embeds/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/embeds/oembed_providers.py +9 -19
- wagtail/fields.py +43 -27
- wagtail/images/admin_urls.py +2 -2
- wagtail/images/blocks.py +230 -2
- wagtail/images/fields.py +17 -29
- wagtail/images/image_operations.py +1 -1
- wagtail/images/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/images/locale/cy/LC_MESSAGES/django.po +128 -1
- wagtail/images/locale/en/LC_MESSAGES/django.po +119 -129
- wagtail/images/migrations/0025_alter_image_file_alter_rendition_file.py +36 -43
- wagtail/images/migrations/0027_image_description.py +20 -0
- wagtail/images/models.py +120 -45
- wagtail/images/rich_text/__init__.py +1 -3
- wagtail/images/static/wagtailimages/js/add-multiple.js +1 -1
- wagtail/images/static/wagtailimages/js/image-block.js +1 -0
- wagtail/images/templates/wagtailimages/bulk_actions/confirm_bulk_add_tags.html +5 -1
- wagtail/images/templates/wagtailimages/bulk_actions/confirm_bulk_add_to_collection.html +5 -1
- wagtail/images/templates/wagtailimages/bulk_actions/confirm_bulk_delete.html +11 -5
- wagtail/images/templates/wagtailimages/chooser/results.html +2 -2
- wagtail/images/templates/wagtailimages/homepage/site_summary_images.html +2 -2
- wagtail/images/templates/wagtailimages/images/_file_field.html +2 -2
- wagtail/images/templates/wagtailimages/images/add.html +13 -31
- wagtail/images/templates/wagtailimages/images/edit.html +53 -82
- wagtail/images/templates/wagtailimages/images/index.html +1 -4
- wagtail/images/templates/wagtailimages/images/url_generator.html +1 -1
- wagtail/images/templates/wagtailimages/multiple/add.html +40 -47
- wagtail/images/templates/wagtailimages/widgets/image.html +5 -0
- wagtail/images/templates/wagtailimages/widgets/image_chooser.html +1 -1
- wagtail/images/tests/test_admin_views.py +70 -10
- wagtail/images/tests/test_blocks.py +367 -1
- wagtail/images/tests/test_image_operations.py +23 -0
- wagtail/images/tests/test_models.py +20 -0
- wagtail/images/tests/test_signal_handlers.py +99 -95
- wagtail/images/tests/test_site_summary.py +3 -3
- wagtail/images/tests/test_templatetags.py +11 -7
- wagtail/images/tests/tests.py +4 -0
- wagtail/images/views/images.py +103 -104
- wagtail/images/views/multiple.py +17 -1
- wagtail/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/locale/cy/LC_MESSAGES/django.po +3 -0
- wagtail/locale/en/LC_MESSAGES/django.po +137 -125
- wagtail/locale/sl/LC_MESSAGES/django.mo +0 -0
- wagtail/locale/sl/LC_MESSAGES/django.po +3 -0
- wagtail/locales/locale/en/LC_MESSAGES/django.po +8 -8
- wagtail/locales/views.py +4 -1
- wagtail/migrations/0089_log_entry_data_json_null_to_object.py +1 -7
- wagtail/models/__init__.py +122 -14
- wagtail/models/audit_log.py +1 -3
- wagtail/models/i18n.py +1 -2
- wagtail/project_template/Dockerfile +3 -3
- wagtail/project_template/requirements.txt +2 -2
- wagtail/query.py +17 -4
- wagtail/rich_text/__init__.py +2 -3
- wagtail/rich_text/pages.py +2 -4
- wagtail/rich_text/rewriters.py +2 -2
- wagtail/search/backends/database/mysql/query.py +3 -3
- wagtail/search/backends/database/sqlite/query.py +6 -6
- wagtail/search/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/sites/locale/en/LC_MESSAGES/django.po +6 -6
- wagtail/sites/views.py +0 -1
- wagtail/snippets/action_menu.py +14 -4
- wagtail/snippets/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/snippets/locale/cy/LC_MESSAGES/django.po +73 -1
- wagtail/snippets/locale/en/LC_MESSAGES/django.po +27 -33
- wagtail/snippets/static/wagtailsnippets/js/snippet-chooser-telepath.js +1 -1
- wagtail/snippets/static/wagtailsnippets/js/snippet-chooser.js +1 -1
- wagtail/snippets/templates/wagtailsnippets/bulk_actions/confirm_bulk_delete.html +5 -3
- wagtail/snippets/templates/wagtailsnippets/snippets/action_menu/locked.html +1 -1
- wagtail/snippets/templates/wagtailsnippets/snippets/action_menu/menu.html +1 -11
- wagtail/snippets/templates/wagtailsnippets/snippets/action_menu/menu_item.html +1 -6
- wagtail/snippets/templates/wagtailsnippets/snippets/action_menu/publish.html +1 -1
- wagtail/snippets/templates/wagtailsnippets/snippets/action_menu/save.html +1 -1
- wagtail/snippets/templates/wagtailsnippets/snippets/create.html +1 -18
- wagtail/snippets/templates/wagtailsnippets/snippets/edit.html +1 -14
- wagtail/snippets/templates/wagtailsnippets/snippets/index.html +2 -5
- wagtail/snippets/tests/test_preview.py +193 -61
- wagtail/snippets/tests/test_snippets.py +247 -38
- wagtail/snippets/tests/test_usage.py +5 -0
- wagtail/snippets/tests/test_viewset.py +25 -9
- wagtail/snippets/tests/test_workflows.py +232 -19
- wagtail/snippets/views/snippets.py +1 -10
- wagtail/test/numberformat.py +104 -0
- wagtail/test/settings.py +10 -0
- wagtail/test/settings_ui.py +2 -0
- wagtail/test/testapp/migrations/0010_alter_customimage_file_and_more.py +71 -78
- wagtail/test/testapp/migrations/0040_nocreatablesubpagetypespage_nosubpagetypespage.py +54 -0
- wagtail/test/testapp/migrations/0041_alter_jsonstreammodel_options.py +17 -0
- wagtail/test/testapp/migrations/0042_alter_customdocument_file_size_and_more.py +28 -0
- wagtail/test/testapp/migrations/0043_customimage_description.py +41 -0
- wagtail/test/testapp/migrations/0044_custompreviewsizesmodel_custompreviewsizespage.py +52 -0
- wagtail/test/testapp/migrations/0045_alter_streampage_body.py +52 -0
- wagtail/test/testapp/models.py +62 -4
- wagtail/test/testapp/rich_text.py +2 -2
- wagtail/test/testapp/templates/tests/form_page_landing.html +2 -1
- wagtail/test/testapp/urls.py +5 -0
- wagtail/test/testapp/views.py +5 -0
- wagtail/test/utils/page_tests.py +5 -5
- wagtail/test/utils/template_tests.py +2 -2
- wagtail/tests/test_blocks.py +15 -0
- wagtail/tests/test_page_permissions.py +109 -0
- wagtail/tests/test_revision_model.py +27 -0
- wagtail/tests/test_signals.py +21 -2
- wagtail/tests/test_tests.py +30 -0
- wagtail/users/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/users/locale/cy/LC_MESSAGES/django.po +118 -1
- wagtail/users/locale/dv/LC_MESSAGES/django.mo +0 -0
- wagtail/users/locale/dv/LC_MESSAGES/django.po +3 -0
- wagtail/users/locale/en/LC_MESSAGES/django.po +89 -113
- wagtail/users/locale/sl/LC_MESSAGES/django.mo +0 -0
- wagtail/users/locale/sl/LC_MESSAGES/django.po +3 -0
- wagtail/users/migrations/0014_userprofile_contrast.py +23 -0
- wagtail/users/models.py +11 -0
- wagtail/users/templates/wagtailusers/bulk_actions/confirm_bulk_assign_role.html +5 -1
- wagtail/users/templates/wagtailusers/bulk_actions/confirm_bulk_delete.html +5 -1
- wagtail/users/templates/wagtailusers/bulk_actions/confirm_bulk_set_active_state.html +5 -1
- wagtail/users/templates/wagtailusers/groups/create.html +19 -17
- wagtail/users/templates/wagtailusers/groups/edit.html +2 -40
- wagtail/users/templates/wagtailusers/groups/includes/formatted_permissions.html +1 -62
- wagtail/users/templates/wagtailusers/groups/includes/page_permissions_formset.html +0 -1
- wagtail/users/templates/wagtailusers/users/create.html +46 -50
- wagtail/users/templates/wagtailusers/users/edit.html +45 -62
- wagtail/users/templates/wagtailusers/users/index.html +1 -4
- wagtail/users/templatetags/wagtailusers_tags.py +1 -5
- wagtail/users/tests/test_admin_views.py +85 -66
- wagtail/users/views/groups.py +4 -1
- wagtail/users/views/users.py +2 -0
- {wagtail-6.2.2.dist-info → wagtail-6.3rc1.dist-info}/METADATA +6 -6
- {wagtail-6.2.2.dist-info → wagtail-6.3rc1.dist-info}/RECORD +378 -367
- wagtail/admin/static/wagtailadmin/js/preview-panel.js +0 -2
- wagtail/admin/static/wagtailadmin/js/preview-panel.js.LICENSE.txt +0 -11
- wagtail/admin/templates/wagtailadmin/generic/history_results.html +0 -1
- wagtail/admin/templates/wagtailadmin/page_privacy/ancestor_privacy.html +0 -3
- wagtail/admin/templates/wagtailadmin/pages/usage_results.html +0 -6
- wagtail/admin/templates/wagtailadmin/shared/workflow_history/index.html +0 -17
- wagtail/admin/templates/wagtailadmin/shared/workflow_history/results.html +0 -17
- wagtail/admin/templates/wagtailadmin/workflows/usage.html +0 -44
- {wagtail-6.2.2.dist-info → wagtail-6.3rc1.dist-info}/LICENSE +0 -0
- {wagtail-6.2.2.dist-info → wagtail-6.3rc1.dist-info}/WHEEL +0 -0
- {wagtail-6.2.2.dist-info → wagtail-6.3rc1.dist-info}/entry_points.txt +0 -0
- {wagtail-6.2.2.dist-info → wagtail-6.3rc1.dist-info}/top_level.txt +0 -0
|
@@ -1,104 +1,75 @@
|
|
|
1
|
-
{% extends "wagtailadmin/
|
|
1
|
+
{% extends "wagtailadmin/generic/edit.html" %}
|
|
2
2
|
{% load wagtailimages_tags wagtailadmin_tags i18n l10n %}
|
|
3
|
-
{% block titletag %}{% blocktrans trimmed with title=image.title %}Editing image {{ title }}{% endblocktrans %}{% endblock %}
|
|
4
|
-
{% block extra_css %}
|
|
5
|
-
{{ block.super }}
|
|
6
|
-
|
|
7
|
-
{{ form.media.css }}
|
|
8
|
-
{% endblock %}
|
|
9
3
|
|
|
10
4
|
{% block extra_js %}
|
|
11
5
|
{{ block.super }}
|
|
12
6
|
|
|
13
|
-
{{ form.media.js }}
|
|
14
|
-
|
|
15
7
|
<!-- Focal point chooser -->
|
|
16
8
|
<script src="{% versioned_static 'wagtailadmin/js/vendor/jquery.ba-throttle-debounce.min.js' %}"></script>
|
|
17
9
|
<script src="{% versioned_static 'wagtailimages/js/vendor/jquery.Jcrop.min.js' %}"></script>
|
|
18
10
|
<script src="{% versioned_static 'wagtailimages/js/focal-point-chooser.js' %}"></script>
|
|
19
11
|
{% endblock %}
|
|
20
12
|
|
|
21
|
-
{% block
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
{% block form_content %}
|
|
14
|
+
<div class="w-grid w-grid-cols-1 sm:w-grid-cols-2 w-gap-8">
|
|
15
|
+
<div>
|
|
16
|
+
<input type="hidden" value="{{ next }}" name="next">
|
|
17
|
+
{% for field in form %}
|
|
18
|
+
{% if field.name == 'file' %}
|
|
19
|
+
{% include "wagtailimages/images/_file_field.html" %}
|
|
20
|
+
{% elif field.is_hidden %}
|
|
21
|
+
{{ field }}
|
|
22
|
+
{% else %}
|
|
23
|
+
{% formattedfield field %}
|
|
24
|
+
{% endif %}
|
|
25
|
+
{% endfor %}
|
|
26
|
+
</div>
|
|
27
|
+
<div>
|
|
28
|
+
{% image image max-800x600 as rendition %}
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{% formattedfield field %}
|
|
38
|
-
{% endif %}
|
|
39
|
-
{% endfor %}
|
|
40
|
-
<div class="w-hidden sm:w-block">
|
|
41
|
-
<input type="submit" value="{% trans 'Save' %}" class="button" />
|
|
42
|
-
{% if user_can_delete %}
|
|
43
|
-
<a href="{% url 'wagtailimages:delete' image.id %}{% if next %}?next={{ next|urlencode }}{% endif %}" class="button no">{% trans "Delete image" %}</a>
|
|
44
|
-
{% endif %}
|
|
45
|
-
</div>
|
|
30
|
+
<div
|
|
31
|
+
class="focal-point-chooser"
|
|
32
|
+
style="max-width: {{ rendition.width|unlocalize }}px; max-height: {{ rendition.height|unlocalize }}px;"
|
|
33
|
+
data-focal-point-x="{{ image.focal_point_x|default_if_none:''|unlocalize }}"
|
|
34
|
+
data-focal-point-y="{{ image.focal_point_y|default_if_none:''|unlocalize }}"
|
|
35
|
+
data-focal-point-width="{{ image.focal_point_width|default_if_none:''|unlocalize }}"
|
|
36
|
+
data-focal-point-height="{{ image.focal_point_height|default_if_none:''|unlocalize }}"
|
|
37
|
+
data-focal-input-label="{% trans 'Image focal point' %}"
|
|
38
|
+
>
|
|
39
|
+
<img {{ rendition.attrs }} decoding="async" data-original-width="{{ image.width|unlocalize }}" data-original-height="{{ image.height|unlocalize }}" class="show-transparency">
|
|
40
|
+
<div class="current-focal-point-indicator{% if not image.has_focal_point %} hidden{% endif %}"></div>
|
|
46
41
|
</div>
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
{%
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
class="focal-point-chooser"
|
|
53
|
-
style="max-width: {{ rendition.width|unlocalize }}px; max-height: {{ rendition.height|unlocalize }}px;"
|
|
54
|
-
data-focal-point-x="{{ image.focal_point_x|default_if_none:''|unlocalize }}"
|
|
55
|
-
data-focal-point-y="{{ image.focal_point_y|default_if_none:''|unlocalize }}"
|
|
56
|
-
data-focal-point-width="{{ image.focal_point_width|default_if_none:''|unlocalize }}"
|
|
57
|
-
data-focal-point-height="{{ image.focal_point_height|default_if_none:''|unlocalize }}"
|
|
58
|
-
data-focal-input-label="{% trans 'Image focal point' %}"
|
|
59
|
-
>
|
|
60
|
-
<img {{ rendition.attrs }} decoding="async" data-original-width="{{ image.width|unlocalize }}" data-original-height="{{ image.height|unlocalize }}" class="show-transparency">
|
|
61
|
-
<div class="current-focal-point-indicator{% if not image.has_focal_point %} hidden{% endif %}"></div>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
{% if url_generator_enabled %}
|
|
65
|
-
<a href="{% url 'wagtailimages:url_generator' image.id %}" class="button bicolor button--icon">{% icon name="link" wrapped=1 %}{% trans "URL Generator" %}</a>
|
|
66
|
-
<hr />
|
|
67
|
-
{% endif %}
|
|
43
|
+
{% if url_generator_url %}
|
|
44
|
+
<a href="{{ url_generator_url }}" class="button bicolor button--icon">{% icon name="link" wrapped=1 %}{% trans "URL Generator" %}</a>
|
|
45
|
+
<hr />
|
|
46
|
+
{% endif %}
|
|
68
47
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
48
|
+
<div class="w-grid md:w-grid-cols-3 w-gap-2">
|
|
49
|
+
<div class="w-col-span-2">
|
|
50
|
+
<h2 class="w-label-3">{% trans "Focal point" %} <span class="w-font-normal">{% trans "(optional)" %}</span></h2>
|
|
51
|
+
<p>{% trans "To define this image's most important region, drag a box over the image above." %} {% if image.has_focal_point %}({% trans "Current focal point shown" %}){% endif %}</p>
|
|
73
52
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
53
|
+
<button class="button button-secondary no remove-focal-point" type="button">{% trans "Remove focal area" %}</button>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="w-col-span-1">
|
|
56
|
+
{% image image original as original_image %}
|
|
78
57
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
58
|
+
<dl>
|
|
59
|
+
<dt>{% trans "Max dimensions" %}</dt>
|
|
60
|
+
<dd>{{ original_image.width|unlocalize }}x{{ original_image.height|unlocalize }}</dd>
|
|
61
|
+
<dt>{% trans "Filesize" %}</dt>
|
|
62
|
+
<dd>{% if filesize %}{{ filesize|filesizeformat }}{% else %}{% trans "File not found" %}{% endif %}</dd>
|
|
84
63
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
64
|
+
<dt>{% trans "Usage" %}</dt>
|
|
65
|
+
<dd>
|
|
66
|
+
{% with image.get_usage.count as usage_count_val %}
|
|
67
|
+
<a href="{{ image.usage_url }}">{% blocktrans trimmed with usage_count=usage_count_val|intcomma count usage_count_val=usage_count_val %}Used {{ usage_count }} time{% plural %}Used {{ usage_count }} times{% endblocktrans %}</a>
|
|
68
|
+
{% endwith %}
|
|
69
|
+
</dd>
|
|
70
|
+
</dl>
|
|
91
71
|
</div>
|
|
92
72
|
</div>
|
|
93
73
|
</div>
|
|
94
|
-
|
|
95
|
-
<div class="row row-flush nice-padding sm:!w-hidden">
|
|
96
|
-
<div class="col5">
|
|
97
|
-
<input type="submit" value="{% trans 'Save' %}" class="button" />
|
|
98
|
-
{% if user_can_delete %}
|
|
99
|
-
<a href="{% url 'wagtailimages:delete' image.id %}{% if next %}?next={{ next }}{% endif %}" class="button no">{% trans "Delete image" %}</a>
|
|
100
|
-
{% endif %}
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
</form>
|
|
74
|
+
</div>
|
|
104
75
|
{% endblock %}
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
{% block extra_js %}
|
|
5
5
|
{{ block.super }}
|
|
6
|
-
<script>
|
|
7
|
-
window.wagtailConfig.BULK_ACTION_ITEM_TYPE = 'IMAGE';
|
|
8
|
-
</script>
|
|
9
6
|
<script defer src="{% versioned_static 'wagtailadmin/js/bulk-actions.js' %}"></script>
|
|
10
7
|
{% endblock %}
|
|
11
8
|
|
|
@@ -24,5 +21,5 @@
|
|
|
24
21
|
|
|
25
22
|
{% block bulk_actions %}
|
|
26
23
|
{% trans "Select all images in listing" as select_all_text %}
|
|
27
|
-
{% include 'wagtailadmin/bulk_actions/footer.html' with select_all_obj_text=select_all_text app_label=model_opts.app_label model_name=model_opts.model_name objects=page_obj parent=current_collection.id %}
|
|
24
|
+
{% include 'wagtailadmin/bulk_actions/footer.html' with select_all_obj_text=select_all_text app_label=model_opts.app_label model_name=model_opts.model_name objects=page_obj parent=current_collection.id item_type="IMAGE" %}
|
|
28
25
|
{% endblock %}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
{% endblock %}
|
|
11
11
|
|
|
12
12
|
{% block main_content %}
|
|
13
|
-
<div class="w-image-url-generator
|
|
13
|
+
<div class="w-image-url-generator w-mt-8" data-generator-url="{% url 'wagtailimages:generate_url' object.id '__filterspec__' %}">
|
|
14
14
|
<form class="w-image-url-generator__form w-mb-5">
|
|
15
15
|
{% include "wagtailadmin/shared/field.html" with field=form.filter_method %}
|
|
16
16
|
{% field_row max_content=True %}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{% extends "wagtailadmin/base.html" %}
|
|
1
|
+
{% extends "wagtailadmin/generic/base.html" %}
|
|
2
2
|
{% load i18n %}
|
|
3
3
|
{% load l10n %}
|
|
4
4
|
{% load wagtailadmin_tags wagtailimages_tags %}
|
|
@@ -9,43 +9,48 @@
|
|
|
9
9
|
{{ form_media.css }}
|
|
10
10
|
{% endblock %}
|
|
11
11
|
|
|
12
|
-
{% block
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
{% block main_content %}
|
|
13
|
+
<div class="drop-zone w-mt-8">
|
|
14
|
+
<p>{% trans "Drag and drop images into this area to upload immediately." %}</p>
|
|
15
|
+
<p>{{ help_text }}</p>
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{%
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
</
|
|
17
|
+
<form action="{% url 'wagtailimages:add_multiple' %}" method="POST" enctype="multipart/form-data">
|
|
18
|
+
<div class="replace-file-input">
|
|
19
|
+
<button class="button bicolor button--icon">{% icon name="plus" wrapped=1 %}{% trans "Or choose from your computer" %}</button>
|
|
20
|
+
<input
|
|
21
|
+
id="fileupload"
|
|
22
|
+
multiple
|
|
23
|
+
name="files[]"
|
|
24
|
+
type="file"
|
|
25
|
+
data-accept-file-types="/\.({{ allowed_extensions|join:'|' }})$/i"
|
|
26
|
+
data-max-file-size="{{ max_filesize|stringformat:'s'|default:'null' }}"
|
|
27
|
+
data-max-title-length="{{ max_title_length|stringformat:'s'|default:'null' }}"
|
|
28
|
+
data-messages='{"maxFileSize": "{{ error_max_file_size|escapejs }}", "acceptFileTypes": "{{ error_accepted_file_types|escapejs }}"}'
|
|
29
|
+
data-url="{% url 'wagtailimages:add_multiple' %}"
|
|
30
|
+
>
|
|
31
|
+
</div>
|
|
32
|
+
{% csrf_token %}
|
|
33
|
+
{% if collections %}
|
|
34
|
+
{% trans "Add to collection:" as label_text %}
|
|
35
|
+
{% rawformattedfield label_text=label_text id_for_label="id_addimage_collection" classname="w-mx-auto w-mt-4 w-grid w-justify-center" %}
|
|
36
|
+
<select id="id_addimage_collection" name="collection">
|
|
37
|
+
{% for pk, display_name in collections.get_indented_choices %}
|
|
38
|
+
<option value="{{ pk|unlocalize }}"{% if pk|unlocalize == selected_collection_id %} selected{% endif %} >
|
|
39
|
+
{{ display_name }}
|
|
40
|
+
</option>
|
|
41
|
+
{% endfor %}
|
|
42
|
+
</select>
|
|
43
|
+
{% endrawformattedfield %}
|
|
44
|
+
{% endif %}
|
|
45
|
+
</form>
|
|
46
|
+
</div>
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
<div id="overall-progress" class="progress progress-secondary">
|
|
49
|
+
<div class="bar" style="width: 0%;">0%</div>
|
|
47
50
|
</div>
|
|
48
51
|
|
|
52
|
+
<ul id="upload-list" class="upload-list multiple"></ul>
|
|
53
|
+
|
|
49
54
|
<template id="upload-list-item">
|
|
50
55
|
<li class="row">
|
|
51
56
|
<div class="left col3">
|
|
@@ -59,6 +64,7 @@
|
|
|
59
64
|
</div>
|
|
60
65
|
</div>
|
|
61
66
|
<div class="right col9">
|
|
67
|
+
<p class="error-message">{% trans "Please provide an image description to comply with best practices for accessibility." %}</p>
|
|
62
68
|
<p class="status-msg success">{% trans "Upload successful. Please update this image with a more appropriate title, if necessary. You may also delete the image completely if the upload wasn't required." %}</p>
|
|
63
69
|
<p class="status-msg warning">
|
|
64
70
|
{% trans "Upload successful. However, your new image seems to be a duplicate of this existing image. You may delete it if it wasn't required." %}
|
|
@@ -93,17 +99,4 @@
|
|
|
93
99
|
|
|
94
100
|
<!-- Main script -->
|
|
95
101
|
<script src="{% versioned_static 'wagtailimages/js/add-multiple.js' %}"></script>
|
|
96
|
-
|
|
97
|
-
<script>
|
|
98
|
-
window.fileupload_opts = {
|
|
99
|
-
simple_upload_url: "{% url 'wagtailimages:add' %}",
|
|
100
|
-
accepted_file_types: /\.({{ allowed_extensions|join:"|" }})$/i, //must be regex
|
|
101
|
-
max_file_size: {{ max_filesize|stringformat:"s"|default:"null" }}, //numeric format
|
|
102
|
-
max_title_length: {{ max_title_length|stringformat:"s"|default:"null" }}, //numeric format
|
|
103
|
-
errormessages: {
|
|
104
|
-
max_file_size: "{{ error_max_file_size|escapejs }}",
|
|
105
|
-
accepted_file_types: "{{ error_accepted_file_types|escapejs }}"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
</script>
|
|
109
102
|
{% endblock %}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
|
|
4
4
|
{% block chosen_icon %}
|
|
5
5
|
{# Empty alt because the chosen item’s title is already displayed next to the image. #}
|
|
6
|
-
<img class="chooser__image" data-chooser-image alt=""
|
|
6
|
+
<img class="chooser__image show-transparency" data-chooser-image alt="" decoding="async" height="{{ preview.height|unlocalize }}" src="{{ preview.url }}" width="{{ preview.width|unlocalize }}">
|
|
7
7
|
{% endblock chosen_icon %}
|
|
@@ -16,6 +16,7 @@ from django.utils.encoding import force_str
|
|
|
16
16
|
from django.utils.html import escape, escapejs
|
|
17
17
|
from django.utils.http import RFC3986_SUBDELIMS, urlencode
|
|
18
18
|
from django.utils.safestring import mark_safe
|
|
19
|
+
from django.utils.text import capfirst
|
|
19
20
|
from willow.optimizers.base import OptimizerBase
|
|
20
21
|
from willow.registry import registry
|
|
21
22
|
|
|
@@ -37,6 +38,7 @@ from wagtail.test.testapp.models import (
|
|
|
37
38
|
VariousOnDeleteModel,
|
|
38
39
|
)
|
|
39
40
|
from wagtail.test.utils import WagtailTestUtils
|
|
41
|
+
from wagtail.test.utils.template_tests import AdminTemplateTestUtils
|
|
40
42
|
from wagtail.test.utils.timestamps import local_datetime
|
|
41
43
|
|
|
42
44
|
from .utils import Image, get_test_image_file, get_test_image_file_svg
|
|
@@ -83,12 +85,10 @@ class TestImageIndexView(WagtailTestUtils, TestCase):
|
|
|
83
85
|
self.assertContains(response, "a cute puppy")
|
|
84
86
|
|
|
85
87
|
def test_pagination(self):
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
response = self.get({"p": 9999})
|
|
91
|
-
self.assertEqual(response.status_code, 404)
|
|
88
|
+
pages = ["0", "1", "-1", "9999", "Not a page"]
|
|
89
|
+
for page in pages:
|
|
90
|
+
response = self.get({"p": page})
|
|
91
|
+
self.assertEqual(response.status_code, 200)
|
|
92
92
|
|
|
93
93
|
def test_pagination_preserves_other_params(self):
|
|
94
94
|
root_collection = Collection.get_first_root_node()
|
|
@@ -539,7 +539,7 @@ class TestImageListingResultsView(WagtailTestUtils, TransactionTestCase):
|
|
|
539
539
|
)
|
|
540
540
|
|
|
541
541
|
|
|
542
|
-
class TestImageAddView(WagtailTestUtils, TestCase):
|
|
542
|
+
class TestImageAddView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
|
|
543
543
|
def setUp(self):
|
|
544
544
|
self.login()
|
|
545
545
|
|
|
@@ -567,6 +567,14 @@ class TestImageAddView(WagtailTestUtils, TestCase):
|
|
|
567
567
|
# draftail should NOT be a standard JS include on this page
|
|
568
568
|
self.assertNotContains(response, "wagtailadmin/js/draftail.js")
|
|
569
569
|
|
|
570
|
+
self.assertBreadcrumbsItemsRendered(
|
|
571
|
+
[
|
|
572
|
+
{"url": reverse("wagtailimages:index"), "label": "Images"},
|
|
573
|
+
{"url": "", "label": "New: Image"},
|
|
574
|
+
],
|
|
575
|
+
response.content,
|
|
576
|
+
)
|
|
577
|
+
|
|
570
578
|
def test_get_with_collections(self):
|
|
571
579
|
root_collection = Collection.get_first_root_node()
|
|
572
580
|
root_collection.add_child(name="Evil plans")
|
|
@@ -951,7 +959,7 @@ class TestImageAddViewWithLimitedCollectionPermissions(WagtailTestUtils, TestCas
|
|
|
951
959
|
)
|
|
952
960
|
|
|
953
961
|
|
|
954
|
-
class TestImageEditView(WagtailTestUtils, TestCase):
|
|
962
|
+
class TestImageEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
|
|
955
963
|
def setUp(self):
|
|
956
964
|
self.user = self.login()
|
|
957
965
|
|
|
@@ -989,6 +997,14 @@ class TestImageEditView(WagtailTestUtils, TestCase):
|
|
|
989
997
|
# definitions are being respected)
|
|
990
998
|
self.assertNotContains(response, "wagtailadmin/js/draftail.js")
|
|
991
999
|
|
|
1000
|
+
self.assertBreadcrumbsItemsRendered(
|
|
1001
|
+
[
|
|
1002
|
+
{"url": reverse("wagtailimages:index"), "label": "Images"},
|
|
1003
|
+
{"url": "", "label": "Test image"},
|
|
1004
|
+
],
|
|
1005
|
+
response.content,
|
|
1006
|
+
)
|
|
1007
|
+
|
|
992
1008
|
def test_simple_with_collection_nesting(self):
|
|
993
1009
|
root_collection = Collection.get_first_root_node()
|
|
994
1010
|
evil_plans = root_collection.add_child(name="Evil plans")
|
|
@@ -1605,6 +1621,10 @@ class TestImageChooserView(WagtailTestUtils, TestCase):
|
|
|
1605
1621
|
# draftail should NOT be a standard JS include on this page
|
|
1606
1622
|
self.assertNotIn("wagtailadmin/js/draftail.js", response_json["html"])
|
|
1607
1623
|
|
|
1624
|
+
# upload file field should have accept="image/*"
|
|
1625
|
+
soup = self.get_soup(response_json["html"])
|
|
1626
|
+
self.assertEqual(soup.select_one('input[type="file"]').get("accept"), "image/*")
|
|
1627
|
+
|
|
1608
1628
|
def test_simple_with_collection_nesting(self):
|
|
1609
1629
|
root_collection = Collection.get_first_root_node()
|
|
1610
1630
|
evil_plans = root_collection.add_child(name="Evil plans")
|
|
@@ -1614,6 +1634,22 @@ class TestImageChooserView(WagtailTestUtils, TestCase):
|
|
|
1614
1634
|
# "Eviler Plans" should be prefixed with ↳ (↳) and 4 non-breaking spaces.
|
|
1615
1635
|
self.assertContains(response, " ↳ Eviler plans")
|
|
1616
1636
|
|
|
1637
|
+
@override_settings(
|
|
1638
|
+
WAGTAILIMAGES_EXTENSIONS=["gif", "jpg", "jpeg", "png", "webp", "avif", "heic"]
|
|
1639
|
+
)
|
|
1640
|
+
def test_upload_field_accepts_heic(self):
|
|
1641
|
+
response = self.get()
|
|
1642
|
+
self.assertEqual(response.status_code, 200)
|
|
1643
|
+
response_json = json.loads(response.content.decode())
|
|
1644
|
+
self.assertEqual(response_json["step"], "choose")
|
|
1645
|
+
self.assertTemplateUsed(response, "wagtailimages/chooser/chooser.html")
|
|
1646
|
+
|
|
1647
|
+
# upload file field should have an explicit 'accept' case for image/heic
|
|
1648
|
+
soup = self.get_soup(response_json["html"])
|
|
1649
|
+
self.assertEqual(
|
|
1650
|
+
soup.select_one('input[type="file"]').get("accept"), "image/*, image/heic"
|
|
1651
|
+
)
|
|
1652
|
+
|
|
1617
1653
|
def test_choose_permissions(self):
|
|
1618
1654
|
# Create group with access to admin and Chooser permission on one Collection, but not another.
|
|
1619
1655
|
bakers_group = Group.objects.create(name="Bakers")
|
|
@@ -2362,7 +2398,7 @@ class TestImageChooserUploadViewWithLimitedPermissions(WagtailTestUtils, TestCas
|
|
|
2362
2398
|
)
|
|
2363
2399
|
|
|
2364
2400
|
|
|
2365
|
-
class TestMultipleImageUploader(WagtailTestUtils, TestCase):
|
|
2401
|
+
class TestMultipleImageUploader(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
|
|
2366
2402
|
"""
|
|
2367
2403
|
This tests the multiple image upload views located in wagtailimages/views/multiple.py
|
|
2368
2404
|
"""
|
|
@@ -2392,6 +2428,17 @@ class TestMultipleImageUploader(WagtailTestUtils, TestCase):
|
|
|
2392
2428
|
# definitions are being respected)
|
|
2393
2429
|
self.assertNotContains(response, "wagtailadmin/js/draftail.js")
|
|
2394
2430
|
|
|
2431
|
+
self.assertBreadcrumbsItemsRendered(
|
|
2432
|
+
[
|
|
2433
|
+
{
|
|
2434
|
+
"url": reverse("wagtailimages:index"),
|
|
2435
|
+
"label": capfirst(self.image._meta.verbose_name_plural),
|
|
2436
|
+
},
|
|
2437
|
+
{"url": "", "label": "Add images"},
|
|
2438
|
+
],
|
|
2439
|
+
response.content,
|
|
2440
|
+
)
|
|
2441
|
+
|
|
2395
2442
|
@override_settings(WAGTAILIMAGES_MAX_UPLOAD_SIZE=1000)
|
|
2396
2443
|
def test_add_max_file_size_context_variables(self):
|
|
2397
2444
|
response = self.client.get(reverse("wagtailimages:add_multiple"))
|
|
@@ -3370,7 +3417,7 @@ class TestMultipleImageUploaderWithCustomRequiredFields(WagtailTestUtils, TestCa
|
|
|
3370
3417
|
self.assertTrue(response_json["success"])
|
|
3371
3418
|
|
|
3372
3419
|
|
|
3373
|
-
class TestURLGeneratorView(WagtailTestUtils, TestCase):
|
|
3420
|
+
class TestURLGeneratorView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
|
|
3374
3421
|
def setUp(self):
|
|
3375
3422
|
# Create an image for running tests on
|
|
3376
3423
|
self.image = Image.objects.create(
|
|
@@ -3393,6 +3440,19 @@ class TestURLGeneratorView(WagtailTestUtils, TestCase):
|
|
|
3393
3440
|
# Check response
|
|
3394
3441
|
self.assertEqual(response.status_code, 200)
|
|
3395
3442
|
self.assertTemplateUsed(response, "wagtailimages/images/url_generator.html")
|
|
3443
|
+
self.assertTemplateUsed(response, "wagtailadmin/generic/base.html")
|
|
3444
|
+
|
|
3445
|
+
self.assertBreadcrumbsItemsRendered(
|
|
3446
|
+
[
|
|
3447
|
+
{"url": reverse("wagtailimages:index"), "label": "Images"},
|
|
3448
|
+
{
|
|
3449
|
+
"url": reverse("wagtailimages:edit", args=(self.image.id,)),
|
|
3450
|
+
"label": "Test image",
|
|
3451
|
+
},
|
|
3452
|
+
{"url": "", "label": "Generate URL", "sublabel": "Test image"},
|
|
3453
|
+
],
|
|
3454
|
+
response.content,
|
|
3455
|
+
)
|
|
3396
3456
|
|
|
3397
3457
|
def test_get_bad_permissions(self):
|
|
3398
3458
|
"""
|