def render_change_form(self, request, context, add=False, change=False, form_url='', obj=None):
     """
     We override the change form template path
     to provide backwards compatibility with CMS 2.x
     """
     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)
Exemple #2
0
 def render_change_form(self, request, context, add=False, change=False, form_url='', obj=None):
     """
     We override the change form template path
     to provide backwards compatibility with CMS 2.x
     """
     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)
 def render_change_form(self, request, context, add=False, change=False, form_url='', obj=None):
     """
     We override the change form template path
     to provide backwards compatibility with CMS 2.x
     """
     ckeditor_basepath = urljoin(settings.STATIC_URL, 'djangocms_text_ckeditor/ckeditor/')
     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)
 def render_change_form(self,
                        request,
                        context,
                        add=False,
                        change=False,
                        form_url='',
                        obj=None):
     """
     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)