Avoid next-confusion when logging out from website. Resolve #1745.

This commit is contained in:
Griatch 2019-08-28 20:49:11 +02:00
parent 57d2f3e15e
commit e7c6ed9ff0
3 changed files with 33 additions and 24 deletions

View file

@ -30,7 +30,7 @@
</head> </head>
<body> <body>
{% block body %} {% block body %}
<div id="top"><a href="#main-content" class="sr-only sr-only-focusable">Skip to main content.</a></div> <div id="top"><a href="#main-content" class="sr-only sr-only-focusable">Skip to main content.</a></div>
{% include "website/_menu.html" %} {% include "website/_menu.html" %}
<div class="container main-content mt-4" id="main-copy"> <div class="container main-content mt-4" id="main-copy">
@ -43,10 +43,10 @@
{% endif %} {% endif %}
<div class="{% if sidebar %}col-8{% else %}col{% endif %}"> <div class="{% if sidebar %}col-8{% else %}col{% endif %}">
{% include 'website/messages.html' %} {% include 'website/messages.html' %}
{% block content %} {% block content %}
{% endblock %} {% endblock %}
{% include 'website/pagination.html' %} {% include 'website/pagination.html' %}
</div> </div>
</div> </div>
@ -59,7 +59,7 @@
</div> </div>
{% endblock %} {% endblock %}
</footer> </footer>
{% endblock %} {% endblock %}
<!-- jQuery first, then Tether, then Bootstrap JS. --> <!-- jQuery first, then Tether, then Bootstrap JS. -->

View file

@ -1,25 +1,36 @@
{% extends "website/base.html" %} {% extends "website/base.html" %}
{% block header_ext %} {% block header_ext %}
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
{% endblock %} {% endblock %}
{% block titleblock %}Logged Out{% endblock %} {% block titleblock %}Logged Out{% endblock %}
{% block content %} {% block body %}
<div class="row">
<div class="col"> {% load addclass %}
<div class="card"> <div class="container main-content mt-4" id="main-copy">
<div class="card-body"> <div class="row">
<h1 class="card-title">Logged Out</h1> <div class="col-lg-5 offset-lg-3 col-sm-12">
<p>You have been logged out.</p> <div class="card mt-3">
<p>Redirecting in 2 seconds...</p> <div class="card-body">
<h1 class="card-title text-center">Logged Out</h1>
<div class="row">
<div class="col-lg-12 col-sm-12 text-center">You have been logged out.</div>
</div>
<div class="row">
<div class="col-lg-12 col-sm-12 text-center">Redirecting in 2 seconds ...</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<script type="text/JavaScript"> <script type="text/JavaScript">
setTimeout("location.href = '/';",2000); setTimeout("location.href = '/';",2000);
</script> </script>
{% endblock %} {% endblock %}

View file

@ -1,8 +1,6 @@
{% extends "website/base.html" %} {% extends "website/base.html" %}
{% block titleblock %} {% block titleblock %}Login{% endblock %}
Login
{% endblock %}
{% block body %} {% block body %}
@ -22,34 +20,34 @@ Login
<div class="alert alert-danger" role="alert">Your username and password are incorrect. Please try again.</div> <div class="alert alert-danger" role="alert">Your username and password are incorrect. Please try again.</div>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if not user.is_authenticated %} {% if not user.is_authenticated %}
<form method="post" action="."> <form method="post" action=".">
{% csrf_token %} {% csrf_token %}
<div class="form-group"> <div class="form-group">
<label for="id_username">Username:</label> <label for="id_username">Username:</label>
{{ form.username | addclass:"form-control" }} {{ form.username | addclass:"form-control" }}
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="id_password">Password:</label> <label for="id_password">Password:</label>
{{ form.password | addclass:"form-control" }} {{ form.password | addclass:"form-control" }}
</div> </div>
<hr /> <hr />
<div class="row"> <div class="row">
<div class="col-lg-6 col-sm-12 text-center small"><a href="{% url 'password_reset' %}">Forgot Password?</a></div> <div class="col-lg-6 col-sm-12 text-center small"><a href="{% url 'password_reset' %}">Forgot Password?</a></div>
<div class="col-lg-6 col-sm-12 text-center small"><a href="{% url 'register' %}">Create Account</a></div> <div class="col-lg-6 col-sm-12 text-center small"><a href="{% url 'register' %}">Create Account</a></div>
</div> </div>
<hr /> <hr />
<div class="form-group"> <div class="form-group">
<input class="form-control btn btn-outline-secondary" type="submit" value="Login" /> <input class="form-control btn btn-outline-secondary" type="submit" value="Login" />
<input type="hidden" name="next" value="{{ next }}" /> <input type="hidden" name="next" value="{{ next }}" />
</div> </div>
</form> </form>
{% endif %} {% endif %}
</div> </div>
</div> </div>