Add GlasfaserAboutPlugin and GlasfaserAboutItemPlugin

This commit is contained in:
M.Ravi 2017-10-18 16:56:41 +02:00
parent 621424f182
commit 609501f987

View file

@ -3,7 +3,7 @@ from cms.plugin_pool import plugin_pool
from .models import (
UngelichPicture, UngelichContactUsSection, UngelichTextSection, Service,
ServiceItem
ServiceItem, About, AboutItem
)
@ -69,3 +69,31 @@ class GlasfaserServicesItemPlugin(CMSPluginBase):
def render(self, context, instance, placeholder):
context['instance'] = instance
return context
@plugin_pool.register_plugin
class GlasfaserAboutPlugin(CMSPluginBase):
name = "Glasfaser About Plugin"
model = About
render_template = "ungleich_page/glasfaser/section_about.html"
cache = False
allow_children = True
child_classes = ['GlasfaserAboutItemPlugin']
def render(self, context, instance, placeholder):
context['about_instance'] = instance
return context
@plugin_pool.register_plugin
class GlasfaserAboutItemPlugin(CMSPluginBase):
name = "Glasfaser About Item Plugin"
model = AboutItem
render_template = "ungleich_page/glasfaser/_about_item.html"
cache = False
require_parent = True
parent_classes = ['GlasfaserAboutPlugin']
def render(self, context, instance, placeholder):
context['instance'] = instance
return context