Commit ac251a4d authored by Michal Čihař's avatar Michal Čihař

Fix status icons with Django 1.9

The icons now use svg, we need to adjust our code to it.
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 55f6ca36
......@@ -25,6 +25,7 @@ from django.utils.encoding import force_unicode
from django.utils.translation import ugettext as _, ungettext, ugettext_lazy
from django.utils import timezone
from django import template
import django
import re
......@@ -240,7 +241,13 @@ def admin_boolean_icon(val):
'''
Admin icon wrapper.
'''
icon_url = static('admin/img/icon-%s.gif' % TYPE_MAPPING[val])
if django.VERSION > (1, 9):
ext = 'svg'
else:
ext = 'gif'
icon_url = static(
u'admin/img/icon-{0}.{1}'.format(TYPE_MAPPING[val], ext)
)
return mark_safe(
u'<img src="{url}" alt="{text}" title="{text}" />'.format(
url=icon_url,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment