From cdcb675a2491c6d9e73b7b5ca63129eb29b87c09 Mon Sep 17 00:00:00 2001 From: NguyenND Date: Tue, 9 Jun 2026 14:07:27 -0400 Subject: [PATCH] 06/09 Remove issue details update notes, add comment section --- app/templates/issues/view.html | 139 +++++++++++++++++++++++---------- 1 file changed, 98 insertions(+), 41 deletions(-) diff --git a/app/templates/issues/view.html b/app/templates/issues/view.html index 91cb97c..7bd2f5e 100644 --- a/app/templates/issues/view.html +++ b/app/templates/issues/view.html @@ -1,8 +1,30 @@ {% extends "base.html" %} {% block title %}Issue #{{ issue.id }}{% endblock %} + +{% block extra_css %} + +{% endblock %} + {% block content %} +{% set can_edit = current_user.role in ['admin','director'] or issue.assigned_to == current_user.id %} +
+ {# ══════════════════════════════════ LEFT COLUMN ══════════════════════════════════ #}
+ + {# ── Issue details ──────────────────────────────────────────────────── #}
-
-
Update History
+ {# ── Comments ───────────────────────────────────────────────────────── #} +
+
+
+ Comments + {{ comments|length }} +
-
    + + {# Comment list #} + {% if comments %} +
    + {% set avatar_colors = ['#4f46e5','#0891b2','#059669','#d97706','#dc2626','#7c3aed','#db2777'] %} {% for c in comments %} -
  • -
    - - {{ c.author.display_name }} - - - - {{ c.status_at_time|replace('_',' ')|title }} - - {{ c.created_at.strftime('%Y-%m-%d %H:%M') }} - + {% set avatar_color = avatar_colors[c.author.id % (avatar_colors | length)] %} +
    +
    + {{ c.author.display_name[0] | upper }}
    -

    {{ c.body }}

    -
  • +
    +
    +
    + {{ c.author.display_name }} + {% if c.author.role == 'customer' %} + Customer + {% else %} + {{ c.author.role|replace('_',' ')|title }} + {% endif %} +
    +
    + + {{ c.status_at_time|replace('_',' ')|title }} + + {{ c.created_at.strftime('%b %d, %Y %H:%M') }} +
    +
    +

    {{ c.body }}

    +
    +
    {% endfor %} -
+
+
+ {% endif %} + + {# Add Comment form — submits to the same view POST endpoint #} + {% if can_edit %} +
+

Add Comment

+
+ + {# Keep current status and assigned_to so the route doesn't change them #} + + +
+ +
+ +
+
+ {% elif current_user.role != 'customer' %} +
+

+ Only assigned staff can add comments. +

+
+ {% endif %}
- {% endif %} -
+
{# /col-lg-8 #} + {# ══════════════════════════════════ RIGHT COLUMN ═════════════════════════════════ #}
{# ── Follow / Unfollow ──────────────────────────────────────────────── #} @@ -195,7 +263,6 @@
{# ── Update Form ────────────────────────────────────────────────────── #} - {% set can_edit = current_user.role in ['admin','director'] or issue.assigned_to == current_user.id %} {% if can_edit %}
Update Issue
@@ -212,10 +279,6 @@ {{ form.assigned_to(class="form-select") }}
{% endif %} -
- {{ form.update_notes.label(class="form-label fw-semibold") }} - {{ form.update_notes(class="form-control", rows=3, placeholder="Optional update notes…") }} -
{{ form.result_notes.label(class="form-label fw-semibold") }} {{ form.result_notes(class="form-control", rows=3, @@ -249,7 +312,8 @@
{% endif %} -
+ + {# /col-lg-4 #}
@@ -265,7 +329,6 @@
{% if current_user.role in ['admin', 'director'] %} -