Disable login_required.
[audio.git] / apps / archive / templatetags / tags.py
1 from django import template
2
3 register = template.Library()
4
5 @register.inclusion_tag('archive/tags/multiple_tags_table.html')
6 def multiple_tags_table(tags, table=True):
7     new_tags = {}
8     if tags:
9         for k, v in tags.items():
10             if isinstance(v, list):
11                 new_tags[k] = v
12             else:
13                 new_tags[k] = [v]
14     return {"tags": new_tags, "table": table}
15
16
17 @register.inclusion_tag('archive/tags/tags_table.html')
18 def tags_table(tags, table=True):
19     if tags is None:
20         tags = {}
21     return locals()