{% extends "base.html" %} {% block title %}Issue #{{ issue.id }}{% endblock %} {% block content %}
Issue #{{ issue.id }} — {{ issue.severity|title }} Severity
{{ issue.status|replace('_',' ')|title }}
Reported
{{ issue.reported_at.strftime('%Y-%m-%d %H:%M') }}
Facility
{{ issue.area.facility.name }}
Area
{{ issue.area.name }}
{% if issue.inspection %}
Inspection
#{{ issue.inspection_id }}
{% endif %}
Assigned To
{{ issue.assigned_user.display_name if issue.assigned_user else '— Unassigned —' }}
{% if issue.resolved_at %}
Resolved
{{ issue.resolved_at.strftime('%Y-%m-%d %H:%M') }}
{% endif %}

Description

{{ issue.description }}

{% if issue.photo_path %}
Photo Evidence
{% endif %} {% if issue.result_notes or issue.result_photos %}
Resolution Details
{% if issue.result_notes %}

{{ issue.result_notes }}

{% endif %} {% if issue.result_photos %}
{% for photo in issue.result_photos %} Result photo {% endfor %}
{% endif %} {% endif %} {# ── Verification panel ── #} {% if issue.verified_at %}
Verified by {{ issue.verifier.display_name if issue.verifier else 'unknown' }} on {{ issue.verified_at.strftime('%Y-%m-%d %H:%M') }}. {% if issue.verification_note %}
{{ issue.verification_note }}{% endif %}
{% elif issue.status == 'pending_verification' %}
Awaiting director verification. {% if current_user.role in ['admin','director'] %}
{% endif %}
{% endif %}
{# ── Update History ─────────────────────────────────────────────────── #} {% if comments %}
Update History
    {% for c in comments %}
  • {{ c.author.display_name }} {{ c.status_at_time|replace('_',' ')|title }} {{ c.created_at.strftime('%Y-%m-%d %H:%M') }}

    {{ c.body }}

  • {% endfor %}
{% endif %}
{# ── Follow / Unfollow ──────────────────────────────────────────────── #}
{% if is_following %}Following{% else %}Not following{% endif %} {{ issue.followers.count() }} follower{{ 's' if issue.followers.count() != 1 else '' }}
{% if is_following %}
{% else %}
{% endif %}
{# ── Update Form ────────────────────────────────────────────────────── #} {% set can_edit = current_user.role in ['admin','director'] or issue.assigned_to == current_user.id %} {% if can_edit %}
Update Issue
{{ form.status.label(class="form-label fw-semibold") }} {{ form.status(class="form-select") }}
{% if current_user.role in ['admin','director'] %}
{{ form.assigned_to.label(class="form-label fw-semibold") }} {{ 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, placeholder="Describe what was done to resolve this issue…", value=issue.result_notes or '') }}
Attach one or more photos showing the resolution.
{% if issue.result_photos %}
{{ issue.result_photos|length }} photo(s) already uploaded
{% endif %}
{% if issue.status in ['in_progress', 'resolved'] and current_user.role not in ['customer'] %}
{% endif %}
{% endif %}
Back to Issues {% if current_user.role in ['admin', 'director'] %} {% endif %}
{% if current_user.role in ['admin', 'director'] %} {% endif %} {% block extra_js %} {% endblock %} {% endblock %}