feat: Add basic user handling
This commit is contained in:
36
src/templates/registration/login.html
Normal file
36
src/templates/registration/login.html
Normal 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 %}
|
Reference in New Issue
Block a user