Template tweaks

This commit is contained in:
Tom Hubrecht 2020-12-21 21:14:52 +01:00
parent 16d0d61e39
commit e7db47116e
4 changed files with 14 additions and 3 deletions

View file

@ -93,6 +93,7 @@ AUTHENTICATION_BACKENDS = [
]
LOGIN_URL = "auth.cas"
LOGIN_REDIRECT_URL = "kadenios"
# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/

View file

@ -2,12 +2,15 @@
{% load i18n %}
{% block auth %}{% endblock %}
{% block content %}
<h1 class="title">{% trans "Choisissez la méthode de connexion" %}</h1>
<hr>
{# Indications de connexion #}
{% if method %}
<div class="message is-warning">
<div class="message-body">
{% if method == "PWD" %}
@ -17,6 +20,7 @@
{% endif %}
</div>
</div>
{% endif %}
<div class="tile is-ancestor">
@ -32,7 +36,7 @@
</div>
<div class="tile is-parent">
<a class="tile is-child notification" href="{% url "auth.pwd" %}?next={{ next }}&election_id={{ election_id }}">
<a class="tile is-child notification" href="{% url "auth.pwd" %}?next={{ next }}&election_id={{ election_id }}&method={{ method }}">
<div class="subtitle has-text-centered mb-2">
<span class="icon">
<i class="fas fa-key"></i>

View file

@ -2,6 +2,8 @@
{% load i18n %}
{% block auth %}{% endblock %}
{% block content %}
<h1 class="title">{% trans "Connexion par mot de passe" %}</h1>

View file

@ -39,10 +39,13 @@
<nav class="level has-background-primary">
<div class="level-left pl-4">
<div class="level-item">
<h1 class="has-text-primary-light is-size-1 is-family-secondary">Kadenios</h1>
<a href="{% url "kadenios" %}">
<h1 class="has-text-primary-light is-size-1 is-family-secondary">Kadenios</h1>
</a>
</div>
</div>
{% block auth %}
<div class="level-right pr-5">
{% if user.is_authenticated %}
<div class="level-item mr-5">
@ -52,7 +55,7 @@
</div>
<div class="level-item ml-3">
<a class="icon is-size-1 has-text-white" href="{% url 'auth.logout' %}?next={{ view.get_next_url }}">
<a class="icon is-size-1 has-text-white" href="{% url 'auth.logout' %}?next=/{{ view.get_next_url }}">
<i class="fas fa-sign-out-alt"></i>
</a>
</div>
@ -71,6 +74,7 @@
</div>
{% endif %}
</div>
{% endblock %}
</nav>
{% block layout %}
<div class="main-content">