mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 03:13:12 +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:
parent
58196cadad
commit
a7d7cbd261
2 changed files with 18 additions and 2 deletions
|
@ -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)),
|
||||||
|
|
18
templates/registration/logged_out.html
Normal file
18
templates/registration/logged_out.html
Normal 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 %}
|
Loading…
Reference in a new issue