0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Use ModalPageFurnitureMixin to pass icon / page title

This commit is contained in:
Matt Westcott 2022-06-30 16:13:45 +01:00 committed by Matt Westcott
parent e124a08e8d
commit 7ed50d5364
2 changed files with 8 additions and 4 deletions

View File

@ -1,7 +1,6 @@
{% load wagtailimages_tags wagtailadmin_tags %}
{% load i18n %}
{% trans "Choose an image" as choose_str %}
{% include "wagtailadmin/shared/header.html" with title=choose_str merged=1 icon="image" %}
{% include "wagtailadmin/shared/header.html" with title=page_title subtitle=page_subtitle merged=1 icon=header_icon %}
{{ uploadform.media.js }}
{{ uploadform.media.css }}

View File

@ -14,7 +14,10 @@ from wagtail import hooks
from wagtail.admin.auth import PermissionPolicyChecker
from wagtail.admin.modal_workflow import render_modal_workflow
from wagtail.admin.models import popular_tags_for_model
from wagtail.admin.views.generic.chooser import ChosenResponseMixin
from wagtail.admin.views.generic.chooser import (
ChosenResponseMixin,
ModalPageFurnitureMixin,
)
from wagtail.admin.views.generic.permissions import PermissionCheckedMixin
from wagtail.images import get_image_model
from wagtail.images.formats import get_image_format
@ -65,7 +68,9 @@ class ImageFilterForm(forms.Form):
)
class BaseChooseView(ContextMixin, View):
class BaseChooseView(ModalPageFurnitureMixin, ContextMixin, View):
icon = "image"
page_title = _("Choose an image")
permission_policy = permission_policy
def get_object_list(self):