- Recipe model with ingredients (amount/range, unit, group, note), steps, lowercase tags, author notes, source URL and private/public visibility - Central RecipeQuerySet.visible_to() used by every read path; edit only by owner, delete by owner or admin (visible recipes only) - Text-based editing: ingredient/step parser with roundtrip and scaling - Photo upload (JPEG/PNG/WebP/HEIC), re-encoded to WebP without EXIF, thumbnails, cover image, served only through permission-checked view - Search across title, description, ingredients, tags; ingredient and tag filters; "mine" and favourites views - Admin can delete all recipes of a deactivated user - Acceptance tests: private recipes unreachable for others and admins in list, search, tags, favourites, detail, edit, delete and image URLs Co-Authored-By: Claude Opus 5.5 <[email protected]>
40 lines
2.2 KiB
HTML
40 lines
2.2 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Nutzer verwalten{% endblock %}
|
|
{% block content %}
|
|
<h1>Nutzer</h1>
|
|
<p><a class="button" href="{% url 'accounts:admin_invitations' %}">Neue Einladung</a></p>
|
|
<ul class="list">
|
|
{% for u in users %}
|
|
<li class="card{% if not u.is_active %} inactive{% endif %}">
|
|
<div class="row-head">
|
|
<strong>{{ u.display_name }}</strong>
|
|
<span class="badge">{{ u.get_role_display }}</span>
|
|
{% if not u.is_active %}<span class="badge badge-muted">deaktiviert</span>{% endif %}
|
|
{% if u.must_change_password %}<span class="badge badge-muted">temp. Passwort</span>{% endif %}
|
|
</div>
|
|
<div class="muted">{{ u.email }} · seit {{ u.date_joined|date:"d.m.Y" }}</div>
|
|
<details class="actions">
|
|
<summary>Aktionen</summary>
|
|
<div class="action-buttons">
|
|
{% if u.is_active %}
|
|
<form method="post" action="{% url 'accounts:admin_user_action' u.pk 'reset_link' %}">{% csrf_token %}<button class="button secondary">Reset-Link erzeugen</button></form>
|
|
<form method="post" action="{% url 'accounts:admin_user_action' u.pk 'temp_password' %}">{% csrf_token %}<button class="button secondary">Temporäres Passwort</button></form>
|
|
{% if u != user %}
|
|
{% if u.role == "admin" %}
|
|
<form method="post" action="{% url 'accounts:admin_user_action' u.pk 'make_user' %}">{% csrf_token %}<button class="button secondary">Zu Nutzer machen</button></form>
|
|
{% else %}
|
|
<form method="post" action="{% url 'accounts:admin_user_action' u.pk 'make_admin' %}">{% csrf_token %}<button class="button secondary">Zu Admin machen</button></form>
|
|
{% endif %}
|
|
<form method="post" action="{% url 'accounts:admin_user_action' u.pk 'deactivate' %}">{% csrf_token %}<button class="button danger">Deaktivieren</button></form>
|
|
{% endif %}
|
|
{% else %}
|
|
<form method="post" action="{% url 'accounts:admin_user_action' u.pk 'activate' %}">{% csrf_token %}<button class="button secondary">Aktivieren</button></form>
|
|
<a class="button danger" href="{% url 'accounts:admin_user_delete_recipes' u.pk %}">Rezepte löschen …</a>
|
|
{% endif %}
|
|
</div>
|
|
</details>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endblock %}
|