wagtail 6.3.2__py3-none-any.whl → 6.4rc1__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/publish_revision.py +4 -5
- wagtail/admin/auth.py +0 -2
- wagtail/admin/checks.py +1 -1
- wagtail/admin/filters.py +3 -1
- wagtail/admin/forms/account.py +21 -11
- wagtail/admin/forms/collections.py +2 -9
- wagtail/admin/forms/formsets.py +32 -0
- wagtail/admin/forms/pages.py +5 -1
- wagtail/admin/forms/workflows.py +2 -13
- wagtail/admin/locale/ar/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/ar/LC_MESSAGES/django.po +68 -1
- wagtail/admin/locale/ar/LC_MESSAGES/djangojs.mo +0 -0
- wagtail/admin/locale/ar/LC_MESSAGES/djangojs.po +5 -1
- wagtail/admin/locale/en/LC_MESSAGES/django.po +312 -356
- wagtail/admin/locale/en/LC_MESSAGES/djangojs.po +21 -16
- wagtail/admin/menu.py +0 -13
- wagtail/admin/panels/base.py +2 -2
- wagtail/admin/panels/group.py +4 -1
- wagtail/admin/panels/inline_panel.py +5 -2
- wagtail/admin/panels/model_utils.py +36 -0
- wagtail/admin/panels/page_utils.py +2 -40
- wagtail/admin/panels/signal_handlers.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/css/panels/streamfield.css +1 -1
- wagtail/admin/static/wagtailadmin/js/comments.js +1 -1
- wagtail/admin/static/wagtailadmin/js/core.js +1 -1
- wagtail/admin/static/wagtailadmin/js/core.js.LICENSE.txt +1 -8
- wagtail/admin/static/wagtailadmin/js/draftail.js +1 -1
- wagtail/admin/static/wagtailadmin/js/modal-workflow.js +1 -1
- wagtail/admin/static/wagtailadmin/js/page-chooser-modal.js +1 -1
- wagtail/admin/static/wagtailadmin/js/privacy-switch.js +1 -1
- wagtail/admin/static/wagtailadmin/js/sidebar.js +1 -1
- wagtail/admin/static/wagtailadmin/js/telepath/blocks.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/vendor.js.LICENSE.txt +7 -0
- wagtail/admin/templates/wagtailadmin/404.html +4 -0
- wagtail/admin/templates/wagtailadmin/chooser/browse.html +2 -1
- wagtail/admin/templates/wagtailadmin/chooser/tables/parent_page_cell.html +1 -1
- wagtail/admin/templates/wagtailadmin/collections/_privacy_switch.html +8 -1
- wagtail/admin/templates/wagtailadmin/generic/confirm_delete.html +15 -9
- wagtail/admin/templates/wagtailadmin/generic/confirm_unpublish.html +21 -25
- wagtail/admin/templates/wagtailadmin/generic/form.html +1 -1
- wagtail/admin/templates/wagtailadmin/generic/preview_error.html +3 -0
- wagtail/admin/templates/wagtailadmin/generic/revisions/compare.html +63 -76
- wagtail/admin/templates/wagtailadmin/pages/_editor_js.html +0 -2
- wagtail/admin/templates/wagtailadmin/pages/edit.html +1 -5
- wagtail/admin/templates/wagtailadmin/panels/inline_panel_child.html +1 -0
- wagtail/admin/templates/wagtailadmin/permissions/includes/collection_member_permissions_form.html +1 -1
- wagtail/admin/templates/wagtailadmin/permissions/includes/collection_member_permissions_formset.html +6 -22
- wagtail/admin/templates/wagtailadmin/shared/formatted_field.html +2 -2
- wagtail/admin/templates/wagtailadmin/shared/header.html +2 -2
- wagtail/admin/templates/wagtailadmin/shared/page_status_tag_new.html +32 -39
- wagtail/admin/templates/wagtailadmin/shared/revisions/confirm_unschedule.html +13 -17
- wagtail/admin/templates/wagtailadmin/shared/side_panels/includes/status/privacy.html +15 -3
- wagtail/admin/templates/wagtailadmin/shared/side_panels/preview.html +1 -1
- wagtail/admin/templates/wagtailadmin/skeleton.html +4 -2
- wagtail/admin/templates/wagtailadmin/workflows/create.html +1 -1
- wagtail/admin/templates/wagtailadmin/workflows/edit.html +1 -1
- wagtail/admin/templates/wagtailadmin/workflows/includes/workflow_pages_form.html +1 -1
- wagtail/admin/templates/wagtailadmin/workflows/includes/workflow_pages_formset.html +6 -23
- wagtail/admin/templatetags/wagtailadmin_tags.py +12 -0
- wagtail/admin/templatetags/wagtailuserbar.py +2 -3
- wagtail/admin/tests/pages/test_create_page.py +110 -1
- wagtail/admin/tests/pages/test_edit_page.py +3 -2
- wagtail/admin/tests/pages/test_explorer_view.py +18 -0
- wagtail/admin/tests/pages/test_page_usage.py +24 -20
- wagtail/admin/tests/pages/test_preview.py +69 -1
- wagtail/admin/tests/pages/test_revisions.py +40 -6
- wagtail/admin/tests/test_account_management.py +39 -1
- wagtail/admin/tests/test_audit_log.py +4 -2
- wagtail/admin/tests/test_block_preview.py +224 -0
- wagtail/admin/tests/test_edit_handlers.py +23 -6
- wagtail/admin/tests/test_page_chooser.py +50 -3
- wagtail/admin/tests/test_privacy.py +49 -26
- wagtail/admin/tests/test_site_summary.py +15 -10
- wagtail/admin/tests/test_templatetags.py +19 -0
- wagtail/admin/tests/test_userbar.py +82 -1
- wagtail/admin/tests/test_views_generic.py +27 -12
- wagtail/admin/tests/test_workflows.py +69 -0
- wagtail/admin/tests/tests.py +23 -4
- wagtail/admin/tests/ui/test_sidebar.py +1 -1
- wagtail/admin/tests/viewsets/test_model_viewset.py +15 -13
- wagtail/admin/ui/side_panels.py +7 -4
- wagtail/admin/urls/__init__.py +6 -0
- wagtail/admin/urls/pages.py +1 -1
- wagtail/admin/userbar.py +21 -1
- wagtail/admin/views/account.py +5 -0
- wagtail/admin/views/chooser.py +5 -1
- wagtail/admin/views/collections.py +0 -2
- wagtail/admin/views/generic/base.py +20 -10
- wagtail/admin/views/generic/history.py +0 -1
- wagtail/admin/views/generic/models.py +79 -21
- wagtail/admin/views/generic/preview.py +50 -1
- wagtail/admin/views/mixins.py +4 -2
- wagtail/admin/views/pages/bulk_actions/delete.py +11 -23
- wagtail/admin/views/pages/bulk_actions/page_bulk_action.py +17 -0
- wagtail/admin/views/pages/bulk_actions/publish.py +11 -31
- wagtail/admin/views/pages/bulk_actions/unpublish.py +11 -31
- wagtail/admin/views/pages/create.py +1 -0
- wagtail/admin/views/pages/edit.py +38 -30
- wagtail/admin/views/pages/revisions.py +43 -114
- wagtail/admin/views/pages/utils.py +0 -1
- wagtail/admin/views/tags.py +6 -2
- wagtail/admin/views/workflows.py +8 -6
- wagtail/admin/viewsets/model.py +0 -4
- wagtail/admin/viewsets/pages.py +0 -1
- wagtail/admin/widgets/tags.py +1 -0
- wagtail/api/v2/tests/test_documents.py +4 -2
- wagtail/api/v2/tests/test_images.py +4 -2
- wagtail/api/v2/tests/test_pages.py +8 -4
- wagtail/blocks/base.py +59 -1
- wagtail/blocks/field_block.py +6 -0
- wagtail/blocks/list_block.py +4 -0
- wagtail/blocks/static_block.py +3 -0
- wagtail/blocks/stream_block.py +5 -1
- wagtail/blocks/struct_block.py +6 -0
- wagtail/compat.py +16 -0
- wagtail/contrib/forms/forms.py +27 -7
- wagtail/contrib/forms/locale/en/LC_MESSAGES/django.po +2 -2
- wagtail/contrib/forms/tests/test_models.py +7 -5
- wagtail/contrib/forms/tests/test_views.py +75 -0
- wagtail/contrib/frontend_cache/tasks.py +83 -0
- wagtail/contrib/frontend_cache/tests.py +47 -32
- wagtail/contrib/frontend_cache/utils.py +2 -70
- wagtail/contrib/redirects/base_formats.py +2 -2
- wagtail/contrib/redirects/locale/ar/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/redirects/locale/ar/LC_MESSAGES/django.po +3 -0
- wagtail/contrib/redirects/locale/en/LC_MESSAGES/django.po +24 -37
- wagtail/contrib/redirects/templates/wagtailredirects/add.html +1 -24
- wagtail/contrib/redirects/templates/wagtailredirects/confirm_delete.html +3 -13
- wagtail/contrib/redirects/tests/test_redirects.py +122 -110
- wagtail/contrib/redirects/tests/test_signal_handlers.py +75 -69
- wagtail/contrib/redirects/urls.py +2 -2
- wagtail/contrib/redirects/views.py +35 -73
- wagtail/contrib/search_promotions/admin_urls.py +10 -3
- wagtail/contrib/search_promotions/forms.py +55 -26
- wagtail/contrib/search_promotions/locale/en/LC_MESSAGES/django.po +44 -54
- wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/add.html +21 -31
- wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/confirm_delete.html +3 -12
- wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/edit.html +11 -34
- wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/includes/searchpromotion_form.html +1 -0
- wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/includes/searchpromotions_formset.js +2 -1
- wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/index.html +0 -1
- wagtail/contrib/search_promotions/tests.py +814 -13
- wagtail/contrib/search_promotions/views/__init__.py +1 -0
- wagtail/contrib/search_promotions/views/reports.py +56 -0
- wagtail/contrib/search_promotions/views/settings.py +258 -0
- wagtail/contrib/search_promotions/wagtail_hooks.py +12 -1
- wagtail/contrib/settings/locale/ar/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/settings/locale/ar/LC_MESSAGES/django.po +6 -1
- wagtail/contrib/settings/locale/en/LC_MESSAGES/django.po +3 -3
- wagtail/contrib/settings/templates/wagtailsettings/edit.html +1 -5
- wagtail/contrib/settings/tests/generic/test_admin.py +2 -5
- wagtail/contrib/settings/tests/generic/test_register.py +1 -1
- wagtail/contrib/settings/tests/site_specific/test_admin.py +2 -5
- wagtail/contrib/settings/tests/site_specific/test_register.py +1 -1
- wagtail/contrib/settings/views.py +9 -23
- wagtail/contrib/simple_translation/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/styleguide/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/table_block/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/table_block/tests.py +4 -1
- wagtail/contrib/typed_table_block/blocks.py +3 -0
- wagtail/contrib/typed_table_block/locale/en/LC_MESSAGES/django.po +10 -10
- wagtail/contrib/typed_table_block/static/typed_table_block/js/typed_table_block.js +1 -1
- wagtail/contrib/typed_table_block/tests.py +33 -0
- wagtail/documents/locale/en/LC_MESSAGES/django.po +26 -26
- wagtail/documents/migrations/0011_add_choose_permissions.py +1 -0
- wagtail/documents/models.py +1 -0
- wagtail/documents/signal_handlers.py +6 -2
- wagtail/documents/static/wagtaildocs/js/add-multiple.js +1 -1
- wagtail/documents/templates/wagtaildocs/documents/edit.html +1 -3
- wagtail/documents/templates/wagtaildocs/multiple/add.html +7 -1
- wagtail/documents/tests/test_admin_views.py +74 -33
- wagtail/documents/tests/test_views.py +21 -12
- wagtail/documents/views/chooser.py +1 -0
- wagtail/documents/views/documents.py +1 -2
- wagtail/documents/views/multiple.py +0 -1
- wagtail/documents/views/serve.py +9 -2
- wagtail/documents/wagtail_hooks.py +6 -1
- wagtail/embeds/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/embeds/oembed_providers.py +0 -64
- wagtail/fields.py +3 -0
- wagtail/images/apps.py +2 -1
- wagtail/images/blocks.py +6 -2
- wagtail/images/forms.py +40 -3
- wagtail/images/locale/ar/LC_MESSAGES/django.mo +0 -0
- wagtail/images/locale/ar/LC_MESSAGES/django.po +4 -0
- wagtail/images/locale/en/LC_MESSAGES/django.po +49 -49
- wagtail/images/migrations/0023_add_choose_permissions.py +1 -0
- wagtail/images/rich_text/contentstate.py +1 -0
- wagtail/images/rich_text/editor_html.py +1 -0
- wagtail/images/signal_handlers.py +17 -10
- wagtail/images/static/wagtailimages/js/add-multiple.js +1 -1
- wagtail/images/static/wagtailimages/js/image-block.js +1 -1
- wagtail/images/static/wagtailimages/js/image-chooser-telepath.js +1 -1
- wagtail/images/static/wagtailimages/js/image-chooser.js +1 -1
- wagtail/images/static/wagtailimages/js/image-url-generator.js +1 -1
- wagtail/images/static/wagtailimages/js/vendor/jquery.fileupload-image.js +1 -1
- wagtail/images/tasks.py +18 -0
- wagtail/images/templates/wagtailimages/images/edit.html +1 -3
- wagtail/images/templates/wagtailimages/images/url_generator.html +1 -1
- wagtail/images/templates/wagtailimages/multiple/add.html +7 -2
- wagtail/images/templates/wagtailimages/widgets/image_chooser.html +1 -1
- wagtail/images/tests/test_admin_views.py +53 -29
- wagtail/images/tests/test_blocks.py +3 -2
- wagtail/images/tests/test_models.py +12 -10
- wagtail/images/tests/tests.py +10 -0
- wagtail/images/views/chooser.py +1 -0
- wagtail/images/views/images.py +1 -3
- wagtail/images/views/multiple.py +0 -1
- wagtail/images/views/serve.py +18 -2
- wagtail/images/widgets.py +3 -0
- wagtail/locale/en/LC_MESSAGES/django.po +228 -216
- wagtail/locales/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/management/commands/publish_scheduled.py +1 -1
- wagtail/migrations/0087_alter_grouppagepermission_unique_together_and_more.py +16 -8
- wagtail/models/__init__.py +300 -119
- wagtail/models/i18n.py +2 -2
- wagtail/models/panels.py +37 -0
- wagtail/models/sites.py +7 -6
- wagtail/permission_policies/pages.py +2 -2
- wagtail/project_template/project_name/settings/base.py +4 -0
- wagtail/project_template/requirements.txt +1 -1
- wagtail/query.py +145 -0
- wagtail/search/backends/database/mysql/mysql.py +25 -17
- wagtail/search/backends/database/postgres/postgres.py +44 -83
- wagtail/search/backends/database/sqlite/sqlite.py +25 -17
- wagtail/search/backends/elasticsearch7.py +4 -0
- wagtail/search/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/search/query.py +8 -2
- wagtail/search/signal_handlers.py +6 -9
- wagtail/search/tasks.py +10 -0
- wagtail/search/tests/test_elasticsearch7_backend.py +21 -0
- wagtail/search/tests/test_index_functions.py +10 -6
- wagtail/search/tests/test_postgres_backend.py +0 -14
- wagtail/signal_handlers.py +5 -20
- wagtail/sites/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/snippets/locale/en/LC_MESSAGES/django.po +3 -13
- wagtail/snippets/tests/test_preview.py +5 -0
- wagtail/snippets/tests/test_snippets.py +100 -45
- wagtail/snippets/tests/test_usage.py +29 -24
- wagtail/snippets/tests/test_viewset.py +1 -1
- wagtail/snippets/views/snippets.py +0 -12
- wagtail/tasks.py +41 -0
- wagtail/templates/wagtailcore/shared/block_preview.html +29 -0
- wagtail/test/earlypage/__init__.py +0 -0
- wagtail/test/earlypage/migrations/0001_initial.py +37 -0
- wagtail/test/earlypage/migrations/__init__.py +0 -0
- wagtail/test/earlypage/models.py +14 -0
- wagtail/test/settings.py +3 -0
- wagtail/test/testapp/fixtures/test.json +7 -0
- wagtail/test/testapp/fixtures/test_specific.json +6 -3
- wagtail/test/testapp/models.py +58 -44
- wagtail/test/testapp/templates/tests/custom_block_preview.html +16 -0
- wagtail/test/testapp/templates/tests/static_block_preview.html +5 -0
- wagtail/test/testapp/wagtail_hooks.py +9 -0
- wagtail/tests/test_blocks.py +189 -2
- wagtail/tests/test_hooks.py +166 -1
- wagtail/tests/test_management_commands.py +54 -13
- wagtail/tests/test_page_allowed_http_methods.py +32 -0
- wagtail/tests/test_page_model.py +68 -0
- wagtail/tests/test_page_privacy.py +10 -0
- wagtail/tests/test_page_queryset.py +79 -0
- wagtail/tests/test_reference_index.py +84 -75
- wagtail/tests/test_streamfield.py +30 -0
- wagtail/tests/test_utils.py +61 -0
- wagtail/users/forms.py +2 -9
- wagtail/users/locale/en/LC_MESSAGES/django.po +17 -17
- wagtail/users/templates/wagtailusers/groups/create.html +0 -5
- wagtail/users/templates/wagtailusers/groups/includes/page_permissions_form.html +1 -1
- wagtail/users/templates/wagtailusers/groups/includes/page_permissions_formset.html +6 -6
- wagtail/users/tests/test_admin_views.py +96 -4
- wagtail/users/tests/test_utils.py +76 -0
- wagtail/users/utils.py +43 -11
- wagtail/utils/setup.py +2 -2
- wagtail/utils/templates.py +26 -0
- wagtail/utils/widgets.py +1 -0
- wagtail/views.py +9 -1
- wagtail/wagtail_hooks.py +67 -29
- {wagtail-6.3.2.dist-info → wagtail-6.4rc1.dist-info}/METADATA +2 -2
- {wagtail-6.3.2.dist-info → wagtail-6.4rc1.dist-info}/RECORD +289 -276
- wagtail/admin/static/wagtailadmin/js/expanding-formset.js +0 -1
- wagtail/admin/static/wagtailadmin/js/vendor/rangy-core.js +0 -1
- wagtail/admin/static/wagtailadmin/js/vendor/uuidv4.min.js +0 -1
- wagtail/contrib/search_promotions/views.py +0 -323
- wagtail/images/static/wagtailimages/js/vendor/canvas-to-blob.min.js +0 -1
- wagtail/users/static/wagtailusers/js/group-form.js +0 -1
- wagtail/users/templates/wagtailusers/groups/includes/group_form_js.html +0 -3
- {wagtail-6.3.2.dist-info → wagtail-6.4rc1.dist-info}/LICENSE +0 -0
- {wagtail-6.3.2.dist-info → wagtail-6.4rc1.dist-info}/WHEEL +0 -0
- {wagtail-6.3.2.dist-info → wagtail-6.4rc1.dist-info}/entry_points.txt +0 -0
- {wagtail-6.3.2.dist-info → wagtail-6.4rc1.dist-info}/top_level.txt +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import os
|
|
2
2
|
|
|
3
|
-
from django.core.exceptions import
|
|
3
|
+
from django.core.exceptions import SuspiciousOperation
|
|
4
4
|
from django.db import transaction
|
|
5
|
-
from django.shortcuts import
|
|
6
|
-
from django.template.response import TemplateResponse
|
|
5
|
+
from django.shortcuts import redirect, render
|
|
7
6
|
from django.urls import reverse
|
|
8
7
|
from django.utils.encoding import force_str
|
|
9
8
|
from django.utils.functional import cached_property
|
|
@@ -18,7 +17,6 @@ from wagtail.admin.ui.tables import Column, StatusTagColumn, TitleColumn
|
|
|
18
17
|
from wagtail.admin.views import generic
|
|
19
18
|
from wagtail.admin.widgets.button import Button
|
|
20
19
|
from wagtail.contrib.frontend_cache.utils import PurgeBatch, purge_urls_from_cache
|
|
21
|
-
from wagtail.contrib.redirects import models
|
|
22
20
|
from wagtail.contrib.redirects.filters import RedirectsReportFilterSet
|
|
23
21
|
from wagtail.contrib.redirects.forms import (
|
|
24
22
|
ConfirmImportForm,
|
|
@@ -147,7 +145,6 @@ class EditView(generic.EditView):
|
|
|
147
145
|
pk_url_kwarg = "redirect_id"
|
|
148
146
|
error_message = gettext_lazy("The redirect could not be saved due to errors.")
|
|
149
147
|
header_icon = "redirect"
|
|
150
|
-
_show_breadcrumbs = True
|
|
151
148
|
|
|
152
149
|
def get_success_message(self):
|
|
153
150
|
return _("Redirect '%(redirect_title)s' updated.") % {
|
|
@@ -169,80 +166,45 @@ class EditView(generic.EditView):
|
|
|
169
166
|
return instance
|
|
170
167
|
|
|
171
168
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
if request.method == "POST":
|
|
182
|
-
with transaction.atomic():
|
|
183
|
-
log(instance=theredirect, action="wagtail.delete")
|
|
184
|
-
theredirect.delete()
|
|
169
|
+
class DeleteView(generic.DeleteView):
|
|
170
|
+
model = Redirect
|
|
171
|
+
pk_url_kwarg = "redirect_id"
|
|
172
|
+
permission_policy = permission_policy
|
|
173
|
+
template_name = "wagtailredirects/confirm_delete.html"
|
|
174
|
+
index_url_name = "wagtailredirects:index"
|
|
175
|
+
delete_url_name = "wagtailredirects:delete"
|
|
176
|
+
header_icon = "redirect"
|
|
185
177
|
|
|
186
|
-
|
|
178
|
+
def delete_action(self):
|
|
179
|
+
super().delete_action()
|
|
180
|
+
purge_urls_from_cache(self.object.old_links())
|
|
187
181
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
)
|
|
193
|
-
return redirect("wagtailredirects:index")
|
|
182
|
+
def get_success_message(self):
|
|
183
|
+
return _("Redirect '%(redirect_title)s' deleted.") % {
|
|
184
|
+
"redirect_title": self.object.title
|
|
185
|
+
}
|
|
194
186
|
|
|
195
|
-
return TemplateResponse(
|
|
196
|
-
request,
|
|
197
|
-
"wagtailredirects/confirm_delete.html",
|
|
198
|
-
{
|
|
199
|
-
"redirect": theredirect,
|
|
200
|
-
},
|
|
201
|
-
)
|
|
202
187
|
|
|
188
|
+
class CreateView(generic.CreateView):
|
|
189
|
+
model = Redirect
|
|
190
|
+
form_class = RedirectForm
|
|
191
|
+
permission_policy = permission_policy
|
|
192
|
+
template_name = "wagtailredirects/add.html"
|
|
193
|
+
add_url_name = "wagtailredirects:add"
|
|
194
|
+
index_url_name = "wagtailredirects:index"
|
|
195
|
+
edit_url_name = "wagtailredirects:edit"
|
|
196
|
+
error_message = gettext_lazy("The redirect could not be created due to errors.")
|
|
197
|
+
header_icon = "redirect"
|
|
203
198
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
if form.is_valid():
|
|
209
|
-
with transaction.atomic():
|
|
210
|
-
theredirect = form.save()
|
|
211
|
-
log(instance=theredirect, action="wagtail.create")
|
|
212
|
-
|
|
213
|
-
purge_urls_from_cache(theredirect.old_links())
|
|
214
|
-
|
|
215
|
-
messages.success(
|
|
216
|
-
request,
|
|
217
|
-
_("Redirect '%(redirect_title)s' added.")
|
|
218
|
-
% {"redirect_title": theredirect.title},
|
|
219
|
-
buttons=[
|
|
220
|
-
messages.button(
|
|
221
|
-
reverse("wagtailredirects:edit", args=(theredirect.id,)),
|
|
222
|
-
_("Edit"),
|
|
223
|
-
)
|
|
224
|
-
],
|
|
225
|
-
)
|
|
226
|
-
return redirect("wagtailredirects:index")
|
|
227
|
-
else:
|
|
228
|
-
messages.error(
|
|
229
|
-
request, _("The redirect could not be created due to errors.")
|
|
230
|
-
)
|
|
231
|
-
else:
|
|
232
|
-
form = RedirectForm()
|
|
199
|
+
def get_success_message(self, instance):
|
|
200
|
+
return _("Redirect '%(redirect_title)s' added.") % {
|
|
201
|
+
"redirect_title": instance.title
|
|
202
|
+
}
|
|
233
203
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
"form": form,
|
|
239
|
-
# Remove these when this view is refactored to a generic.CreateView subclass.
|
|
240
|
-
# Avoid defining new translatable strings.
|
|
241
|
-
"submit_button_label": generic.CreateView.submit_button_label,
|
|
242
|
-
"submit_button_active_label": generic.CreateView.submit_button_active_label,
|
|
243
|
-
"media": form.media,
|
|
244
|
-
},
|
|
245
|
-
)
|
|
204
|
+
def save_instance(self):
|
|
205
|
+
instance = super().save_instance()
|
|
206
|
+
purge_urls_from_cache(instance.old_links())
|
|
207
|
+
return instance
|
|
246
208
|
|
|
247
209
|
|
|
248
210
|
@permission_checker.require_any("add")
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
from django.urls import path
|
|
2
2
|
|
|
3
3
|
from wagtail.contrib.search_promotions import views
|
|
4
|
+
from wagtail.contrib.search_promotions.views.reports import SearchTermsReportView
|
|
4
5
|
|
|
5
6
|
app_name = "wagtailsearchpromotions"
|
|
6
7
|
urlpatterns = [
|
|
7
8
|
path("", views.IndexView.as_view(), name="index"),
|
|
8
9
|
path("results/", views.IndexView.as_view(results_only=True), name="index_results"),
|
|
9
|
-
path("add/", views.
|
|
10
|
-
path("<int:query_id>/", views.
|
|
11
|
-
path("<int:query_id>/delete/", views.
|
|
10
|
+
path("add/", views.CreateView.as_view(), name="add"),
|
|
11
|
+
path("<int:query_id>/", views.EditView.as_view(), name="edit"),
|
|
12
|
+
path("<int:query_id>/delete/", views.DeleteView.as_view(), name="delete"),
|
|
12
13
|
path("queries/chooser/", views.chooser, name="chooser"),
|
|
13
14
|
path(
|
|
14
15
|
"queries/chooser/results/",
|
|
15
16
|
views.chooserresults,
|
|
16
17
|
name="chooserresults",
|
|
17
18
|
),
|
|
19
|
+
path("reports/search-terms/", SearchTermsReportView.as_view(), name="search_terms"),
|
|
20
|
+
path(
|
|
21
|
+
"reports/search-terms/results/",
|
|
22
|
+
SearchTermsReportView.as_view(results_only=True),
|
|
23
|
+
name="search_terms_results",
|
|
24
|
+
),
|
|
18
25
|
]
|
|
@@ -6,7 +6,7 @@ from wagtail.admin.widgets import AdminPageChooser
|
|
|
6
6
|
from wagtail.contrib.search_promotions.models import Query, SearchPromotion
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class QueryForm(forms.
|
|
9
|
+
class QueryForm(forms.ModelForm):
|
|
10
10
|
query_string = forms.CharField(
|
|
11
11
|
label=_("Search term(s)/phrase"),
|
|
12
12
|
help_text=_(
|
|
@@ -17,6 +17,17 @@ class QueryForm(forms.Form):
|
|
|
17
17
|
required=True,
|
|
18
18
|
)
|
|
19
19
|
|
|
20
|
+
def clean(self):
|
|
21
|
+
# We allow using an existing query string on the CreateView, so we need
|
|
22
|
+
# to skip the unique validation on `query_string`. This can be done by
|
|
23
|
+
# overriding the `clean()` method without calling `super().clean()`:
|
|
24
|
+
# https://docs.djangoproject.com/en/stable/topics/forms/modelforms/#overriding-the-clean-method
|
|
25
|
+
pass
|
|
26
|
+
|
|
27
|
+
class Meta:
|
|
28
|
+
model = Query
|
|
29
|
+
fields = ["query_string"]
|
|
30
|
+
|
|
20
31
|
|
|
21
32
|
class SearchPromotionForm(forms.ModelForm):
|
|
22
33
|
sort_order = forms.IntegerField(required=False)
|
|
@@ -25,6 +36,49 @@ class SearchPromotionForm(forms.ModelForm):
|
|
|
25
36
|
super().__init__(*args, **kwargs)
|
|
26
37
|
self.fields["page"].widget = AdminPageChooser()
|
|
27
38
|
|
|
39
|
+
def clean(self):
|
|
40
|
+
cleaned_data = super().clean()
|
|
41
|
+
|
|
42
|
+
# Use the raw value instead of from form.cleaned_data so we don't
|
|
43
|
+
# consider an invalid field as empty. For example, leaving the
|
|
44
|
+
# page field empty and entering an invalid external_link_url
|
|
45
|
+
# shouldn't raise an error about needing to enter a page or URL,
|
|
46
|
+
# since the user *has* entered (or tried to enter) a URL.
|
|
47
|
+
page = self["page"].value()
|
|
48
|
+
external_link_url = self["external_link_url"].value()
|
|
49
|
+
external_link_text = self["external_link_text"].value()
|
|
50
|
+
|
|
51
|
+
# Must supply a page or external_link_url (but not both)
|
|
52
|
+
if page is None:
|
|
53
|
+
if external_link_url:
|
|
54
|
+
# if an external_link_url is supplied,
|
|
55
|
+
# then external_link_text is also required
|
|
56
|
+
if not external_link_text:
|
|
57
|
+
self.add_error(
|
|
58
|
+
"external_link_text",
|
|
59
|
+
forms.ValidationError(
|
|
60
|
+
_(
|
|
61
|
+
"You must enter an external link text if you enter an external link URL."
|
|
62
|
+
)
|
|
63
|
+
),
|
|
64
|
+
)
|
|
65
|
+
else:
|
|
66
|
+
self.add_error(
|
|
67
|
+
None,
|
|
68
|
+
forms.ValidationError(
|
|
69
|
+
_("You must recommend a page OR an external link.")
|
|
70
|
+
),
|
|
71
|
+
)
|
|
72
|
+
elif external_link_url:
|
|
73
|
+
self.add_error(
|
|
74
|
+
None,
|
|
75
|
+
forms.ValidationError(
|
|
76
|
+
_("Please only select a page OR enter an external link.")
|
|
77
|
+
),
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
return cleaned_data
|
|
81
|
+
|
|
28
82
|
class Meta:
|
|
29
83
|
model = SearchPromotion
|
|
30
84
|
fields = (
|
|
@@ -73,31 +127,6 @@ class SearchPromotionsFormSet(SearchPromotionsFormSetBase):
|
|
|
73
127
|
non_empty_forms = 0
|
|
74
128
|
for i in range(0, self.total_form_count()):
|
|
75
129
|
form = self.forms[i]
|
|
76
|
-
|
|
77
|
-
page = form.cleaned_data["page"]
|
|
78
|
-
external_link_url = form.cleaned_data["external_link_url"]
|
|
79
|
-
external_link_text = form.cleaned_data["external_link_text"]
|
|
80
|
-
|
|
81
|
-
# only a page or external_link_url can be supplied
|
|
82
|
-
if page is None:
|
|
83
|
-
if external_link_url:
|
|
84
|
-
# if an external_link_url then external_link_text is also required
|
|
85
|
-
if not external_link_text:
|
|
86
|
-
raise forms.ValidationError(
|
|
87
|
-
_(
|
|
88
|
-
"You must enter an external link text if you enter an external link URL."
|
|
89
|
-
)
|
|
90
|
-
)
|
|
91
|
-
else:
|
|
92
|
-
raise forms.ValidationError(
|
|
93
|
-
_("You must recommend a page OR an external link.")
|
|
94
|
-
)
|
|
95
|
-
else:
|
|
96
|
-
if external_link_url:
|
|
97
|
-
raise forms.ValidationError(
|
|
98
|
-
_("Please only select a page OR enter an external link.")
|
|
99
|
-
)
|
|
100
|
-
|
|
101
130
|
if self.can_delete and self._should_delete_form(form):
|
|
102
131
|
non_deleted_forms -= 1
|
|
103
132
|
if not (form.instance.id is None and not form.has_changed()):
|
|
@@ -8,7 +8,7 @@ msgid ""
|
|
|
8
8
|
msgstr ""
|
|
9
9
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date:
|
|
11
|
+
"POT-Creation-Date: 2025-01-20 17:59+0000\n"
|
|
12
12
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
@@ -32,22 +32,22 @@ msgid ""
|
|
|
32
32
|
"Promoted Results to be displayed, wildcards are NOT allowed."
|
|
33
33
|
msgstr ""
|
|
34
34
|
|
|
35
|
-
#: forms.py:
|
|
36
|
-
msgid "Please specify at least one recommendation for this search term."
|
|
37
|
-
msgstr ""
|
|
38
|
-
|
|
39
|
-
#: forms.py:88
|
|
35
|
+
#: forms.py:61
|
|
40
36
|
msgid "You must enter an external link text if you enter an external link URL."
|
|
41
37
|
msgstr ""
|
|
42
38
|
|
|
43
|
-
#: forms.py:
|
|
39
|
+
#: forms.py:69
|
|
44
40
|
msgid "You must recommend a page OR an external link."
|
|
45
41
|
msgstr ""
|
|
46
42
|
|
|
47
|
-
#: forms.py:
|
|
43
|
+
#: forms.py:76
|
|
48
44
|
msgid "Please only select a page OR enter an external link."
|
|
49
45
|
msgstr ""
|
|
50
46
|
|
|
47
|
+
#: forms.py:110
|
|
48
|
+
msgid "Please specify at least one recommendation for this search term."
|
|
49
|
+
msgstr ""
|
|
50
|
+
|
|
51
51
|
#: models.py:92 models.py:93
|
|
52
52
|
msgid "Query Daily Hits"
|
|
53
53
|
msgstr ""
|
|
@@ -80,15 +80,7 @@ msgstr ""
|
|
|
80
80
|
msgid "search promotion"
|
|
81
81
|
msgstr ""
|
|
82
82
|
|
|
83
|
-
#: templates/wagtailsearchpromotions/add.html:
|
|
84
|
-
msgid "Add search promotion"
|
|
85
|
-
msgstr ""
|
|
86
|
-
|
|
87
|
-
#: templates/wagtailsearchpromotions/add.html:5
|
|
88
|
-
msgid "Add search pick"
|
|
89
|
-
msgstr ""
|
|
90
|
-
|
|
91
|
-
#: templates/wagtailsearchpromotions/add.html:11
|
|
83
|
+
#: templates/wagtailsearchpromotions/add.html:7
|
|
92
84
|
msgid ""
|
|
93
85
|
"<p>Promoted search results are a means of recommending specific pages or "
|
|
94
86
|
"external links that might not organically come high up in search results. E."
|
|
@@ -96,7 +88,7 @@ msgid ""
|
|
|
96
88
|
"common term \"<em>giving</em>\".</p>"
|
|
97
89
|
msgstr ""
|
|
98
90
|
|
|
99
|
-
#: templates/wagtailsearchpromotions/add.html:
|
|
91
|
+
#: templates/wagtailsearchpromotions/add.html:11
|
|
100
92
|
msgid ""
|
|
101
93
|
"<p>The \"Search term(s)/phrase\" field below must contain the full and exact "
|
|
102
94
|
"search for which you wish to provide recommended results, <em>including</em> "
|
|
@@ -110,28 +102,10 @@ msgid "Delete %(query)s"
|
|
|
110
102
|
msgstr ""
|
|
111
103
|
|
|
112
104
|
#: templates/wagtailsearchpromotions/confirm_delete.html:5
|
|
113
|
-
#: templates/wagtailsearchpromotions/includes/searchpromotion_form.html:10
|
|
114
|
-
msgid "Delete"
|
|
115
|
-
msgstr ""
|
|
116
|
-
|
|
117
|
-
#: templates/wagtailsearchpromotions/confirm_delete.html:9
|
|
118
105
|
msgid ""
|
|
119
106
|
"Are you sure you want to delete all promoted results for this search term?"
|
|
120
107
|
msgstr ""
|
|
121
108
|
|
|
122
|
-
#: templates/wagtailsearchpromotions/confirm_delete.html:12
|
|
123
|
-
msgid "Yes, delete"
|
|
124
|
-
msgstr ""
|
|
125
|
-
|
|
126
|
-
#: templates/wagtailsearchpromotions/edit.html:3
|
|
127
|
-
#, python-format
|
|
128
|
-
msgid "Editing %(query)s"
|
|
129
|
-
msgstr ""
|
|
130
|
-
|
|
131
|
-
#: templates/wagtailsearchpromotions/edit.html:5
|
|
132
|
-
msgid "Editing"
|
|
133
|
-
msgstr ""
|
|
134
|
-
|
|
135
109
|
#: templates/wagtailsearchpromotions/includes/searchpromotion_form.html:8
|
|
136
110
|
msgid "Move up"
|
|
137
111
|
msgstr ""
|
|
@@ -140,12 +114,20 @@ msgstr ""
|
|
|
140
114
|
msgid "Move down"
|
|
141
115
|
msgstr ""
|
|
142
116
|
|
|
143
|
-
#: templates/wagtailsearchpromotions/includes/searchpromotion_form.html:
|
|
117
|
+
#: templates/wagtailsearchpromotions/includes/searchpromotion_form.html:10
|
|
118
|
+
msgid "Drag"
|
|
119
|
+
msgstr ""
|
|
120
|
+
|
|
121
|
+
#: templates/wagtailsearchpromotions/includes/searchpromotion_form.html:11
|
|
122
|
+
msgid "Delete"
|
|
123
|
+
msgstr ""
|
|
124
|
+
|
|
125
|
+
#: templates/wagtailsearchpromotions/includes/searchpromotion_form.html:14
|
|
144
126
|
msgid "Recommended search result"
|
|
145
127
|
msgstr ""
|
|
146
128
|
|
|
147
129
|
#: templates/wagtailsearchpromotions/includes/searchpromotions_formset.html:4
|
|
148
|
-
#: views.py:
|
|
130
|
+
#: views/settings.py:31 wagtail_hooks.py:36
|
|
149
131
|
msgid "Promoted search results"
|
|
150
132
|
msgstr ""
|
|
151
133
|
|
|
@@ -184,7 +166,7 @@ msgid "Terms"
|
|
|
184
166
|
msgstr ""
|
|
185
167
|
|
|
186
168
|
#: templates/wagtailsearchpromotions/queries/chooser/results.html:10
|
|
187
|
-
#: views.py:
|
|
169
|
+
#: views/settings.py:56
|
|
188
170
|
msgid "Views (past week)"
|
|
189
171
|
msgstr ""
|
|
190
172
|
|
|
@@ -204,44 +186,52 @@ msgstr ""
|
|
|
204
186
|
msgid "None"
|
|
205
187
|
msgstr ""
|
|
206
188
|
|
|
207
|
-
#: views.py:
|
|
208
|
-
msgid "
|
|
189
|
+
#: views/reports.py:13
|
|
190
|
+
msgid "Date"
|
|
209
191
|
msgstr ""
|
|
210
192
|
|
|
211
|
-
#: views.py:
|
|
212
|
-
msgid "
|
|
193
|
+
#: views/reports.py:24 wagtail_hooks.py:47
|
|
194
|
+
msgid "Search terms"
|
|
213
195
|
msgstr ""
|
|
214
196
|
|
|
215
|
-
#: views.py:
|
|
197
|
+
#: views/reports.py:33 views/reports.py:37 views/settings.py:44
|
|
216
198
|
msgid "Search term(s)"
|
|
217
199
|
msgstr ""
|
|
218
200
|
|
|
219
|
-
#: views.py:
|
|
201
|
+
#: views/reports.py:34 views/reports.py:38
|
|
202
|
+
msgid "Views"
|
|
203
|
+
msgstr ""
|
|
204
|
+
|
|
205
|
+
#: views/settings.py:40
|
|
206
|
+
msgid "Add new promoted result"
|
|
207
|
+
msgstr ""
|
|
208
|
+
|
|
209
|
+
#: views/settings.py:51
|
|
220
210
|
msgid "Promoted results"
|
|
221
211
|
msgstr ""
|
|
222
212
|
|
|
223
|
-
#: views.py:
|
|
224
|
-
|
|
225
|
-
msgid "Editor's picks for '%(query)s' created."
|
|
213
|
+
#: views/settings.py:91
|
|
214
|
+
msgid "Promoted search result"
|
|
226
215
|
msgstr ""
|
|
227
216
|
|
|
228
|
-
#: views.py:
|
|
229
|
-
|
|
217
|
+
#: views/settings.py:180
|
|
218
|
+
#, python-format
|
|
219
|
+
msgid "Editor's picks for '%(query)s' created."
|
|
230
220
|
msgstr ""
|
|
231
221
|
|
|
232
|
-
#: views.py:
|
|
222
|
+
#: views/settings.py:181
|
|
233
223
|
msgid "Recommendations have not been created due to errors"
|
|
234
224
|
msgstr ""
|
|
235
225
|
|
|
236
|
-
#: views.py:
|
|
226
|
+
#: views/settings.py:190
|
|
237
227
|
#, python-format
|
|
238
228
|
msgid "Editor's picks for '%(query)s' updated."
|
|
239
229
|
msgstr ""
|
|
240
230
|
|
|
241
|
-
#: views.py:
|
|
231
|
+
#: views/settings.py:191
|
|
242
232
|
msgid "Recommendations have not been saved due to errors"
|
|
243
233
|
msgstr ""
|
|
244
234
|
|
|
245
|
-
#: views.py:
|
|
235
|
+
#: views/settings.py:200
|
|
246
236
|
msgid "Editor's picks deleted."
|
|
247
237
|
msgstr ""
|
|
@@ -1,40 +1,30 @@
|
|
|
1
1
|
{% extends "wagtailadmin/generic/form.html" %}
|
|
2
2
|
{% load i18n wagtailadmin_tags %}
|
|
3
|
-
{% block titletag %}{% trans "Add search promotion" %}{% endblock %}
|
|
4
|
-
{% block content %}
|
|
5
|
-
{% trans "Add search pick" as add_str %}
|
|
6
|
-
{% include "wagtailadmin/shared/header.html" with title=add_str icon="pick" %}
|
|
7
3
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
{% block before_form %}
|
|
5
|
+
<div class="help-block help-info w-form-width">
|
|
6
|
+
{% icon name='help' %}
|
|
7
|
+
{% blocktrans trimmed %}
|
|
8
|
+
<p>Promoted search results are a means of recommending specific pages or external links that might not organically come high up in search results. E.g recommending your primary donation page to a user searching with the less common term "<em>giving</em>".</p>
|
|
9
|
+
{% endblocktrans %}
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
</div>
|
|
19
|
-
<form action="{% url 'wagtailsearchpromotions:add' %}" method="POST" novalidate>
|
|
20
|
-
{% csrf_token %}
|
|
21
|
-
|
|
22
|
-
<ul class="fields">
|
|
23
|
-
<li>
|
|
24
|
-
{% include "wagtailsearchpromotions/queries/chooser_field.html" with field=query_form.query_string only %}
|
|
25
|
-
</li>
|
|
26
|
-
<li>
|
|
27
|
-
{% include "wagtailsearchpromotions/includes/searchpromotions_formset.html" with formset=searchpicks_formset only %}
|
|
28
|
-
</li>
|
|
29
|
-
</ul>
|
|
30
|
-
|
|
31
|
-
{% block footer %}
|
|
32
|
-
{{ block.super }}
|
|
33
|
-
{% endblock %}
|
|
34
|
-
</form>
|
|
11
|
+
{% blocktrans trimmed %}
|
|
12
|
+
<p>The "Search term(s)/phrase" field below must contain the full and exact search for which you wish to provide recommended results, <em>including</em> any misspellings/user error. To help, you can choose from search terms that have been popular with users of your site.</p>
|
|
13
|
+
{% endblocktrans %}
|
|
35
14
|
</div>
|
|
36
15
|
{% endblock %}
|
|
37
16
|
|
|
17
|
+
{% block form_content %}
|
|
18
|
+
<ul class="fields">
|
|
19
|
+
<li>
|
|
20
|
+
{% include "wagtailsearchpromotions/queries/chooser_field.html" with field=form.query_string only %}
|
|
21
|
+
</li>
|
|
22
|
+
<li>
|
|
23
|
+
{% include "wagtailsearchpromotions/includes/searchpromotions_formset.html" with formset=searchpicks_formset only %}
|
|
24
|
+
</li>
|
|
25
|
+
</ul>
|
|
26
|
+
{% endblock %}
|
|
27
|
+
|
|
38
28
|
{% block extra_js %}
|
|
39
29
|
{{ block.super }}
|
|
40
30
|
<script src="{% versioned_static 'wagtailsearchpromotions/js/query-chooser-modal.js' %}"></script>
|
|
@@ -44,7 +34,7 @@
|
|
|
44
34
|
{% include "wagtailsearchpromotions/queries/chooser_field.js" only %}
|
|
45
35
|
|
|
46
36
|
$(function() {
|
|
47
|
-
createQueryChooser('{{
|
|
37
|
+
createQueryChooser('{{ form.query_string.auto_id }}');
|
|
48
38
|
});
|
|
49
39
|
</script>
|
|
50
40
|
{% endblock %}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
{% extends "wagtailadmin/
|
|
1
|
+
{% extends "wagtailadmin/generic/confirm_delete.html" %}
|
|
2
2
|
{% load i18n %}
|
|
3
3
|
{% block titletag %}{% blocktrans trimmed with query=query.query_string %}Delete {{ query }}{% endblocktrans %}{% endblock %}
|
|
4
|
-
{% block
|
|
5
|
-
{% trans "
|
|
6
|
-
{% include "wagtailadmin/shared/header.html" with title=delete_str subtitle=query.query_string %}
|
|
7
|
-
|
|
8
|
-
<div class="nice-padding">
|
|
9
|
-
<p>{% trans "Are you sure you want to delete all promoted results for this search term?" %}</p>
|
|
10
|
-
<form action="{% url 'wagtailsearchpromotions:delete' query.id %}" method="POST">
|
|
11
|
-
{% csrf_token %}
|
|
12
|
-
<input type="submit" value="{% trans 'Yes, delete' %}" class="button serious" />
|
|
13
|
-
</form>
|
|
14
|
-
</div>
|
|
4
|
+
{% block confirmation_message %}
|
|
5
|
+
<p>{% trans "Are you sure you want to delete all promoted results for this search term?" %}</p>
|
|
15
6
|
{% endblock %}
|
|
@@ -1,37 +1,14 @@
|
|
|
1
|
-
{% extends "wagtailadmin/generic/
|
|
1
|
+
{% extends "wagtailadmin/generic/edit.html" %}
|
|
2
2
|
{% load i18n wagtailadmin_tags %}
|
|
3
|
-
{% block
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<li>
|
|
13
|
-
{% include "wagtailsearchpromotions/queries/chooser_field.html" with field=query_form.query_string only %}
|
|
14
|
-
</li>
|
|
15
|
-
<li>
|
|
16
|
-
{% include "wagtailsearchpromotions/includes/searchpromotions_formset.html" with formset=searchpicks_formset only %}
|
|
17
|
-
</li>
|
|
18
|
-
</ul>
|
|
19
|
-
|
|
20
|
-
{% block footer %}
|
|
21
|
-
{{ block.super }}
|
|
22
|
-
{% endblock %}
|
|
23
|
-
</form>
|
|
24
|
-
{% endblock %}
|
|
25
|
-
|
|
26
|
-
{% block extra_actions %}
|
|
27
|
-
{% comment %}
|
|
28
|
-
The view hasn't extended from generic EditView, so we cannot use the new
|
|
29
|
-
header buttons in the breadcrumbs for the Delete button. Instead, we'll
|
|
30
|
-
add a Delete button to the footer actions.
|
|
31
|
-
{% endcomment %}
|
|
32
|
-
{% if can_delete %}
|
|
33
|
-
<a href="{{ delete_url }}" class="button">{{ delete_item_label }}</a>
|
|
34
|
-
{% endif %}
|
|
3
|
+
{% block form_content %}
|
|
4
|
+
<ul class="fields">
|
|
5
|
+
<li>
|
|
6
|
+
{% include "wagtailsearchpromotions/queries/chooser_field.html" with field=form.query_string only %}
|
|
7
|
+
</li>
|
|
8
|
+
<li>
|
|
9
|
+
{% include "wagtailsearchpromotions/includes/searchpromotions_formset.html" with formset=searchpicks_formset only %}
|
|
10
|
+
</li>
|
|
11
|
+
</ul>
|
|
35
12
|
{% endblock %}
|
|
36
13
|
|
|
37
14
|
{% block extra_js %}
|
|
@@ -43,7 +20,7 @@
|
|
|
43
20
|
{% include "wagtailsearchpromotions/queries/chooser_field.js" only %}
|
|
44
21
|
|
|
45
22
|
$(function() {
|
|
46
|
-
createQueryChooser('{{
|
|
23
|
+
createQueryChooser('{{ form.query_string.auto_id }}');
|
|
47
24
|
});
|
|
48
25
|
</script>
|
|
49
26
|
{% endblock %}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
{% fragment as header_controls %}
|
|
8
8
|
<button type="button" class="button button--icon text-replace" data-inline-panel-child-move-up>{% icon name="arrow-up" %}{% trans "Move up" %}</button>
|
|
9
9
|
<button type="button" class="button button--icon text-replace" data-inline-panel-child-move-down>{% icon name="arrow-down" %}{% trans "Move down" %}</button>
|
|
10
|
+
<button type="button" class="button button--icon text-replace" data-inline-panel-child-drag>{% icon name="grip" %}{% trans "Drag" %}</button>
|
|
10
11
|
<button type="button" class="button button--icon text-replace" id="{{ form.DELETE.id_for_label }}-button">{% icon name="bin" %}{% trans "Delete" %}</button>
|
|
11
12
|
{% endfragment %}
|
|
12
13
|
|