added supporters plugin
Signed-off-by: rscnt <rascnt@gmail.com>
This commit is contained in:
parent
30b1e5f9c3
commit
d6ddbc31ce
7 changed files with 79 additions and 16 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from cms.plugin_base import CMSPluginBase
|
||||
from cms.plugin_pool import plugin_pool
|
||||
from .models import DGGalleryPlugin, Supporter
|
||||
from .models import DGGalleryPlugin, DGSupportersPlugin, Supporter
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
class CMSGalleryPlugin(CMSPluginBase):
|
||||
|
|
@ -18,11 +18,12 @@ class CMSGalleryPlugin(CMSPluginBase):
|
|||
|
||||
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(),
|
||||
'supporters': Supporter.objects.all().order_by('name'),
|
||||
'object': instance,
|
||||
'placeholder':placeholder
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue