feat(templates): Update

This commit is contained in:
Tom Hubrecht 2024-10-07 23:33:22 +02:00
parent c291112350
commit 833c855b5c
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc
10 changed files with 103 additions and 31 deletions

View file

@ -1,6 +1,6 @@
{% load i18n django_browser_reload %} {% load i18n django_browser_reload %}
<footer class="footer has-text-centered"> <footer class="footer has-text-centered">
<b>{%blocktrans %}Logiciel développé pour et par la <a href="https://dgnum.eu">DGNum</a>.{% endblocktrans %}</b> <b>{% blocktrans %}Logiciel développé pour et par la <a href="https://dgnum.eu">DGNum</a>.{% endblocktrans %}</b>
{% django_browser_reload_script %} {% django_browser_reload_script %}
</footer> </footer>

View file

@ -0,0 +1,36 @@
{% extends "base.html" %}
{% load i18n socialaccount %}
{% load allauth account %}
{% block content %}
<h2 class="subtitle">{% trans "Connexion via un compte tiers" %}</h2>
<hr>
{% get_providers as providers %}
<div class="grid mt-5">
{% for provider in providers %}
{% if provider.id == "openid" %}
{% for brand in provider.get_brands %}
<a class="cell button is-{{ provider.app.settings.color }} is-light py-5 is-size-4"
title="{{ brand.name }}"
href="{% provider_login_url provider openid=brand.openid_url process="login" %}"><b>{{ brand.name }}</b></a>
{% endfor %}
{% endif %}
<a class="cell button is-{{ provider.app.settings.color }} is-light py-5 is-size-5"
title="{{ provider.id }}"
href="{% provider_login_url provider process="login" scope=scope auth_params=auth_params %}">{{ provider.name }}</a>
{% endfor %}
</div>
<!-- TODO: Write a text explaining how the different methods work -->
{% endblock content %}
{% block extra_body %}
{{ block.super }}
{% if PASSKEY_LOGIN_ENABLED %}
{% include "mfa/webauthn/snippets/login_script.html" with button_id="passkey_login" %}
{% endif %}
{% endblock extra_body %}

View file

@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load allauth i18n %}
{% block content %}
<h2 class="subtitle">{% trans "Déconnexion" %}</h2>
<hr>
<p class="notification is-warning is-light has-text-centered">
{% trans "Êtes vous certain·e de vouloir vous déconnecter ?" %}
</p>
<form method="post" action="{% url 'account_logout' %}">
{% csrf_token %}
{{ redirect_field }}
<button class="button is-fullwidth" type="submit">{% trans "Se déconnecter" %}</button>
</form>
{% endblock content %}

View file

@ -1,4 +1,5 @@
{% load allauth %} {% load allauth %}
{% comment %} djlint:off {% endcomment %} {% comment %} djlint:off {% endcomment %}
<{% if attrs.href %}a href="{{ attrs.href }}"{% else %}button{% endif %} <{% if attrs.href %}a href="{{ attrs.href }}"{% else %}button{% endif %}
{% if attrs.form %}form="{{ attrs.form }}"{% endif %} {% if attrs.form %}form="{{ attrs.form }}"{% endif %}

View file

@ -1 +0,0 @@
<a class="cell button is-{{ attrs.color }} is-light py-4" title="{{ attrs.name }}" href="{{ attrs.href }}">{{ attrs.name }}</a>

View file

@ -1,6 +0,0 @@
{% load allauth %}
<div class="grid mt-5">
{% slot default %}
{% endslot %}
</div>

View file

@ -1,5 +1,3 @@
{% load django_browser_reload i18n sass_tags static %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
@ -15,8 +13,17 @@
<body> <body>
{% include "_hero.html" %} {% include "_hero.html" %}
<section class="section container"> <section class="section">
<div class="content"> <div id="notifications">
{% for message in messages %}
<article class="notification is-light has-text-centered {{ message.tags }}">
<button class="delete"></button>
{{ message|safe }}
</article>
{% endfor %}
</div>
<div class="content container">
{% block content %} {% block content %}
{% endblock content %} {% endblock content %}
</div> </div>

View file

@ -0,0 +1,13 @@
{% extends "base.html" %}
{% load i18n %}
{% load allauth %}
{% block content %}
<h2 class="subtitle">{% trans "Erreur lors de la connexion" %}</h2>
<hr>
<p class="notification is-danger is-light has-text-centered">
{% trans "Une erreur est survenue lors de votre tentative de connexion avec un compte tiers." %}
</p>
{% endblock content %}

View file

@ -0,0 +1,23 @@
{% extends "base.html" %}
{% load allauth i18n %}
{% block title %}
{% trans "Connexion" %}
{% endblock title %}
{% block content %}
<h2 class="subtitle">
{% blocktrans with provider.name as provider %}Se connecter via un compte <b>{{ provider }}</b>{% endblocktrans %}
</h2>
<hr>
<p class="notification is-warning is-light has-text-centered">
{% blocktrans with provider.name as provider %}Vous vous apprêtez à vous connecter à l'aide d'un compte tiers provenant de {{ provider }}.{% endblocktrans %}
</p>
<form method="post">
{% csrf_token %}
<button class="button is-fullwidth" type="submit">{% trans "Continuer" %}</button>
</form>
{% endblock content %}

View file

@ -1,19 +0,0 @@
{% load allauth socialaccount %}
{% get_providers as socialaccount_providers %}
{% if socialaccount_providers %}
{% element provider_list %}
{% for provider in socialaccount_providers %}
{% if provider.id == "openid" %}
{% for brand in provider.get_brands %}
{% provider_login_url provider openid=brand.openid_url process=process as href %}
{% element provider name=brand.name provider_id=provider.id href=href color=provider.app.settings.color %}
{% endelement %}
{% endfor %}
{% endif %}
{% provider_login_url provider process=process scope=scope auth_params=auth_params as href %}
{% element provider name=provider.name provider_id=provider.id href=href color=provider.app.settings.color %}
{% endelement %}
{% endfor %}
{% endelement %}
{% endif %}