From ea1c24e5d1204cd80bbde0f73be399e4766ce747 Mon Sep 17 00:00:00 2001 From: rscnt Date: Mon, 8 Feb 2016 02:42:26 -0600 Subject: [PATCH] added plugins for digitalglarus --- digitalglarus/cms_plugins.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 digitalglarus/cms_plugins.py diff --git a/digitalglarus/cms_plugins.py b/digitalglarus/cms_plugins.py new file mode 100644 index 00000000..db317a67 --- /dev/null +++ b/digitalglarus/cms_plugins.py @@ -0,0 +1,19 @@ +from cms.plugin_base import CMSPluginBase +from cms.plugin_pool import plugin_pool +from .models import DGGalleryPlugin +from django.utils.translation import ugettext as _ + +class CMSGalleryPlugin(CMSPluginBase): + model = DGGalleryPlugin + name = _("Digital Glarus Gallery") + render_template = "digitalglarus/gallery.html" + + def render(self, context, instance, placeholder): + context.update({ + 'gallery':instance.dgGallery, + 'object':instance, + 'placeholder':placeholder + }) + return context + +plugin_pool.register_plugin(CMSGalleryPlugin)