added supporters plugin

Signed-off-by: rscnt <rascnt@gmail.com>
This commit is contained in:
rascencio 2016-02-13 14:28:46 -06:00
parent bead7f9626
commit d1c1882831
2 changed files with 28 additions and 1 deletions

View file

@ -1,6 +1,6 @@
from cms.plugin_base import CMSPluginBase from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool from cms.plugin_pool import plugin_pool
from .models import DGGalleryPlugin from .models import DGGalleryPlugin, Supporter
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
class CMSGalleryPlugin(CMSPluginBase): class CMSGalleryPlugin(CMSPluginBase):
@ -16,4 +16,17 @@ class CMSGalleryPlugin(CMSPluginBase):
}) })
return context return context
class CMSSupportersPlugin(CMSPluginBase):
name = _("Digital Glarus Supporters")
render_template = "digitalglarus/supporters_plugin.html"
def render(self, context, instance, placeholder):
context.update({
'supporters': Supporter.objects.all(),
'object': instance,
'placeholder':placeholder
})
return context
plugin_pool.register_plugin(CMSGalleryPlugin) plugin_pool.register_plugin(CMSGalleryPlugin)
plugin_pool.register_plugin(CMSSupportersPlugin)

View file

@ -0,0 +1,14 @@
<div class="col-md-12">
{{placeholder}}
<h1> WILLIWILLIWANKA </h1>
{% for supporter in supporters %}
<div class="col-md-6">
<div class="thumbnail">
<div class="caption">
<h3>{{supporter.name}}</h3>
<p>{{supporter.description}}</p>
</div>
</div>
</div>
{% endfor %}
</div>