All checks were successful
Build containers when image tags change / build-if-image-changed (., web, containers, main container, git.baumann.gr/adebaumann/vui) (push) Successful in 15s
Build containers when image tags change / build-if-image-changed (data-loader, loader, initContainers, init-container, git.baumann.gr/adebaumann/vui-data-loader) (push) Successful in 4s
SonarQube Scan / SonarQube Trigger (push) Successful in 47s
- Add new "alle-kommentare" (all comments) view for staff users only - Allows staff to view and manage all user comments across the system - Grouped by document with user information displayed - Staff can delete any comment via the dedicated delete button - Restricts access via user_passes_test decorator - Create all_comments.html template - Based on user_comments template with added username field - Shows comment author, creation time, and edit time - Provides delete functionality for comment management - Update navigation menu - Add "Alle Kommentare" link in user dropdown menu - Link only visible to staff members - Add URL route for alle-kommentare page - Path: /dokumente/alle-kommentare/ - URL name: all_comments - Bump application versions - Update footer version from 0.965 to 0.966 - Update K8s deployment version from 0.917 to 0.918 - ArgoCD deployment already at 0.966 All existing tests pass (148 tests total)
68 lines
2.8 KiB
HTML
68 lines
2.8 KiB
HTML
{% extends "base.html" %}
|
||
|
||
{% block content %}
|
||
<h1>Alle Kommentare</h1>
|
||
|
||
{% if total_comments == 0 %}
|
||
<div class="alert alert-info">
|
||
<p>Es gibt noch keine Kommentare zu Vorgaben.</p>
|
||
<p><a href="{% url 'standard_list' %}">Zu den Standards</a></p>
|
||
</div>
|
||
{% else %}
|
||
<p class="text-muted">Insgesamt {{ total_comments }} Kommentar{{ total_comments|pluralize:"e" }}</p>
|
||
|
||
{% for dokument, comments in comments_by_document.items %}
|
||
<div class="panel panel-default" style="margin-top: 2rem;">
|
||
<div class="panel-heading">
|
||
<h2 style="margin: 0;">
|
||
<a href="{% url 'standard_detail' nummer=dokument.nummer %}">
|
||
{{ dokument.nummer }} – {{ dokument.name }}
|
||
</a>
|
||
</h2>
|
||
<p style="margin: 0; color: #666; font-size: 0.9rem;">
|
||
{{ comments|length }} Kommentar{{ comments|length|pluralize:"e" }}
|
||
</p>
|
||
</div>
|
||
<div class="panel-body">
|
||
<div class="list-group">
|
||
{% for comment in comments %}
|
||
<div class="list-group-item" style="border-left: 3px solid #007bff; padding: 1rem;">
|
||
<div style="display: flex; justify-content: space-between; align-items: flex-start;">
|
||
<div style="flex: 1;">
|
||
<h4 style="margin: 0 0 0.5rem 0;">
|
||
<a href="{% url 'standard_detail' nummer=comment.vorgabe.dokument.nummer %}#{{ comment.vorgabe.Vorgabennummer }}">
|
||
{{ comment.vorgabe.Vorgabennummer }}
|
||
</a> {{ comment.vorgabe.titel }}
|
||
</h4>
|
||
<p style="margin: 0 0 0.75rem 0; color: #666; font-size: 0.9rem;">
|
||
<strong>Benutzer:</strong> {{ comment.user.first_name }} {{ comment.user.last_name }}<br>
|
||
<strong>Erstellt:</strong> {{ comment.created_at|date:"d.m.Y H:i" }}
|
||
{% if comment.updated_at != comment.created_at %}
|
||
<br>
|
||
<strong>Bearbeitet:</strong> {{ comment.updated_at|date:"d.m.Y H:i" }}
|
||
{% endif %}
|
||
</p>
|
||
</div>
|
||
<form method="POST" action="{% url 'delete_vorgabe_comment' comment.id %}"
|
||
style="display: inline; margin-left: 1rem;"
|
||
onsubmit="return confirm('Sind Sie sicher, dass Sie diesen Kommentar löschen möchten?');">
|
||
{% csrf_token %}
|
||
<button type="submit" class="btn btn-sm btn-danger">Löschen</button>
|
||
</form>
|
||
</div>
|
||
<div style="background: #f8f9fa; padding: 0.75rem; border-radius: 4px; margin-top: 0.5rem; white-space: pre-wrap; word-wrap: break-word;">
|
||
{{ comment.text }}
|
||
</div>
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endfor %}
|
||
{% endif %}
|
||
|
||
<div style="margin-top: 2rem; padding-top: 2rem; border-top: 1px solid #ddd;">
|
||
<a href="{% url 'standard_list' %}" class="btn btn-default">Zu den Standards</a>
|
||
</div>
|
||
{% endblock %}
|