why dcl plugin and id for each section

This commit is contained in:
Arvind Tiwari 2018-03-02 02:05:42 +05:30
commit 819848c90c
11 changed files with 258 additions and 127 deletions

View file

@ -3,24 +3,17 @@ from cms.plugin_pool import plugin_pool
from cms.models.pluginmodel import CMSPlugin
from .cms_models import (
DCLSectionPluginModel, DCLLinkPluginModel,
DCLNavbarDropdownPluginModel, DCLContactPluginModel,
DCLFooterPluginModel, DCLSectionIconPluginModel,
DCLSectionImagePluginModel
DCLBannerItemPluginModel, DCLBannerListPluginModel, DCLContactPluginModel,
DCLFooterPluginModel, DCLLinkPluginModel, DCLNavbarDropdownPluginModel,
DCLSectionIconPluginModel, DCLSectionImagePluginModel,
DCLSectionPluginModel,
)
@plugin_pool.register_plugin
class DCLCalculatorPlugin(CMSPluginBase):
module = "Datacenterlight"
model = DCLSectionPluginModel
render_template = "datacenterlight/cms/calculator.html"
cache = False
@plugin_pool.register_plugin
class DCLSectionPlugin(CMSPluginBase):
module = "Datacenterlight"
name = "DCL Section Plugin"
model = DCLSectionPluginModel
render_template = "datacenterlight/cms/section.html"
cache = False
@ -28,9 +21,61 @@ class DCLSectionPlugin(CMSPluginBase):
child_classes = ['DCLSectionIconPlugin', 'DCLSectionImagePlugin']
@plugin_pool.register_plugin
class DCLSectionIconPlugin(CMSPluginBase):
module = "Datacenterlight"
name = "DCL Section Icon Plugin"
model = DCLSectionIconPluginModel
render_template = "datacenterlight/cms/section_icon.html"
cache = False
require_parent = True
@plugin_pool.register_plugin
class DCLSectionImagePlugin(CMSPluginBase):
module = "Datacenterlight"
name = "DCL Section Image Plugin"
model = DCLSectionImagePluginModel
render_template = "datacenterlight/cms/section_image.html"
cache = False
require_parent = True
@plugin_pool.register_plugin
class DCLCalculatorPlugin(CMSPluginBase):
module = "Datacenterlight"
name = "DCL Calculator Plugin"
model = DCLSectionPluginModel
render_template = "datacenterlight/cms/calculator.html"
cache = False
@plugin_pool.register_plugin
class DCLBannerListPlugin(CMSPluginBase):
module = "Datacenterlight"
name = "DCL Banner List Plugin"
model = DCLBannerListPluginModel
render_template = "datacenterlight/cms/banner_list.html"
cache = False
allow_children = True
child_classes = ['DCLBannerItemPlugin']
@plugin_pool.register_plugin
class DCLBannerItemPlugin(CMSPluginBase):
module = "Datacenterlight"
name = "DCL Banner Item Plugin"
model = DCLBannerItemPluginModel
render_template = "datacenterlight/cms/banner_item.html"
cache = False
require_parent = True
parent_classes = ['DCLBannerListPlugin']
@plugin_pool.register_plugin
class DCLNavbarPlugin(CMSPluginBase):
module = "Datacenterlight"
name = "DCL Navbar Plugin"
model = CMSPlugin
render_template = "datacenterlight/cms/navbar.html"
cache = False
@ -38,18 +83,10 @@ class DCLNavbarPlugin(CMSPluginBase):
child_classes = ['DCLLinkPlugin', 'DCLNavbarDropdownPlugin']
@plugin_pool.register_plugin
class DCLLinkPlugin(CMSPluginBase):
module = "Datacenterlight"
model = DCLLinkPluginModel
render_template = "datacenterlight/cms/link.html"
cache = False
require_parent = True
@plugin_pool.register_plugin
class DCLNavbarDropdownPlugin(CMSPluginBase):
module = "Datacenterlight"
name = "DCL Navbar Dropdown Plugin"
model = DCLNavbarDropdownPluginModel
render_template = "datacenterlight/cms/navbar_dropdown.html"
cache = False
@ -59,9 +96,20 @@ class DCLNavbarDropdownPlugin(CMSPluginBase):
parent_classes = ['DCLNavbarPlugin']
@plugin_pool.register_plugin
class DCLLinkPlugin(CMSPluginBase):
module = "Datacenterlight"
name = "DCL Link Plugin"
model = DCLLinkPluginModel
render_template = "datacenterlight/cms/link.html"
cache = False
require_parent = True
@plugin_pool.register_plugin
class DCLContactPlugin(CMSPluginBase):
module = "Datacenterlight"
name = "DCL Contact Plugin"
model = DCLContactPluginModel
render_template = "datacenterlight/cms/contact.html"
cache = False
@ -70,26 +118,9 @@ class DCLContactPlugin(CMSPluginBase):
@plugin_pool.register_plugin
class DCLFooterPlugin(CMSPluginBase):
module = "Datacenterlight"
name = "DCL Footer Plugin"
model = DCLFooterPluginModel
render_template = "datacenterlight/cms/footer.html"
cache = False
allow_children = True
child_classes = ['DCLLinkPlugin']
@plugin_pool.register_plugin
class DCLSectionIconPlugin(CMSPluginBase):
module = "Datacenterlight"
model = DCLSectionIconPluginModel
render_template = "datacenterlight/cms/section_icon.html"
cache = False
require_parent = True
@plugin_pool.register_plugin
class DCLSectionImagePlugin(CMSPluginBase):
module = "Datacenterlight"
model = DCLSectionImagePluginModel
render_template = "datacenterlight/cms/section_image.html"
cache = False
require_parent = True