3fe5b360cd4dbaa2c2b0a2df50312b0f50cc2a71
[wolnelektury.git] / apps / picture / templatetags / picture_tags.py
1 from django import template
2 from django.template import Node, Variable, Template, Context
3 from catalogue.utils import split_tags
4
5 register = template.Library()
6
7 @register.inclusion_tag('picture/picture_short.html', takes_context=True)
8 def picture_short(context, picture):
9     return {
10         'picture': picture,
11         'main_link': picture.get_absolute_url(),
12         # 'related': picture.related_info(),
13         'request': context.get('request'),
14         'tags': split_tags(picture.tags),
15         }
16                             
17 @register.inclusion_tag('picture/picture_wide.html', takes_context=True)
18 def picture_wide(context, picture):
19     return {
20         'picture': picture,
21         'main_link': picture.get_absolute_url(),
22         # 'related': picture.related_info(),
23         'request': context.get('request'),
24         'tags': split_tags(picture.tags),
25         }
26