Merge remote-tracking branch 'refs/remotes/origin/master'
mmit.
This commit is contained in:
parent
b3c40bd20d
commit
de875f80de
45 changed files with 603 additions and 150 deletions
33
digitalglarus/cms_plugins.py
Normal file
33
digitalglarus/cms_plugins.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
from cms.plugin_base import CMSPluginBase
|
||||
from cms.plugin_pool import plugin_pool
|
||||
from .models import DGGalleryPlugin, DGSupportersPlugin, Supporter
|
||||
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
|
||||
|
||||
class CMSSupportersPlugin(CMSPluginBase):
|
||||
name = _("Digital Glarus Supporters")
|
||||
model = DGSupportersPlugin
|
||||
render_template = "digitalglarus/supporters_plugin.html"
|
||||
|
||||
def render(self, context, instance, placeholder):
|
||||
context.update({
|
||||
'supporters': Supporter.objects.all().order_by('name'),
|
||||
'object': instance,
|
||||
'placeholder':placeholder
|
||||
})
|
||||
return context
|
||||
|
||||
plugin_pool.register_plugin(CMSGalleryPlugin)
|
||||
plugin_pool.register_plugin(CMSSupportersPlugin)
|
||||
Loading…
Add table
Add a link
Reference in a new issue