More a11y: dialogs on book page
[wolnelektury.git] / src / wolnelektury / templates / lang-switcher.html
1 {% load i18n %}
2
3 <div class="c-lang">
4   <button type="button" class="c-lang__button"
5           popovertarget="{{ list_id }}">
6     <i class="icon icon-lang" aria-label="{% trans "JÄ™zyk:" %}"></i>
7     {{ LANGUAGE_CODE|language_name_local }}
8     <i class="icon icon-arrow-down" aria-hidden="true"></i>
9   </button>
10   <form method="post" action="{% url 'set_language' %}">
11     {% csrf_token %}
12     <div class="c-lang__list" id="{{ list_id }}" popover>
13       {% for lang in LANGUAGES %}
14         <button type="submit" lang="{{ lang.0 }}"
15                 name="language" value="{{ lang.0 }}"
16                 {% if lang.0 == LANGUAGE_CODE %}aria-current="true"{% endif %}
17                 class="{% if lang.0 == LANGUAGE_CODE %}is-active{% endif %}">{{ lang.1 }}</button>
18       {% endfor %}
19     </div>
20   </form>
21 </div>