From ad91c0fe240d6e5a96f91e13d5e91598eaa53d78 Mon Sep 17 00:00:00 2001 From: Jeffrey Goettsch Date: Thu, 15 May 2014 12:49:34 -0700 Subject: [PATCH] Introduce CKEDITOR_BASEPATH to the text_plugin_change_form.html template. Fixes #124. --- djangocms_text_ckeditor/cms_plugins.py | 6 ++++++ .../templates/cms/plugins/text_plugin_change_form.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/djangocms_text_ckeditor/cms_plugins.py b/djangocms_text_ckeditor/cms_plugins.py index 9c2d4e9..7aeeec7 100644 --- a/djangocms_text_ckeditor/cms_plugins.py +++ b/djangocms_text_ckeditor/cms_plugins.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.forms.fields import CharField from django.utils.translation import ugettext_lazy as _ @@ -54,6 +55,11 @@ class TextPlugin(CMSPluginBase): We override the change form template path to provide backwards compatibility with CMS 2.x """ + ckeditor_basepath = '{0}/ckeditor/'.format(settings.STATIC_URL) + if ckeditor_basepath.startswith('//'): + protocol = 'https' if request.is_secure else 'http' + ckeditor_basepath = '{0}:{1}'.format(protocol, ckeditor_basepath) + context.update({'CKEDITOR_BASEPATH': ckeditor_basepath}) if cms_version.startswith('2'): context['change_form_template'] = "admin/cms/page/plugin_change_form.html" return super(TextPlugin, self).render_change_form(request, context, add, change, form_url, obj) diff --git a/djangocms_text_ckeditor/templates/cms/plugins/text_plugin_change_form.html b/djangocms_text_ckeditor/templates/cms/plugins/text_plugin_change_form.html index e85ab27..991551f 100644 --- a/djangocms_text_ckeditor/templates/cms/plugins/text_plugin_change_form.html +++ b/djangocms_text_ckeditor/templates/cms/plugins/text_plugin_change_form.html @@ -3,7 +3,7 @@ {% block extrahead %} {{ block.super }} - +