You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

84 lines
2.6 KiB

#-*- coding: utf -8-*-
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from models import IndexBlockPlugin, ExtendedTextBlockPlugin, ExtendedBlockPlugin, DescTextBlockPlugin
from forms import IndexBlockForm, ExtendedBlockForm, ExtendedTextBlockForm, DescBlockForm
from project.myauth.forms import RegistrationForm
from django.utils.translation import ugettext as _
class CMSIndexBlockPlugin(CMSPluginBase):
model = IndexBlockPlugin
form = IndexBlockForm
name = u'Блок на главной (картинка и текст)'
render_template = "index_block.html"
def render(self, context, instance, placeholder):
context.update({
'object':instance,
'placeholder':placeholder
})
return context
class CMSExtendedTextBlockPlugin(CMSPluginBase):
model = ExtendedTextBlockPlugin
form = ExtendedTextBlockForm
name = u'Раскрывающийся блок'
render_template = "extended_text_block.html"
def render(self, context, instance, placeholder):
context.update({
'object':instance,
'placeholder':placeholder
})
return context
class CMSExtendedBlockPlugin(CMSPluginBase):
model = ExtendedBlockPlugin
form = ExtendedBlockForm
name = u'Раскрывающийся блок с картинкой'
render_template = "extended_block.html"
def render(self, context, instance, placeholder):
context.update({
'object':instance,
'placeholder':placeholder
})
return context
class CMSDescTextBlockPlugin(CMSPluginBase):
model = DescTextBlockPlugin
form = ExtendedBlockForm
name = u'Заголовок/описание'
render_template = "desc_block.html"
def render(self, context, instance, placeholder):
context.update({
'object':instance,
'placeholder':placeholder
})
return context
class CMSSlideshowBlockPlugin(CMSPluginBase):
model = IndexBlockPlugin
form = IndexBlockForm
name = u'Кадр слайдшоу'
render_template = "slideshow_block.html"
def render(self, context, instance, placeholder):
context.update({
'object':instance,
'placeholder':placeholder
})
return context
plugin_pool.register_plugin(CMSExtendedTextBlockPlugin)
# plugin_pool.register_plugin(CMSIndexBlockPlugin)
plugin_pool.register_plugin(CMSExtendedBlockPlugin)
plugin_pool.register_plugin(CMSDescTextBlockPlugin)
# plugin_pool.register_plugin(CMSSlideshowBlockPlugin)