added supporters plugin
Signed-off-by: rscnt <rascnt@gmail.com>
This commit is contained in:
parent
1bba65bbe9
commit
30b1e5f9c3
2 changed files with 28 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
from cms.plugin_base import CMSPluginBase
|
||||
from cms.plugin_pool import plugin_pool
|
||||
from .models import DGGalleryPlugin
|
||||
from .models import DGGalleryPlugin, Supporter
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
class CMSGalleryPlugin(CMSPluginBase):
|
||||
|
@ -16,4 +16,17 @@ class CMSGalleryPlugin(CMSPluginBase):
|
|||
})
|
||||
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(CMSSupportersPlugin)
|
||||
|
|
14
digitalglarus/templates/digitalglarus/supporters_plugin.html
Normal file
14
digitalglarus/templates/digitalglarus/supporters_plugin.html
Normal 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>
|
Loading…
Reference in a new issue