f6468a7c8c
- base.py: add settings to load GlasfaserServicesPlugin by default - glasfaser_cms_page.html: create a placeholder for services - cms_plugins.py: add the plugin code - models.py: add UngelichTextSectionWithImage model
58 lines
1.6 KiB
Python
58 lines
1.6 KiB
Python
from cms.plugin_base import CMSPluginBase
|
|
from cms.plugin_pool import plugin_pool
|
|
|
|
from .models import (
|
|
UngelichPicture, UngelichContactUsSection, UngelichTextSection,
|
|
UngelichTextSectionWithImage
|
|
)
|
|
|
|
|
|
@plugin_pool.register_plugin
|
|
class SectionWithImagePlugin(CMSPluginBase):
|
|
model = UngelichPicture
|
|
render_template = "ungleich_page/glasfaser/section_with_image.html"
|
|
cache = False
|
|
|
|
def render(self, context, instance, placeholder):
|
|
context.update({
|
|
'image': instance.image,
|
|
'object': instance,
|
|
'placeholder': placeholder
|
|
})
|
|
return context
|
|
|
|
|
|
@plugin_pool.register_plugin
|
|
class SectionContact(CMSPluginBase):
|
|
model = UngelichContactUsSection
|
|
render_template = "ungleich_page/glasfaser/section_contact.html"
|
|
cache = False
|
|
|
|
|
|
@plugin_pool.register_plugin
|
|
class SectionTextParagraphDCL(CMSPluginBase):
|
|
model = UngelichTextSection
|
|
render_template = "ungleich_page/glasfaser/section_text_dcl.html"
|
|
cache = False
|
|
|
|
|
|
@plugin_pool.register_plugin
|
|
class SectionTextParagraphGlasfaser(CMSPluginBase):
|
|
model = UngelichTextSection
|
|
render_template = "ungleich_page/glasfaser/section_text_glasfaser.html"
|
|
cache = False
|
|
|
|
|
|
@plugin_pool.register_plugin
|
|
class GlasfaserServicesPlugin(CMSPluginBase):
|
|
model = UngelichTextSectionWithImage
|
|
render_template = "ungleich_page/glasfaser/section_services.html"
|
|
cache = False
|
|
|
|
def render(self, context, instance, placeholder):
|
|
context.update({
|
|
'image': instance.image,
|
|
'object': instance,
|
|
'placeholder': placeholder
|
|
})
|
|
return context
|