mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-25 05:02:23 +00:00
Login is possible
This commit is contained in:
parent
264f2b7e6b
commit
93735da1a4
@ -4,7 +4,7 @@ chardet==3.0.4
|
||||
defusedxml==0.6.0
|
||||
Django~=3.0
|
||||
django-allauth==0.39.1
|
||||
django-crispy-forms==1.7.2
|
||||
django-crispy-forms==1.9.0
|
||||
django-extensions==2.1.9
|
||||
django-filter==2.2.0
|
||||
django-polymorphic==2.1.2
|
||||
@ -19,7 +19,7 @@ requests==2.22.0
|
||||
requests-oauthlib==1.2.0
|
||||
six==1.12.0
|
||||
sqlparse==0.3.0
|
||||
djangorestframework==3.9.0
|
||||
djangorestframework==3.11.0
|
||||
django-rest-polymorphic==0.1.8
|
||||
urllib3==1.25.3
|
||||
psycopg2-binary==2.8.4
|
||||
|
@ -152,25 +152,20 @@
|
||||
<ul class="navbar-nav">
|
||||
{% if not user.is_authenticated %}
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="/connexion"><i class="fas fa-sign-in-alt"></i> Connexion</a>
|
||||
<a class="nav-link" href="{% url "login" %}"><i class="fas fa-sign-in-alt"></i> Connexion</a>
|
||||
</li>
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="/inscription"><i class="fas fa-user-plus"></i> Inscription</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="/deconnexion"><i class="fas fa-sign-out-alt"></i> Déconnexion</a>
|
||||
<a class="nav-link" href="{% url "logout" %}"><i class="fas fa-sign-out-alt"></i> Déconnexion</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container-fluid my-3" style="max-width: 1600px;">
|
||||
{% if user.is_authenticated and not user.profile.email_confirmed %}
|
||||
<div class="alert alert-warning">
|
||||
{% trans "Your e-mail address is not validated. Please check your mail inbox and click on the validation link." %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% block contenttitle %}<h1>{{ title }}</h1>{% endblock %}
|
||||
<div id="messages"></div>
|
||||
{% block content %}
|
||||
|
15
templates/registration/email_validation_complete.html
Normal file
15
templates/registration/email_validation_complete.html
Normal file
@ -0,0 +1,15 @@
|
||||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
{% if validlink %}
|
||||
{% trans "Your email have successfully been validated." %}
|
||||
{% if user_object.profile.registration_valid %}
|
||||
{% blocktrans %}You can now <a href="{{ login_url }}">log in</a>.{% endblocktrans %}
|
||||
{% else %}
|
||||
{% trans "You must pay now your membership in the Kfet to complete your registration." %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% trans "The link was invalid. The token may have expired. Please send us an email to activate your account." %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
7
templates/registration/email_validation_email_sent.html
Normal file
7
templates/registration/email_validation_email_sent.html
Normal file
@ -0,0 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Account Activation</h2>
|
||||
|
||||
An email has been sent. Please click on the link to activate your account.
|
||||
{% endblock %}
|
10
templates/registration/logged_out.html
Normal file
10
templates/registration/logged_out.html
Normal file
@ -0,0 +1,10 @@
|
||||
{% extends "base.html" %}
|
||||
{% comment %}
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
{% endcomment %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<p>{% trans "Thanks for spending some quality time with the Web site today." %}</p>
|
||||
<p><a href="{% url 'index' %}">{% trans 'Log in again' %}</a></p>
|
||||
{% endblock %}
|
25
templates/registration/login.html
Normal file
25
templates/registration/login.html
Normal file
@ -0,0 +1,25 @@
|
||||
{% extends "base.html" %}
|
||||
{% comment %}
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
{% endcomment %}
|
||||
{% load i18n crispy_forms_filters %}
|
||||
|
||||
{% block title %}{% trans "Log in" %}{% endblock %}
|
||||
{% block contenttitle %}<h1>{% trans "Log in" %}</h1>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if user.is_authenticated %}
|
||||
<p class="errornote">
|
||||
{% blocktrans trimmed %}
|
||||
You are authenticated as {{ user }}, but are not authorized to
|
||||
access this page. Would you like to login to a different account?
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
{% endif %}
|
||||
<form method="post" id="login-form">
|
||||
{% csrf_token %}
|
||||
{{ form | crispy }}
|
||||
<input type="submit" value="{% trans 'Log in' %}" class="btn btn-primary">
|
||||
<a href="{% url 'password_reset' %}" class="badge badge-light">{% trans 'Forgotten your password or username?' %}</a>
|
||||
</form>
|
||||
{% endblock %}
|
9
templates/registration/password_change_done.html
Normal file
9
templates/registration/password_change_done.html
Normal file
@ -0,0 +1,9 @@
|
||||
{% extends "base.html" %}
|
||||
{% comment %}
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
{% endcomment %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<p>{% trans 'Your password was changed.' %}</p>
|
||||
{% endblock %}
|
13
templates/registration/password_change_form.html
Normal file
13
templates/registration/password_change_form.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends "base.html" %}
|
||||
{% comment %}
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
{% endcomment %}
|
||||
{% load i18n crispy_forms_tags %}
|
||||
|
||||
{% block content %}
|
||||
<form method="post">{% csrf_token %}
|
||||
<p>{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}</p>
|
||||
{{ form | crispy }}
|
||||
<input class="btn btn-primary" type="submit" value="{% trans 'Change my password' %}">
|
||||
</form>
|
||||
{% endblock %}
|
12
templates/registration/password_reset_complete.html
Normal file
12
templates/registration/password_reset_complete.html
Normal file
@ -0,0 +1,12 @@
|
||||
{% extends "base.html" %}
|
||||
{% comment %}
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
{% endcomment %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<p>{% trans "Your password has been set. You may go ahead and log in now." %}</p>
|
||||
<p>
|
||||
<a href="{{ login_url }}" class="btn btn-success">{% trans 'Log in' %}</a>
|
||||
</p>
|
||||
{% endblock %}
|
17
templates/registration/password_reset_confirm.html
Normal file
17
templates/registration/password_reset_confirm.html
Normal file
@ -0,0 +1,17 @@
|
||||
{% extends "base.html" %}
|
||||
{% comment %}
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
{% endcomment %}
|
||||
{% load i18n crispy_forms_tags %}
|
||||
|
||||
{% block content %}
|
||||
{% if validlink %}
|
||||
<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
|
||||
<form method="post">{% csrf_token %}
|
||||
{{ form | crispy }}
|
||||
<input class="btn btn-primary" type="submit" value="{% trans 'Change my password' %}">
|
||||
</form>
|
||||
{% else %}
|
||||
<p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
10
templates/registration/password_reset_done.html
Normal file
10
templates/registration/password_reset_done.html
Normal file
@ -0,0 +1,10 @@
|
||||
{% extends "base.html" %}
|
||||
{% comment %}
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
{% endcomment %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<p>{% trans "We've emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly." %}</p>
|
||||
<p>{% trans "If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder." %}</p>
|
||||
{% endblock %}
|
13
templates/registration/password_reset_form.html
Normal file
13
templates/registration/password_reset_form.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends "base.html" %}
|
||||
{% comment %}
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
{% endcomment %}
|
||||
{% load i18n crispy_forms_tags %}
|
||||
|
||||
{% block content %}
|
||||
<p>{% trans "Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one." %}</p>
|
||||
<form method="post">{% csrf_token %}
|
||||
{{ form | crispy }}
|
||||
<input class="btn btn-primary" type="submit" value="{% trans 'Reset my password' %}">
|
||||
</form>
|
||||
{% endblock %}
|
22
templates/registration/signup.html
Normal file
22
templates/registration/signup.html
Normal file
@ -0,0 +1,22 @@
|
||||
<!-- templates/signup.html -->
|
||||
{% extends 'base.html' %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Sign up" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>{% trans "Sign up" %}</h2>
|
||||
|
||||
<div class="alert alert-warning">
|
||||
{% blocktrans %}If you already signed up, your registration is taken into account. The BDE must validate your account before your can log in. You have to go to the Kfet and pay the registration fee. You must also validate your email address by following the link you received.{% endblocktrans %}
|
||||
</div>
|
||||
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
{{ profile_form|crispy }}
|
||||
<button class="btn btn-success" type="submit">
|
||||
{% trans "Sign up" %}
|
||||
</button>
|
||||
</form>
|
||||
{% endblock %}
|
@ -43,6 +43,13 @@ INSTALLED_APPS = [
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'django.forms',
|
||||
|
||||
'polymorphic',
|
||||
'crispy_forms',
|
||||
'django_tables2',
|
||||
'rest_framework',
|
||||
'rest_framework.authtoken',
|
||||
|
||||
'member',
|
||||
'tournament',
|
||||
@ -152,3 +159,7 @@ STATICFILES_DIRS = [
|
||||
MEDIA_URL = '/media/'
|
||||
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
|
||||
|
||||
CRISPY_TEMPLATE_PACK = 'bootstrap4'
|
||||
|
||||
DJANGO_TABLES2_TEMPLATE = 'django_tables2/bootstrap4.html'
|
||||
|
Loading…
Reference in New Issue
Block a user