| 
									
										
										
										
											2017-10-17 09:30:52 +02:00
										 |  |  | from cms.plugin_base import CMSPluginBase | 
					
						
							|  |  |  | from cms.plugin_pool import plugin_pool | 
					
						
							| 
									
										
										
										
											2017-10-17 15:52:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-17 17:47:40 +02:00
										 |  |  | from .models import ( | 
					
						
							| 
									
										
										
										
											2017-10-19 00:30:07 +02:00
										 |  |  |     UngelichContactUsSection, UngelichTextSection, Service, ServiceItem, | 
					
						
							| 
									
										
										
										
											2017-11-19 13:19:01 +01:00
										 |  |  |     About, AboutItem, SectionWithImage, UngleichServiceItem, UngleichHeader, | 
					
						
							| 
									
										
										
										
											2017-11-23 09:45:38 +01:00
										 |  |  |     UngleichHeaderItem, UngleichProductItem, UngleichProduct, UngleichCustomer, | 
					
						
							| 
									
										
										
										
											2017-12-19 22:25:27 +05:30
										 |  |  |     UngleichCustomerItem, UngleichHTMLOnly, UngleichSimpleHeader, | 
					
						
							| 
									
										
										
										
											2017-12-02 08:45:31 +01:00
										 |  |  |     UngleichHeaderWithBackgroundImageSlider, | 
					
						
							| 
									
										
										
										
											2017-12-20 01:36:38 +05:30
										 |  |  |     UngleichHeaderWithBackgroundImageSliderItem, | 
					
						
							| 
									
										
										
										
											2017-12-20 02:53:26 +05:30
										 |  |  |     UngleichHeaderWithBackgroundVideoSliderItem, | 
					
						
							| 
									
										
										
										
											2017-10-17 17:47:40 +02:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2017-10-17 09:30:52 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-19 13:45:28 +02:00
										 |  |  | def get_section_id(plugin_instance, default): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     A helper function to get the section id from a given menu text | 
					
						
							|  |  |  |     :param plugin_instance: | 
					
						
							|  |  |  |     :param default: The default section id to return in case a section id | 
					
						
							|  |  |  |                     is not found | 
					
						
							|  |  |  |     :return: The section id for the plugin_instance | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     section_id = default | 
					
						
							|  |  |  |     if hasattr(plugin_instance, 'menu_text'): | 
					
						
							|  |  |  |         menu_words = plugin_instance.menu_text.split() | 
					
						
							|  |  |  |         if len(menu_words) > 0: | 
					
						
							|  |  |  |             section_id = menu_words[0] | 
					
						
							|  |  |  |     return section_id | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-17 09:30:52 +02:00
										 |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class SectionWithImagePlugin(CMSPluginBase): | 
					
						
							| 
									
										
										
										
											2017-10-19 00:30:07 +02:00
										 |  |  |     model = SectionWithImage | 
					
						
							| 
									
										
										
										
											2017-10-17 09:30:52 +02:00
										 |  |  |     render_template = "ungleich_page/glasfaser/section_with_image.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-17 15:52:30 +02:00
										 |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context.update({ | 
					
						
							|  |  |  |             'image': instance.image, | 
					
						
							|  |  |  |             'object': instance, | 
					
						
							|  |  |  |             'placeholder': placeholder | 
					
						
							|  |  |  |         }) | 
					
						
							|  |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-17 09:30:52 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class SectionContact(CMSPluginBase): | 
					
						
							| 
									
										
										
										
											2017-10-17 16:25:01 +02:00
										 |  |  |     model = UngelichContactUsSection | 
					
						
							| 
									
										
										
										
											2017-10-17 09:30:52 +02:00
										 |  |  |     render_template = "ungleich_page/glasfaser/section_contact.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							| 
									
										
										
										
											2017-10-17 17:47:40 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-19 14:05:17 +02:00
										 |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context = super(SectionContact, self).render( | 
					
						
							|  |  |  |             context, instance, placeholder | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  |         context['instance'] = instance | 
					
						
							|  |  |  |         context['section_id'] = get_section_id(instance, 'contact') | 
					
						
							|  |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-17 17:47:40 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class SectionTextParagraphDCL(CMSPluginBase): | 
					
						
							|  |  |  |     model = UngelichTextSection | 
					
						
							|  |  |  |     render_template = "ungleich_page/glasfaser/section_text_dcl.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-19 13:45:28 +02:00
										 |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context = super(SectionTextParagraphDCL, self).render( | 
					
						
							|  |  |  |             context, instance, placeholder | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  |         context['instance'] = instance | 
					
						
							|  |  |  |         context['section_id'] = get_section_id(instance, 'your') | 
					
						
							|  |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-17 17:47:40 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class SectionTextParagraphGlasfaser(CMSPluginBase): | 
					
						
							|  |  |  |     model = UngelichTextSection | 
					
						
							|  |  |  |     render_template = "ungleich_page/glasfaser/section_text_glasfaser.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							| 
									
										
										
										
											2017-10-18 09:10:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-19 13:45:28 +02:00
										 |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context = super(SectionTextParagraphGlasfaser, self).render( | 
					
						
							|  |  |  |             context, instance, placeholder | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  |         context['instance'] = instance | 
					
						
							|  |  |  |         context['section_id'] = get_section_id(instance, 'our') | 
					
						
							|  |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-18 09:10:50 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class GlasfaserServicesPlugin(CMSPluginBase): | 
					
						
							| 
									
										
										
										
											2017-10-18 15:51:47 +02:00
										 |  |  |     name = "Glasfaser Services Plugin" | 
					
						
							|  |  |  |     model = Service | 
					
						
							| 
									
										
										
										
											2017-10-18 09:10:50 +02:00
										 |  |  |     render_template = "ungleich_page/glasfaser/section_services.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							| 
									
										
										
										
											2017-10-18 15:51:47 +02:00
										 |  |  |     allow_children = True | 
					
						
							|  |  |  |     child_classes = ['GlasfaserServicesItemPlugin'] | 
					
						
							| 
									
										
										
										
											2017-10-18 09:10:50 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							| 
									
										
										
										
											2017-10-18 15:51:47 +02:00
										 |  |  |         context['service_instance'] = instance | 
					
						
							| 
									
										
										
										
											2017-10-19 14:14:29 +02:00
										 |  |  |         context['section_id'] = get_section_id(instance, 'services') | 
					
						
							| 
									
										
										
										
											2017-10-18 15:51:47 +02:00
										 |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class GlasfaserServicesItemPlugin(CMSPluginBase): | 
					
						
							|  |  |  |     name = "Glasfaser Service Item Plugin" | 
					
						
							|  |  |  |     model = ServiceItem | 
					
						
							| 
									
										
										
										
											2017-10-18 15:58:50 +02:00
										 |  |  |     render_template = "ungleich_page/glasfaser/_services_item.html" | 
					
						
							| 
									
										
										
										
											2017-10-18 15:51:47 +02:00
										 |  |  |     cache = False | 
					
						
							|  |  |  |     require_parent = True | 
					
						
							|  |  |  |     parent_classes = ['GlasfaserServicesPlugin'] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							| 
									
										
										
										
											2017-10-18 20:24:50 +02:00
										 |  |  |         context = super(GlasfaserServicesItemPlugin, self).render( | 
					
						
							|  |  |  |             context, instance, placeholder | 
					
						
							|  |  |  |         ) | 
					
						
							| 
									
										
										
										
											2017-10-18 15:51:47 +02:00
										 |  |  |         context['instance'] = instance | 
					
						
							| 
									
										
										
										
											2017-10-18 09:10:50 +02:00
										 |  |  |         return context | 
					
						
							| 
									
										
										
										
											2017-10-18 16:56:41 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @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 | 
					
						
							| 
									
										
										
										
											2017-10-19 14:22:02 +02:00
										 |  |  |         context['section_id'] = get_section_id(instance, 'about') | 
					
						
							| 
									
										
										
										
											2017-10-18 16:56:41 +02:00
										 |  |  |         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): | 
					
						
							| 
									
										
										
										
											2017-10-18 20:24:50 +02:00
										 |  |  |         context = super(GlasfaserAboutItemPlugin, self).render( | 
					
						
							|  |  |  |             context, instance, placeholder | 
					
						
							|  |  |  |         ) | 
					
						
							| 
									
										
										
										
											2017-10-18 16:56:41 +02:00
										 |  |  |         context['instance'] = instance | 
					
						
							|  |  |  |         return context | 
					
						
							| 
									
										
										
										
											2017-11-17 17:37:05 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class UngleichServicesPlugin(CMSPluginBase): | 
					
						
							|  |  |  |     name = "ungleich Services Plugin" | 
					
						
							|  |  |  |     model = Service | 
					
						
							|  |  |  |     render_template = "ungleich_page/ungleich/section_services.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							|  |  |  |     allow_children = True | 
					
						
							|  |  |  |     child_classes = ['UngleichServicesItemPlugin'] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context['service_instance'] = instance | 
					
						
							|  |  |  |         context['section_id'] = get_section_id(instance, 'services') | 
					
						
							|  |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class UngleichServicesItemPlugin(CMSPluginBase): | 
					
						
							|  |  |  |     name = "ungleich Service Item Plugin" | 
					
						
							|  |  |  |     model = UngleichServiceItem | 
					
						
							|  |  |  |     render_template = "ungleich_page/ungleich/_services_item.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							|  |  |  |     require_parent = True | 
					
						
							|  |  |  |     parent_classes = ['UngleichServicesPlugin'] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context = super(UngleichServicesItemPlugin, self).render( | 
					
						
							|  |  |  |             context, instance, placeholder | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  |         context['instance'] = instance | 
					
						
							| 
									
										
										
										
											2017-11-19 13:19:01 +01:00
										 |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-24 20:29:26 +01:00
										 |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class UngleichHeaderWithTextAndImagePlugin(CMSPluginBase): | 
					
						
							|  |  |  |     name = "ungleich Header with Text and Image Plugin" | 
					
						
							|  |  |  |     model = UngleichSimpleHeader | 
					
						
							|  |  |  |     render_template = "ungleich_page/ungleich/header.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context['instance'] = instance | 
					
						
							|  |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-19 13:19:01 +01:00
										 |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class UngleichHeaderWithTextAndImageSliderPlugin(CMSPluginBase): | 
					
						
							|  |  |  |     name = "ungleich Header with Text and Image Slider Plugin" | 
					
						
							|  |  |  |     model = UngleichHeader | 
					
						
							| 
									
										
										
										
											2017-11-24 19:31:54 +01:00
										 |  |  |     render_template = "ungleich_page/ungleich/header_with_slider.html" | 
					
						
							| 
									
										
										
										
											2017-11-19 13:19:01 +01:00
										 |  |  |     cache = False | 
					
						
							|  |  |  |     allow_children = True | 
					
						
							| 
									
										
										
										
											2017-12-20 02:53:26 +05:30
										 |  |  |     child_classes = ['UngleichHeaderItemPlugin'] | 
					
						
							| 
									
										
										
										
											2017-11-19 13:19:01 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context['instance'] = instance | 
					
						
							|  |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class UngleichHeaderItemPlugin(CMSPluginBase): | 
					
						
							|  |  |  |     name = "ungleich Header Item Plugin" | 
					
						
							|  |  |  |     model = UngleichHeaderItem | 
					
						
							|  |  |  |     render_template = "ungleich_page/ungleich/_header_item.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							|  |  |  |     require_parent = True | 
					
						
							|  |  |  |     parent_classes = ['UngleichHeaderWithTextAndImageSliderPlugin'] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context = super(UngleichHeaderItemPlugin, self).render( | 
					
						
							|  |  |  |             context, instance, placeholder | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  |         context['instance'] = instance | 
					
						
							| 
									
										
										
										
											2017-11-22 00:19:07 +01:00
										 |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-02 08:45:31 +01:00
										 |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class UngleichHeaderBackgroundImageAndTextSliderPlugin(CMSPluginBase): | 
					
						
							|  |  |  |     name = "ungleich Header with Background and Image Slider Plugin" | 
					
						
							|  |  |  |     model = UngleichHeaderWithBackgroundImageSlider | 
					
						
							|  |  |  |     render_template = ( | 
					
						
							|  |  |  |         'ungleich_page/ungleich/header_with_background_image_slider.html' | 
					
						
							|  |  |  |     ) | 
					
						
							|  |  |  |     cache = False | 
					
						
							|  |  |  |     allow_children = True | 
					
						
							| 
									
										
										
										
											2017-12-20 02:53:26 +05:30
										 |  |  |     child_classes = [ | 
					
						
							|  |  |  |         'UngleichHeaderBackgroundImageAndTextItemPlugin', | 
					
						
							|  |  |  |         'UngleichHeaderBackgroundVideoItemPlugin', | 
					
						
							|  |  |  |     ] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context['instance'] = instance | 
					
						
							|  |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class UngleichHeaderBackgroundVideoItemPlugin(CMSPluginBase): | 
					
						
							|  |  |  |     name = "ungleich Header Background Video Item Plugin" | 
					
						
							|  |  |  |     model = UngleichHeaderWithBackgroundVideoSliderItem | 
					
						
							|  |  |  |     render_template = "ungleich_page/ungleich/_header_with_background_video_slider_item.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							|  |  |  |     require_parent = True | 
					
						
							|  |  |  |     parent_classes = ['UngleichHeaderBackgroundImageAndTextSliderPlugin'] | 
					
						
							| 
									
										
										
										
											2017-12-02 08:45:31 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							| 
									
										
										
										
											2017-12-20 02:53:26 +05:30
										 |  |  |         context = super(UngleichHeaderBackgroundVideoItemPlugin, self).render( | 
					
						
							|  |  |  |             context, instance, placeholder | 
					
						
							|  |  |  |         ) | 
					
						
							| 
									
										
										
										
											2017-12-02 08:45:31 +01:00
										 |  |  |         context['instance'] = instance | 
					
						
							|  |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class UngleichHeaderBackgroundImageAndTextItemPlugin(CMSPluginBase): | 
					
						
							|  |  |  |     name = "ungleich Header with Background and Image and Text Item Plugin" | 
					
						
							|  |  |  |     model = UngleichHeaderWithBackgroundImageSliderItem | 
					
						
							|  |  |  |     render_template = ( | 
					
						
							|  |  |  |         'ungleich_page/ungleich/_header_with_background_image_slider_item.html' | 
					
						
							|  |  |  |     ) | 
					
						
							|  |  |  |     cache = False | 
					
						
							|  |  |  |     require_parent = True | 
					
						
							|  |  |  |     parent_classes = ['UngleichHeaderBackgroundImageAndTextSliderPlugin'] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context = super( | 
					
						
							|  |  |  |             UngleichHeaderBackgroundImageAndTextItemPlugin, self | 
					
						
							|  |  |  |         ).render(context, instance, placeholder) | 
					
						
							| 
									
										
										
										
											2017-12-19 22:25:27 +05:30
										 |  |  |         context['instance'] = instance | 
					
						
							|  |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-22 00:19:07 +01:00
										 |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class UngleichProductsPlugin(CMSPluginBase): | 
					
						
							|  |  |  |     name = "ungleich Products Plugin" | 
					
						
							|  |  |  |     model = UngleichProduct | 
					
						
							|  |  |  |     render_template = "ungleich_page/ungleich/section_products.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							|  |  |  |     allow_children = True | 
					
						
							|  |  |  |     child_classes = ['UngleichProductsItemPlugin'] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context['product_instance'] = instance | 
					
						
							|  |  |  |         context['section_id'] = get_section_id(instance, 'products') | 
					
						
							|  |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class UngleichProductsItemPlugin(CMSPluginBase): | 
					
						
							|  |  |  |     name = "ungleich Product Item Plugin" | 
					
						
							|  |  |  |     model = UngleichProductItem | 
					
						
							|  |  |  |     render_template = "ungleich_page/ungleich/_products_item.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							|  |  |  |     require_parent = True | 
					
						
							|  |  |  |     parent_classes = ['UngleichProductsPlugin'] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context = super(UngleichProductsItemPlugin, self).render( | 
					
						
							|  |  |  |             context, instance, placeholder | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  |         context['instance'] = instance | 
					
						
							|  |  |  |         return context | 
					
						
							| 
									
										
										
										
											2017-11-23 09:45:38 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class UngleichCustomerSectionPlugin(CMSPluginBase): | 
					
						
							|  |  |  |     name = "ungleich Customer Section Plugin" | 
					
						
							|  |  |  |     model = UngleichCustomer | 
					
						
							|  |  |  |     render_template = "ungleich_page/ungleich/section_customers.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							|  |  |  |     allow_children = True | 
					
						
							|  |  |  |     child_classes = ['UngleichCustomerItemPlugin'] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context['customer_instance'] = instance | 
					
						
							|  |  |  |         context['section_id'] = get_section_id(instance, 'customer') | 
					
						
							|  |  |  |         return context | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class UngleichCustomerItemPlugin(CMSPluginBase): | 
					
						
							|  |  |  |     name = "ungleich Customer Item Plugin" | 
					
						
							|  |  |  |     model = UngleichCustomerItem | 
					
						
							|  |  |  |     render_template = "ungleich_page/ungleich/_customer_item.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							|  |  |  |     require_parent = True | 
					
						
							|  |  |  |     parent_classes = ['UngleichCustomerSectionPlugin'] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context = super(UngleichCustomerItemPlugin, self).render( | 
					
						
							|  |  |  |             context, instance, placeholder | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  |         context['instance'] = instance | 
					
						
							|  |  |  |         return context | 
					
						
							| 
									
										
										
										
											2017-11-23 13:02:08 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @plugin_pool.register_plugin | 
					
						
							|  |  |  | class UngleichHTMLPlugin(CMSPluginBase): | 
					
						
							|  |  |  |     name = "ungleich HTML Plugin" | 
					
						
							|  |  |  |     model = UngleichHTMLOnly | 
					
						
							|  |  |  |     render_template = "ungleich_page/ungleich/html_block.html" | 
					
						
							|  |  |  |     cache = False | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def render(self, context, instance, placeholder): | 
					
						
							|  |  |  |         context = super(UngleichHTMLPlugin, self).render( | 
					
						
							|  |  |  |             context, instance, placeholder | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  |         context['instance'] = instance | 
					
						
							|  |  |  |         return context |