Added explicit HTMLElement.dir attribute in templates.

This commit is contained in:
Author: Nick Pope 2020-11-20 11:03:23 +01:00 committed by Mariusz Felisiak
parent d10425f9c7
commit 20f2b822f8
3 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{% load i18n static %}<!DOCTYPE html> {% load i18n static %}<!DOCTYPE html>
{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %} {% 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 %}> <html lang="{{ LANGUAGE_CODE|default:"en-us" }}" dir="{{ LANGUAGE_BIDI|yesno:'rtl,ltr,auto' }}">
<head> <head>
<title>{% block title %}{% endblock %}</title> <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 %}{% static "admin/css/base.css" %}{% endblock %}">

View File

@ -21,7 +21,7 @@
{% block openlayers %}{% include "gis/admin/openlayers.js" %}{% endblock %} {% block openlayers %}{% include "gis/admin/openlayers.js" %}{% endblock %}
//]]> //]]>
</script> </script>
<div id="{{ id }}_map"{% if LANGUAGE_BIDI %} dir="ltr"{% endif %}></div> <div id="{{ id }}_map" dir="{{ LANGUAGE_BIDI|yesno:'rtl,ltr,auto' }}"></div>
{% if editable %} {% if editable %}
<a href="javascript:{{ module }}.clearFeatures()">{% translate "Delete all Features" %}</a> <a href="javascript:{{ module }}.clearFeatures()">{% translate "Delete all Features" %}</a>
{% endif %} {% endif %}

View File

@ -1,7 +1,7 @@
{% load i18n %} {% load i18n %}
<!doctype html> <!doctype html>
{% get_current_language_bidi as LANGUAGE_BIDI %} {% get_current_language_bidi as LANGUAGE_BIDI %}
<html{% if LANGUAGE_BIDI %} dir="rtl"{% endif %}> <html dir="{{ LANGUAGE_BIDI|yesno:'rtl,ltr,auto' }}">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>{% translate "Django: the Web framework for perfectionists with deadlines." %}</title> <title>{% translate "Django: the Web framework for perfectionists with deadlines." %}</title>