added supporters plugin
Signed-off-by: rscnt <rascnt@gmail.com>
This commit is contained in:
		
					parent
					
						
							
								d1c1882831
							
						
					
				
			
			
				commit
				
					
						f25a4f3d57
					
				
			
		
					 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