Verified Commit 5887e729 authored by erdnaxe's avatar erdnaxe 🎇

New login form

parent 8ac9e64a
Pipeline #1099 passed with stage
in 3 minutes and 5 seconds
......@@ -10,14 +10,11 @@
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.utils.translation import gettext_lazy as _
from .views import index, about_page, contact_page
# Admin site configuration
admin.site.site_header = _('Aube')
admin.site.site_title = _('Aube')
admin.site.index_title = _('Homepage')
admin.site.index_template = 'index.html'
......@@ -28,7 +25,7 @@ urlpatterns = [
url(r'^$', index, name='index'),
url(r'^about/$', about_page, name='about'),
url(r'^contact/$', contact_page, name='contact'),
url('^', include('django.contrib.auth.urls')),
url(r'^', include('django.contrib.auth.urls')),
url(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^manage/', include(admin.site.urls)),
url(r'^doc/', include('django.contrib.admindocs.urls')),
......@@ -49,6 +46,7 @@ urlpatterns = [
# Add debug_toolbar URLs if activated
if 'debug_toolbar' in settings.INSTALLED_APPS:
import debug_toolbar
urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
]
......
......@@ -7,7 +7,7 @@ Copyright © 2019 Alexandre Iooss
{% load i18n staticfiles %}
{% block title %}{{ title }} | {{ site_title }}{% endblock %}
{% block title %}{{ title }} | {{ name_website }}{% endblock %}
{% block branding %}
<h1 id="site-name">
......@@ -15,7 +15,7 @@ Copyright © 2019 Alexandre Iooss
<img class="banding-logo" src="{% static 'images/logo_navbar.svg' %}" alt="Aube"/>
</a>
<a href="{% url 'admin:index' %}">
{{ site_header }}
{{ name_website }}
</a>
</h1>
{% endblock %}
......@@ -59,7 +59,7 @@ Copyright © 2019 Alexandre Iooss
{% block footer %}
<div id="footer">
<p>{{ site_title }} {% trans "powered by" %} Aube 2016&ndash;2019</p>
<p>{{ name_website }} {% trans "powered by" %} Aube 2016&ndash;2019</p>
<p>
{% blocktrans trimmed %}
This software is under the terms of the
......
{% extends 'base.html' %}
{% extends "admin/login.html" %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}
SPDX-License-Identifier: GPL-2.0-or-later
Copyright © 2019 Alexandre Iooss
{% load bootstrap3 %}
{% load i18n %}
This templates takes admin/login.html and patch the password reset link.
{% endcomment %}
{% load i18n static %}
{% block title %}{% trans "Log in" %}{% endblock %}
{% block content %}
{% if user.is_authenticated %}
{% if form.errors and not form.non_field_errors %}
<p class="errornote">
{% blocktrans trimmed %}
You are authenticated as {{ username }}, but are not authorized to
access this page. Would you like to login to a different account?
{% endblocktrans %}
{% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}
{% trans "Please correct the errors below." %}{% endif %}
</p>
{% endif %}
<form method="post" action="">
{% csrf_token %}
{% bootstrap_form form %}
<button class="btn btn-success" type="submit">
<i class="fa fa-sign-in"></i> {% trans "Log in" %}
</button>
</form>
<p><a class="btn btn-warning btn-sm" role="button"
href="{% url 'users:reset-password' %}"> {% trans "Forgotten password?" %}</a></p>
{% if form.non_field_errors %}
{% for error in form.non_field_errors %}
<p class="errornote">
{{ error }}
</p>
{% endfor %}
{% endif %}
<div id="content-main">
{% if user.is_authenticated %}
<p class="errornote">
{% blocktrans trimmed %}
You are authenticated as {{ username }}, but are not authorized to
access this page. Would you like to login to a different account?
{% endblocktrans %}
</p>
{% endif %}
<form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
<div class="form-row">
{{ form.username.errors }}
{{ form.username.label_tag }} {{ form.username }}
</div>
<div class="form-row">
{{ form.password.errors }}
{{ form.password.label_tag }} {{ form.password }}
<input type="hidden" name="next" value="{{ next }}"/>
</div>
{% url 'password_reset' as password_reset_url %}
{% if password_reset_url %}
<div class="password-reset-link">
<a href="{{ password_reset_url }}">{% trans 'Forgotten your password or username?' %}</a>
</div>
{% endif %}
<div class="submit-row">
<label>&nbsp;</label><input type="submit" value="{% trans 'Log in' %}"/>
</div>
</form>
</div>
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment