Fixed django 1.3 support
This commit is contained in:
parent
23309e0ad9
commit
796abb26e2
|
@ -1,15 +1,15 @@
|
|||
{% load url from future %}
|
||||
{% load theming_tags staticfiles %}
|
||||
{% load theming_tags %}
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
|
||||
<head>
|
||||
<title>{% block title %}{% endblock %}</title>
|
||||
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}" />
|
||||
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% get_admin_media "css/base.css" %}{% endblock %}" />
|
||||
{% block extrastyle %}{% endblock %}
|
||||
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% static "admin/css/ie.css" %}{% endblock %}" /><![endif]-->
|
||||
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %}
|
||||
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% get_admin_media "css/ie.css" %}{% endblock %}" /><![endif]-->
|
||||
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% get_admin_media "css/rtl.css" %}{% endblock %}" />{% endif %}
|
||||
{% render_theming_css %}
|
||||
<script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% static "admin/" %}{% endfilter %}";</script>
|
||||
<script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% get_admin_media %}{% endfilter %}";</script>
|
||||
{% block extrahead %}{% endblock %}
|
||||
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
|
||||
</head>
|
||||
|
|
|
@ -21,3 +21,15 @@ def render_theming_css():
|
|||
css = '/'.join([get_media_url(), 'admin_tools', 'css', 'theming.css'])
|
||||
return '<link rel="stylesheet" type="text/css" media="screen" href="%s" />' % css
|
||||
register.simple_tag(render_theming_css)
|
||||
|
||||
|
||||
def get_admin_media(media=''):
|
||||
"""
|
||||
Template tag that renders the needed css files for the theming app.
|
||||
"""
|
||||
return getattr(
|
||||
settings,
|
||||
'ADMIN_MEDIA_PREFIX', # django 1.3
|
||||
'%sadmin/' % getattr(settings, 'STATIC_URL') # django > 1.4
|
||||
) + media
|
||||
register.simple_tag(get_admin_media)
|
||||
|
|
Loading…
Reference in New Issue