django-project/templates/registration/login.html

47 lines
1.3 KiB
HTML

{#
Barn Web App - A collection of web-apps for my family's personal use,
including a recipe database.
Copyright © 2023 Benjamin Stadlbauer
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 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 Affero
General Public License for more details.
This program comes with a copy of the GNU Affero General Public License
file at the root of this project.
#}
{% extends "base_main.html" %}
{% block main %}
{% if form.errors %}
<section>
<p>Username and password do not match. Please try again.</p>
</section>
{% endif %}
{% if next %}
<section>
{% if user.is_authenticated %}
<p>You are not authorized to access this site. Please log in with an account with the necessary permissions.</p>
{% else %}
<p>Please log in to view this site.</p>
{% endif %}
</section>
{% endif %}
<form action="{% url 'login' %}" method="post">
{% csrf_token %}
{{ form.as_div }}
<input type="submit" value="Login">
<input type="hidden" name="next" value="{{ next }}">
</form>
{% endblock %}