rebase plugin over django-cms-text-ckeditor
This commit is contained in:
parent
6ff9c8dcde
commit
735ca6320b
|
@ -1 +1 @@
|
||||||
__version__ = '1.2'
|
__version__ = '2.0'
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from django.template import loader
|
from django.template import loader
|
||||||
|
|
||||||
from cmsplugin_text_wrapper.cms_plugins import TextPlugin
|
from djangocms_text_ckeditor.cms_plugins import TextPlugin
|
||||||
from cms.plugin_pool import plugin_pool
|
from cms.plugin_pool import plugin_pool
|
||||||
|
|
||||||
class AjaxTextPlugin(TextPlugin):
|
class AjaxTextPlugin(TextPlugin):
|
||||||
name = _(u'Text (asynchronous loading)')
|
name = _(u'Text (asynchronous loading)')
|
||||||
ajax_render_template = 'cms_ajax_text_plugin/plugin.html'
|
ajax_render_template = 'cms_ajax_text_plugin/plugin.html'
|
||||||
text_enabled = True
|
|
||||||
|
|
||||||
def get_ajax_body(self, instance, context):
|
def get_ajax_body(self, instance, context):
|
||||||
t = loader.get_template(self.ajax_render_template)
|
t = loader.get_template(self.ajax_render_template)
|
||||||
|
@ -17,7 +16,6 @@ class AjaxTextPlugin(TextPlugin):
|
||||||
request = context.get('request')
|
request = context.get('request')
|
||||||
if 'updatecache' in request.GET:
|
if 'updatecache' in request.GET:
|
||||||
instance.args = '?updatecache'
|
instance.args = '?updatecache'
|
||||||
context['object'] = instance
|
|
||||||
edit_mode = request and 'edit' in request.GET
|
edit_mode = request and 'edit' in request.GET
|
||||||
is_ajax = request and request.is_ajax()
|
is_ajax = request and request.is_ajax()
|
||||||
if edit_mode or is_ajax:
|
if edit_mode or is_ajax:
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -114,6 +114,7 @@ setup(name="django-cms-ajax-text-plugin",
|
||||||
],
|
],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'django-cms<3',
|
'django-cms<3',
|
||||||
|
'djangocms-text-ckeditor',
|
||||||
],
|
],
|
||||||
cmdclass={'build': build, 'install_lib': install_lib,
|
cmdclass={'build': build, 'install_lib': install_lib,
|
||||||
'compile_translations': compile_translations,
|
'compile_translations': compile_translations,
|
||||||
|
|
Reference in New Issue