-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add business logic views to login and logout users with magic link
- Loading branch information
1 parent
542c9b8
commit 61b5d70
Showing
10 changed files
with
1,023 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{% extends "board_base.html" %} | ||
{% load i18n %} | ||
{% block sub_title %} | ||
{% trans "Sign in" %} | ||
{% endblock sub_title %} | ||
{% block content %} | ||
<section class="s-title-01 mt-lg-5"> | ||
<div class="s-title-01__container container"> | ||
<div class="s-title-01__row row"> | ||
<div class="s-title-01__col col-12"> | ||
<h1 class="s-title-01__title h1"> | ||
<strong>{% trans "Sign in" %}</strong> | ||
</h1> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
<section class="s-section"> | ||
<div class="s-section__container container"> | ||
<div class="s-section__row row"> | ||
<div class="s-section__col col-12 col-lg-7"> | ||
<div class="card"> | ||
<div class="card-body"> | ||
Bonjour {{ email }} et bienvenue dans la communauté de l'inclusion, encore quelques informations avant de vous envoyer le lien. | ||
</div> | ||
<div class="c-form"> | ||
<form method="post" action="." enctype="multipart/form-data" novalidate> | ||
{% csrf_token %} | ||
{% if form.non_field_errors %} | ||
{% for error in form.non_field_errors %} | ||
<div class="alert alert-danger"> | ||
<i class="icon-exclamation-sign"></i> | ||
{{ error }} | ||
</div> | ||
{% endfor %} | ||
{% endif %} | ||
{% include "partials/form_field.html" with field=form.email %} | ||
{% include "partials/form_field.html" with field=form.first_name %} | ||
{% include "partials/form_field.html" with field=form.last_name %} | ||
<div class="form-actions"> | ||
<input type="hidden" name="next" value="{{ request.GET.next }}" /> | ||
<input type="submit" class="btn btn-large btn-primary" value="{% trans "Login with your email" %}" /> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{% extends "layouts/base.html" %} | ||
{% load static %} | ||
{% load i18n %} | ||
{% load theme_inclusion %} | ||
{% block title %}Connexion {{ block.super }}{% endblock %} | ||
{% block meta_description %} | ||
{% trans "Login | Sign in" %} | ||
{% endblock meta_description %} | ||
{% block content %} | ||
<section class="s-title-01 mt-lg-5"> | ||
<div class="s-title-01__container container"> | ||
<div class="s-title-01__row row"> | ||
<div class="s-title-01__col col-lg-8 col-12"> | ||
<h1 class="s-title-01__title h1">{% trans "Login | Sign in" %}</h1> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
<section class="s-section"> | ||
<div class="s-section__container container"> | ||
<div class="s-section__row row"> | ||
<div class="s-section__col col-12 col-lg-7"> | ||
Un lien de connexion vous a été envoyé à l'adresse {{ email }}. Veuillez vérifier votre boîte de réception et cliquer sur le lien pour vous connecter. | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
{% endblock content %} |
49 changes: 49 additions & 0 deletions
49
lacommunaute/templates/registration/login_with_magic_link.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{% extends "layouts/base.html" %} | ||
{% load static %} | ||
{% load i18n %} | ||
{% load theme_inclusion %} | ||
{% block title %}Connexion {{ block.super }}{% endblock %} | ||
{% block meta_description %} | ||
{% trans "Login | Sign in" %} | ||
{% endblock meta_description %} | ||
{% block content %} | ||
<section class="s-title-01 mt-lg-5"> | ||
<div class="s-title-01__container container"> | ||
<div class="s-title-01__row row"> | ||
<div class="s-title-01__col col-lg-8 col-12"> | ||
<h1 class="s-title-01__title h1">{% trans "Login | Sign in" %}</h1> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
<section class="s-section"> | ||
<div class="s-section__container container"> | ||
<div class="s-section__row row"> | ||
<div class="s-section__col col-12 col-lg-7"> | ||
<div class="card"> | ||
<div class="c-form"> | ||
<a href="{% url 'openid_connect:authorize' %}?next={{ next }}" rel="nofollow" class="btn btn-outline-primary btn-ico btn-block">Se connecter avec Pro Connect</a> | ||
<hr class="my-5" data-it-text="ou"> | ||
<form method="post" action="." enctype="multipart/form-data" novalidate> | ||
{% csrf_token %} | ||
{% if form.non_field_errors %} | ||
{% for error in form.non_field_errors %} | ||
<div class="alert alert-danger"> | ||
<i class="icon-exclamation-sign"></i> | ||
{{ error }} | ||
</div> | ||
{% endfor %} | ||
{% endif %} | ||
{% include "partials/form_field.html" with field=form.email %} | ||
<div class="form-actions"> | ||
<input type="hidden" name="next" value="{{ request.GET.next }}" /> | ||
<input type="submit" class="btn btn-large btn-primary" value="{% trans "Login with your email" %}" /> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from django import forms | ||
|
||
|
||
class LoginForm(forms.Form): | ||
email = forms.EmailField( | ||
label="", | ||
widget=forms.EmailInput(attrs={"placeholder": "Votre adresse email"}), | ||
) | ||
|
||
|
||
class CreateUserForm(forms.Form): | ||
first_name = forms.CharField(label="Votre prénom", max_length=150) | ||
last_name = forms.CharField(label="Votre nom", max_length=150) | ||
email = forms.EmailField(label="Votre adresse email") |
Empty file.
Oops, something went wrong.