diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index 75e3b698..ba82801e 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -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