Unverified Commit b9fcc016 authored by Seb Brown's avatar Seb Brown Committed by GitHub
Browse files

Merge pull request #86 from jkevingutierrez/patch-5

Fix get_chooser_js_data removal from wagtail images
parents 31bf0a52 2fc9a71d
...@@ -4,10 +4,10 @@ import wagtail ...@@ -4,10 +4,10 @@ import wagtail
from django.core.paginator import Paginator from django.core.paginator import Paginator
from django.shortcuts import get_object_or_404, render from django.shortcuts import get_object_or_404, render
from django.urls import reverse from django.urls import reverse
from django.utils.translation import gettext as _
from wagtail.admin.forms.search import SearchForm from wagtail.admin.forms.search import SearchForm
from wagtail.admin.modal_workflow import render_modal_workflow from wagtail.admin.modal_workflow import render_modal_workflow
from wagtail.core.models import Collection from wagtail.core.models import Collection
from wagtail.images.views.chooser import get_chooser_js_data
from wagtail.search import index as search_index from wagtail.search import index as search_index
from wagtailvideos import get_video_model from wagtailvideos import get_video_model
...@@ -24,6 +24,16 @@ else: ...@@ -24,6 +24,16 @@ else:
permission_checker = PermissionPolicyChecker(permission_policy) permission_checker = PermissionPolicyChecker(permission_policy)
def get_chooser_js_data():
"""construct context variables needed by the chooser JS"""
return {
'step': 'chooser',
'error_label': _("Server Error"),
'error_message': _("Report this error to your webmaster with the following information:"),
'tag_autocomplete_url': reverse('wagtailadmin_tag_autocomplete'),
}
def get_video_json(video): def get_video_json(video):
""" """
helper function: given a video, return the json to pass back to the helper function: given a video, return the json to pass back to the
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment