reworking of file structure
[mlpccg-meta.git] / meta / templatetags / meta_extras.py
index 6f56fd0..6a44ed2 100644 (file)
@@ -1,8 +1,19 @@
 from django import template
+from django.utils.safestring import mark_safe
+from django.utils.html import conditional_escape
 
 register = template.Library()
 
-@register.filter
-def deckicon(decklist):
-    #mane, aspects = decklist.aspects
-    return decklist.description
+@register.filter(needs_autoescape=True)
+def deckicon(decklist, autoescape=None):
+    if autoescape:
+        esc = conditional_escape
+    else:
+        esc = lambda x: x
+
+    mane, aspects = decklist.aspects
+    return mark_safe("""
+    <div>
+        <p>{name}</p>
+    </div>
+    """.format(name=esc(decklist.name)))