Add template tag to render icons directly from the templates

This commit is contained in:
Roberto Rosario
2012-09-22 00:45:03 -04:00
parent 628e74da95
commit aef795bffa
2 changed files with 16 additions and 0 deletions

View File

View File

@@ -0,0 +1,16 @@
from django.template import Library
from icons import Icon
register = Library()
@register.simple_tag
def icon_small(icon_name):
print "*******icon_name", icon_name
return Icon(icon_name).display_small()
@register.simple_tag
def icon_big(icon_name):
return Icon(icon_name).display_big()