feat(templates): Update
This commit is contained in:
parent
c291112350
commit
833c855b5c
10 changed files with 103 additions and 31 deletions
36
src/shared/templates/account/login.html
Normal file
36
src/shared/templates/account/login.html
Normal 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 %}
|
18
src/shared/templates/account/logout.html
Normal file
18
src/shared/templates/account/logout.html
Normal 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 %}
|
|
@ -1,4 +1,5 @@
|
|||
{% load allauth %}
|
||||
|
||||
{% comment %} djlint:off {% endcomment %}
|
||||
<{% if attrs.href %}a href="{{ attrs.href }}"{% else %}button{% endif %}
|
||||
{% if attrs.form %}form="{{ attrs.form }}"{% endif %}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
<a class="cell button is-{{ attrs.color }} is-light py-4" title="{{ attrs.name }}" href="{{ attrs.href }}">{{ attrs.name }}</a>
|
|
@ -1,6 +0,0 @@
|
|||
{% load allauth %}
|
||||
|
||||
<div class="grid mt-5">
|
||||
{% slot default %}
|
||||
{% endslot %}
|
||||
</div>
|
|
@ -1,5 +1,3 @@
|
|||
{% load django_browser_reload i18n sass_tags static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
|
@ -15,8 +13,17 @@
|
|||
<body>
|
||||
{% include "_hero.html" %}
|
||||
|
||||
<section class="section container">
|
||||
<div class="content">
|
||||
<section class="section">
|
||||
<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 %}
|
||||
{% endblock content %}
|
||||
</div>
|
||||
|
|
13
src/shared/templates/socialaccount/authentication_error.html
Normal file
13
src/shared/templates/socialaccount/authentication_error.html
Normal 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 %}
|
23
src/shared/templates/socialaccount/login.html
Normal file
23
src/shared/templates/socialaccount/login.html
Normal 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 %}
|
|
@ -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 %}
|
Loading…
Add table
Reference in a new issue