Translation support and minor login view changes #35
|
@ -1,5 +1,5 @@
|
||||||
{% extends "login_base.html" %}
|
{% extends "login_base.html" %}
|
||||||
{% load i18n static %}
|
{% load i18n static language_code%}
|
||||||
|
|
||||||
{% block login_content %}
|
{% block login_content %}
|
||||||
<form action="{% url 'login:login' %}" method="post" class="row g-3 needs-validation" novalidate>
|
<form action="{% url 'login:login' %}" method="post" class="row g-3 needs-validation" novalidate>
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
autocorrect="off" class="form-control textinput textInput" id="yourEmail" required
|
autocorrect="off" class="form-control textinput textInput" id="yourEmail" required
|
||||||
autofocus placeholder="{{ form.username.label }}"
|
autofocus placeholder="{{ form.username.label }}"
|
||||||
{% if form.username.value %}value="{{ form.username.value }}" {% endif %}>
|
{% if form.username.value %}value="{{ form.username.value }}" {% endif %}>
|
||||||
<div class="invalid-feedback">Please enter your email.</div>
|
<div class="invalid-feedback">{%trans 'Please enter your email.' %}</div>
|
||||||
{% if form.username.errors %}
|
{% if form.username.errors %}
|
||||||
<p class="text-error">
|
<p class="text-error">
|
||||||
{{ form.username.errors|striptags }}
|
{{ form.username.errors|striptags }}
|
||||||
|
@ -30,17 +30,35 @@
|
||||||
<i class="input-group-text bi bi-eye" id="togglePassword" style="cursor: pointer">
|
<i class="input-group-text bi bi-eye" id="togglePassword" style="cursor: pointer">
|
||||||
</i>
|
</i>
|
||||||
</div>
|
</div>
|
||||||
<div class="invalid-feedback">Please enter your password!</div>
|
<div class="invalid-feedback">{% trans 'Please enter your password!'%}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input name="next" type="hidden" value="{{ success_url }}">
|
<input name="next" type="hidden" value="{{ success_url }}">
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<button class="btn btn-primary w-100" type="submit">Next</button>
|
<button class="btn btn-primary w-100" type="submit">{% trans "Next"%}</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div id="login-footer" class="mt-3">
|
|
||||||
<a href="{% url 'login:password_reset' %}" data-toggle="modal" data-target="#forgotPasswordModal">{% trans "Forgot your password? Click here to recover" %}</a>
|
<div id="login-footer" class="mt-3 d-flex justify-content-between align-items-center">
|
||||||
|
<a href="{% url 'login:password_reset' %}" data-toggle="modal" data-target="#forgotPasswordModal">{% trans "Forgot your password? Click here to recover" %}</a>
|
||||||
|
<div class="dropdown ms-auto pl-1">
|
||||||
|
<form action="{% url 'set_language' %}" method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
<button class="btn btn-tertiary dropdown-toggle" type="button" id="languageDropdown" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
|
{% get_current_language as LANGUAGE_CODE %}
|
||||||
|
{% get_language_info_list for LANGUAGES as languages %}
|
||||||
|
{{ LANGUAGE_CODE|get_language_code:languages }}
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="languageDropdown">
|
||||||
|
{% for lang in languages %}
|
||||||
|
<li>
|
||||||
|
<button class="dropdown-item" type="submit" name="language" value="{{ lang.code }}">{{ lang.name_local }}</button>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<div class="pt-2 pb-3">
|
<div class="pt-2 pb-3">
|
||||||
<h5 class="card-title text-center pb-0 fs-4 help">Sign in</h5>
|
<h5 class="card-title text-center pb-0 fs-4 help"> {% trans "Sign in" %}</h5>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue