allauth working and integrated

This commit is contained in:
vabene1111
2021-01-28 13:40:07 +01:00
parent 53c715b6f6
commit 63cfa14a21
12 changed files with 162 additions and 87 deletions

View File

@@ -0,0 +1,56 @@
{% extends "base.html" %}
{% load crispy_forms_filters %}
{% load i18n %}
{% load account socialaccount %}
{% block title %}{% trans 'Login' %}{% endblock %}
{% block content %}
<div class="row">
<div class="col-12" style="text-align: center">
<h3>{% trans "Sign In" %}</h3>
</div>
</div>
<div class="row">
<div class="col-6 offset-3">
<form class="login" method="POST" action="{% url 'account_login' %}">
{% csrf_token %}
{{ form | crispy }}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
{% endif %}
<button class="btn btn-primary" type="submit">{% trans "Sign In" %}</button>
</form>
</div>
</div>
{% get_providers as socialaccount_providers %}
{% if socialaccount_providers %}
<div class="row" style="margin-top: 2vh">
<div class="col-6 offset-3">
<h5>{% trans "Social Login" %}</h5>
<span>{% trans 'You can use any of the following providers to sign in.' %}</span>
<br/>
<br/>
<ul class="socialaccount_providers">
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
</ul>
{% include "socialaccount/snippets/login_extra.html" %}
</div>
</div>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,22 @@
{% extends "base.html" %}
{% load crispy_forms_filters %}
{% load i18n %}
{% block title %}{% trans 'Sign Out' %}{% endblock %}
{% block content %}
<h1>{% trans "Sign Out" %}</h1>
<p>{% trans 'Are you sure you want to sign out?' %}</p>
<form method="post" action="{% url 'account_logout' %}">
{% csrf_token %}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
{% endif %}
<button class="btn btn-warning" type="submit">{% trans 'Sign Out' %}</button>
</form>
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% extends "base.html" %}
{% load crispy_forms_filters %}
{% load i18n %}
{% block title %}{% trans 'Password Reset' %}{% endblock %}
{% block content %}
<span>{% trans 'Password reset is not implemented for the time being!' %}</span>
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% extends "base.html" %}
{% load crispy_forms_filters %}
{% load i18n %}
{% block title %}{% trans 'Password Reset' %}{% endblock %}
{% block content %}
<span>{% trans 'Password reset is not implemented for the time being!' %}</span>
{% endblock %}

View File

@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load crispy_forms_filters %}
{% load i18n %}
{% block title %}{% trans 'Register' %}{% endblock %}
{% block content %}
<h3>{% trans 'Create your Account' %}</h3>
<form method="post">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-success" type="submit"><i class="fas fa-save"></i> {% trans 'Create User' %}
</button>
</form>
{% endblock %}