8
0
Fork 0
mirror of https://gitlab.federez.net/re2o/re2o synced 2024-06-02 16:02:16 +00:00

Add a logout confirmation

This patch remove the custom rule in router responsible to redirect
logout to index page and place a template with pre-translated strings.

This is part of Aube patchset for Re2o to unify the login procedure with
Django Contrib Auth.
This commit is contained in:
Alexandre Iooss 2019-04-15 09:43:18 +02:00 committed by klafyvel
parent 58196cadad
commit a7d7cbd261
2 changed files with 18 additions and 2 deletions

View file

@ -46,7 +46,6 @@ from __future__ import unicode_literals
from django.conf import settings from django.conf import settings
from django.conf.urls import include, url from django.conf.urls import include, url
from django.contrib import admin from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.views.generic import RedirectView from django.views.generic import RedirectView
from .views import index, about_page, contact_page from .views import index, about_page, contact_page
@ -58,7 +57,6 @@ urlpatterns = [
url(r'^$', index, name='index'), url(r'^$', index, name='index'),
url(r'^about/$', about_page, name='about'), url(r'^about/$', about_page, name='about'),
url(r'^contact/$', contact_page, name='contact'), url(r'^contact/$', contact_page, name='contact'),
url('^logout/', auth_views.logout, {'next_page': '/'}),
url('^', include('django.contrib.auth.urls')), url('^', include('django.contrib.auth.urls')),
url(r'^i18n/', include('django.conf.urls.i18n')), url(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),

View file

@ -0,0 +1,18 @@
{% extends "registration/logged_out.html" %}
{% comment %}
SPDX-License-Identifier: GPL-2.0-or-later
Copyright © 2019 Alexandre Iooss
{% endcomment %}
{% load i18n %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'index' %}">{% trans 'Home' %}</a>
</div>
{% endblock %}
{% 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 %}