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>
{% 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>
<title>{% block title %}{% endblock %}</title>
<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 %}
//]]>
</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 %}
<a href="javascript:{{ module }}.clearFeatures()">{% translate "Delete all Features" %}</a>
{% endif %}

View File

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