From df67948efc2bd72c2e9bf292ac2f5cde1fa351f9 Mon Sep 17 00:00:00 2001 From: "Adrian A. Baumann" Date: Wed, 3 Dec 2025 13:23:11 +0100 Subject: [PATCH] All user comments on one page implemented, including tests --- .gitea/workflows/check_code_in_sonarqube.yaml | 8 +-- .../templates/standards/user_comments.html | 66 +++++++++++++++++++ 2 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 dokumente/templates/standards/user_comments.html diff --git a/.gitea/workflows/check_code_in_sonarqube.yaml b/.gitea/workflows/check_code_in_sonarqube.yaml index 65fde43..9a2c995 100644 --- a/.gitea/workflows/check_code_in_sonarqube.yaml +++ b/.gitea/workflows/check_code_in_sonarqube.yaml @@ -1,8 +1,8 @@ on: push: - branches: - - main - - development + # branches: + # - main + # - development pull_request: types: [opened, synchronize, reopened] @@ -64,4 +64,4 @@ jobs: -Dsonar.sources=. \ -Dsonar.host.url=${SONAR_HOST_URL} \ -Dsonar.token=${SONAR_TOKEN} \ - -Dsonar.python.coverage.reportPaths=coverage.xml \ No newline at end of file + -Dsonar.python.coverage.reportPaths=coverage.xml diff --git a/dokumente/templates/standards/user_comments.html b/dokumente/templates/standards/user_comments.html new file mode 100644 index 0000000..b0ca09f --- /dev/null +++ b/dokumente/templates/standards/user_comments.html @@ -0,0 +1,66 @@ +{% extends "base.html" %} + +{% block content %} +

Meine Kommentare

+ +{% if total_comments == 0 %} +
+

Sie haben noch keine Kommentare zu Vorgaben hinterlassen.

+

Zu den Standards

+
+{% else %} +

Insgesamt {{ total_comments }} Kommentar{{ total_comments|pluralize:"e" }}

+ + {% for dokument, comments in comments_by_document.items %} +
+
+

+ + {{ dokument.nummer }} – {{ dokument.name }} + +

+

+ {{ comments|length }} Kommentar{{ comments|length|pluralize:"e" }} +

+
+
+
+ {% for comment in comments %} +
+
+
+

+ + {{ comment.vorgabe.Vorgabennummer }} + +

+

+ Erstellt: {{ comment.created_at|date:"d.m.Y H:i" }} + {% if comment.updated_at != comment.created_at %} +
+ Bearbeitet: {{ comment.updated_at|date:"d.m.Y H:i" }} + {% endif %} +

+
+
+ {% csrf_token %} + +
+
+
+ {{ comment.text }} +
+
+ {% endfor %} +
+
+
+ {% endfor %} +{% endif %} + +
+ Zu den Standards +
+{% endblock %}