Add icon display widget
This commit is contained in:
11
apps/icons/widgets.py
Normal file
11
apps/icons/widgets.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
from .api import get_icon_name
|
||||
from .literals import APP
|
||||
|
||||
|
||||
def icon_widget(icon_name):
|
||||
return mark_safe(u'<img src="%simages/icons/%s" />' % (settings.STATIC_URL, get_icon_name(icon_name)))
|
||||
Reference in New Issue
Block a user