瀏覽代碼

Made Django's templates get their own LANGUAGE_* variables.

Refs #24117
Collin Anderson 10 年之前
父節點
當前提交
58833f5197

+ 2 - 1
django/contrib/admin/templates/admin/base.html

@@ -1,4 +1,5 @@
-{% load admin_static %}<!DOCTYPE html>
+{% load i18n admin_static %}<!DOCTYPE html>
+{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
 <html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
 <head>
 <title>{% block title %}{% endblock %}</title>

+ 1 - 1
django/contrib/gis/templates/gis/admin/openlayers.html

@@ -1,5 +1,5 @@
 {% block extrastyle %}
-{% load static %}
+{% load i18n static %}{% get_current_language_bidi as LANGUAGE_BIDI %}
 <style type="text/css">
   #{{ id }}_map { width: {{ map_width }}px; height: {{ map_height }}px; }
   #{{ id }}_map .aligned label { float:inherit; }

+ 3 - 3
django/contrib/gis/templates/gis/openlayers.html

@@ -1,14 +1,14 @@
-<style type="text/css">{% block map_css %}
+<style type="text/css">{% block map_css %}{% load i18n static %}{% get_current_language_bidi as LANGUAGE_BIDI %}
     #{{ id }}_map { width: {{ map_width }}px; height: {{ map_height }}px; }
     #{{ id }}_map .aligned label { float: inherit; }
     #{{ id }}_div_map { position: relative; vertical-align: top; float: {{ LANGUAGE_BIDI|yesno:"right,left" }}; }
     {% if not display_raw %}#{{ id }} { display: none; }{% endif %}
     .olControlEditingToolbar .olControlModifyFeatureItemActive {
-        background-image: url("{{ STATIC_URL }}admin/img/gis/move_vertex_on.png");
+        background-image: url("{% static "admin/img/gis/move_vertex_on.png" %});
         background-repeat: no-repeat;
     }
     .olControlEditingToolbar .olControlModifyFeatureItemInactive {
-        background-image: url("{{ STATIC_URL }}admin/img/gis/move_vertex_off.png");
+        background-image: url("{% static "admin/img/gis/move_vertex_off.png" %});
         background-repeat: no-repeat;
     }{% endblock %}
 </style>