reworking of file structure
[mlpccg-meta.git] / meta / templatetags / meta_extras.py
1 from django import template
2 from django.utils.safestring import mark_safe
3 from django.utils.html import conditional_escape
4
5 register = template.Library()
6
7 @register.filter(needs_autoescape=True)
8 def deckicon(decklist, autoescape=None):
9 if autoescape:
10 esc = conditional_escape
11 else:
12 esc = lambda x: x
13
14 mane, aspects = decklist.aspects
15 return mark_safe("""
16 <div>
17 <p>{name}</p>
18 </div>
19 """.format(name=esc(decklist.name)))