Base templates

This commit is contained in:
Alexandre Iooss 2021-09-22 19:32:04 +02:00
parent 76ed93ff33
commit 5610ade1fe
19 changed files with 426 additions and 2 deletions

View file

@ -0,0 +1,24 @@
{% extends "base.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% block content %}
<form action="{% url 'set_language' %}" method="post" class="form-inline">
{% csrf_token %}
<select title="language" name="language" class="form-control form-control-sm language" onchange="this.form.submit()">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% for lang_code, lang_name in LANGUAGES %}
<option value="{{ lang_code }}" {% if lang_code == LANGUAGE_CODE %}selected{% endif %}>
{{ lang_name }} ({{ lang_code }})
</option>
{% endfor %}
</select>
<noscript><input type="submit"></noscript>
</form>
{% if request.user.is_authenticated %}
{% trans "Connected as" %} {{ request.user.username }}
{% endif %}
{% endblock %}