feat: Add basic user handling

This commit is contained in:
2024-04-07 10:00:17 +02:00
parent 9af46290fa
commit e3ee4a2d32
18 changed files with 170 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
{% extends "fellchensammlung/base_generic.html" %}
{% load i18n %}
{% block content %}
{% if form.errors %}
<p>{% translate "Your username and password didn't match. Please try again." %}</p>
{% endif %}
{% if user.is_authenticated %}
<p>{% translate "You're already logged in." %}</p>
{% else %} {% if next %}
<p>{% translate "Please login to see this page." %}</p>
{% endif %}
{% endif %}
{% if not user.is_authenticated %}
<form method="post" action="{% url 'login' %}">
{% csrf_token %}
<table>
<tr>
<td>{{ form.username.label_tag }}</td>
<td>{{ form.username }}</td>
</tr>
<tr>
<td>{{ form.password.label_tag }}</td>
<td>{{ form.password }}</td>
</tr>
</table>
<input type="submit" value={% translate "login" %} />
<input type="hidden" name="next" value="{{ next }}" />
</form>
<p><a href="{% url 'password_reset' %}">{% translate "Lost password?" %}</a></p>
{% endif %}
{% endblock %}