8000 Fixed #6457 -- Fixed rendering of permission icons by bplociennik · Pull Request #6624 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

Fixed #6457 -- Fixed rendering of permission icons #6624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cms/templatetags/cms_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from classytags.helpers import InclusionTag
from cms.constants import PUBLISHER_STATE_PENDING

from django import VERSION as DJANGO_VERSION
from django import template
from django.conf import settings
from django.contrib.admin.views.main import ERROR_FLAG
Expand Down Expand Up @@ -129,8 +130,10 @@ def choices():
@register.filter
def boolean_icon(value):
BOOLEAN_MAPPING = {True: 'yes', False: 'no', None: 'unknown'}
EXTENSION = 'gif' if DJANGO_VERSION < (1, 9) else 'svg'
return mark_safe(
'<img src="%sicon-%s.gif" alt="%s" />' % (CMS_ADMIN_ICON_BASE, BOOLEAN_MAPPING.get(value, 'unknown'), value))
'<img src="%sicon-%s.%s" alt="%s" />' % (CMS_ADMIN_ICON_BASE, BOOLEAN_MAPPING.get(value, 'unknown'), EXTENSION,
value))


@register.filter
Expand Down
0