feat: implement user authentication with login/logout functionality
- Add user login screen with German interface - Add user icon and dropdown menu in header for authenticated users - Add password change functionality with proper redirects - Configure authentication URLs and settings - Ensure all auth functions redirect to main page instead of admin - Complete openspec change proposal for login feature
This commit is contained in:
43
pages/templates/registration/login.html
Normal file
43
pages/templates/registration/login.html
Normal file
@@ -0,0 +1,43 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Anmelden{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Anmelden</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
{% if form.errors %}
|
||||
<div class="alert alert-danger">
|
||||
<p>Ihr Benutzername und Passwort stimmen nicht überein. Bitte versuchen Sie es erneut.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_username">Benutzername:</label>
|
||||
<input type="text" name="username" class="form-control" id="id_username" required autofocus>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_password">Passwort:</label>
|
||||
<input type="password" name="password" class="form-control" id="id_password" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary">Anmelden</button>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
56
pages/templates/registration/password_change.html
Normal file
56
pages/templates/registration/password_change.html
Normal file
@@ -0,0 +1,56 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Passwort ändern{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Passwort ändern</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
{% if form.errors %}
|
||||
<div class="alert alert-danger">
|
||||
<p>Bitte korrigieren Sie die Fehler unten.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_old_password">Aktuelles Passwort:</label>
|
||||
<input type="password" name="old_password" class="form-control" id="id_old_password" required>
|
||||
{% if form.old_password.errors %}
|
||||
<div class="text-danger">{{ form.old_password.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_new_password1">Neues Passwort:</label>
|
||||
<input type="password" name="new_password1" class="form-control" id="id_new_password1" required>
|
||||
{% if form.new_password1.errors %}
|
||||
<div class="text-danger">{{ form.new_password1.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_new_password2">Neues Passwort bestätigen:</label>
|
||||
<input type="password" name="new_password2" class="form-control" id="id_new_password2" required>
|
||||
{% if form.new_password2.errors %}
|
||||
<div class="text-danger">{{ form.new_password2.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary">Passwort ändern</button>
|
||||
<a href="/" class="btn btn-default">Abbrechen</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
24
pages/templates/registration/password_change_done.html
Normal file
24
pages/templates/registration/password_change_done.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Passwort geändert{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Passwort erfolgreich geändert</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-success">
|
||||
<p>Ihr Passwort wurde erfolgreich geändert.</p>
|
||||
</div>
|
||||
<p>
|
||||
<a href="/" class="btn btn-primary">Zurück zur Startseite</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user