Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'develop' into release/2.3rc1

  • Loading branch information...
commit 64d3bcad527c0d24f0df506ade023262b4364d1a 2 parents 204a8da + d9af6c6
@ojii ojii authored
View
6 cms/templates/admin/cms/page/menu_item.html
@@ -13,8 +13,8 @@
{% if not CMS_PERMISSION or has_add_permission or has_add_page_permission %}
{# if permissions not enabled, user user haves global can_add page #}
{% if has_add_on_same_level_permission %}
- <a href="#" class="move-target left" title="{% trans "insert above" %}"><img alt="" src="{% admin_static_url %}img/admin/arrow-up.gif"/></a><span class="line first"> |</span>
- <a href="#" class="move-target right" title="{% trans "insert below" %}"><img alt="" src="{% admin_static_url %}img/admin/arrow-down.gif"/></a><span class="line second"> |</span>
+ <a href="#" class="move-target left" title="{% trans "insert above" %}"><img alt="" src="{% cms_admin_icon_base %}arrow-up.gif"/></a><span class="line first"> |</span>
+ <a href="#" class="move-target right" title="{% trans "insert below" %}"><img alt="" src="{% cms_admin_icon_base %}arrow-down.gif"/></a><span class="line second"> |</span>
{% endif %}
<a href="#" class="move-target last-child" title="{% trans "insert inside" %}">↘</a>
{% endif %}
@@ -46,7 +46,7 @@
<div class="col-navigation">
<label>
- <img alt="{{ page.in_navigation|yesno:"True,False" }}" src="{% admin_static_url %}img/admin/icon-{{ page.in_navigation|yesno:"yes,no" }}.gif" />
+ <img alt="{{ page.in_navigation|yesno:"True,False" }}" src="{% cms_admin_icon_base %}icon-{{ page.in_navigation|yesno:"yes,no" }}.gif" />
{% if has_change_permission %}<input type="checkbox" class="navigation-checkbox" name="navigation-{{ page.id }}" {% if page.in_navigation %}checked="checked"{% endif %} value="{{ page.in_navigation|yesno:"1,0" }}" />{% endif %}
</label>
</div>
View
20 cms/templatetags/cms_admin.py
@@ -1,18 +1,25 @@
# -*- coding: utf-8 -*-
from classytags.arguments import Argument
-from classytags.core import Options
+from classytags.core import Options, Tag
from classytags.helpers import InclusionTag
from cms.models import MASK_PAGE, MASK_CHILDREN, MASK_DESCENDANTS
from cms.utils.admin import get_admin_menu_item_context
from cms.utils.permissions import get_any_page_view_permissions
+from distutils.version import LooseVersion
from django import template
from django.conf import settings
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext, ugettext_lazy as _
+import django
register = template.Library()
+if LooseVersion(django.get_version()) < LooseVersion('1.4'):
+ CMS_ADMIN_ICON_BASE = "%s/admin/img/admin/" % settings.STATIC_URL
+else:
+ CMS_ADMIN_ICON_BASE = "%s/admin/img/" % settings.STATIC_URL
+
class ShowAdminMenu(InclusionTag):
name = 'show_admin_menu'
template = 'admin/cms/page/menu.html'
@@ -109,7 +116,7 @@ def get_context(self, context, cl, spec):
@register.filter
def boolean_icon(value):
BOOLEAN_MAPPING = {True: 'yes', False: 'no', None: 'unknown'}
- return mark_safe(u'<img src="%simg/admin/icon-%s.gif" alt="%s" />' % (admin_static_url(), BOOLEAN_MAPPING[value], value))
+ return mark_safe(u'<img src="%sicon-%s.gif" alt="%s" />' % (CMS_ADMIN_ICON_BASE, BOOLEAN_MAPPING[value], value))
@register.filter
def is_restricted(page, request):
@@ -220,3 +227,12 @@ def admin_static_url():
If set, returns the string contained in the setting ADMIN_MEDIA_PREFIX, otherwise returns STATIC_URL + 'admin/'.
"""
return getattr(settings, 'ADMIN_MEDIA_PREFIX', None) or ''.join([settings.STATIC_URL, 'admin/'])
+
+
+class CMSAdminIconBase(Tag):
+ name = 'cms_admin_icon_base'
+
+ def render_tag(self, context):
+ return CMS_ADMIN_ICON_BASE
+
+register.tag(CMSAdminIconBase)
Please sign in to comment.
Something went wrong with that request. Please try again.