{{ ticket.ticket_number }}{{ ticket.creator.full_name }}
{% if ticket.filed_by_staff %}
Filed by {{ ticket.filed_by_staff.full_name }}
{% endif %}
{{ ticket.category.replace('_',' ').title() }}{{ ticket.created_at | localtime("%b %d, %Y %H:%M") }}
{% if ticket.location %}{{ ticket.location }}{% endif %}
{% if ticket.asset_tag %}{{ ticket.asset_tag }}{% endif %}
{% if ticket.ai_generated %}AI-generated{% endif %}
Description
{{ ticket.description }}
{% set ticket_atts = ticket.attachments.filter_by(comment_id=None).all() %}
{% if ticket_atts %}
Attachments
{% for att in ticket_atts %}
{% set ext = att.filename.rsplit('.', 1)[-1].lower() if '.' in att.filename else '' %}
{% set is_img = (att.mime_type and att.mime_type.startswith('image/')) or ext in ('png','jpg','jpeg','gif','webp','svg') %}
{% if is_img %}
{% else %}
{{ att.filename }}
({{ (att.file_size/1024)|int }}KB)
{% endif %}
{% endfor %}
{{ comment.author.full_name }}
{% if comment.author.is_it_staff %}
IT STAFF
{% endif %}
{% if comment.is_internal %}
INTERNAL NOTE
{% endif %}
{{ comment.created_at | localtime("%b %d, %Y %H:%M") }}
{% if current_user.is_it_staff or comment.author_id == current_user.id %}
{% endif %}
{{ comment.body | safe }}
{% set c_atts = comment.attachments.all() %}
{% if c_atts %}
{% for att in c_atts %}
{% set ext = att.filename.rsplit('.', 1)[-1].lower() if '.' in att.filename else '' %}
{% set is_img = (att.mime_type and att.mime_type.startswith('image/')) or ext in ('png','jpg','jpeg','gif','webp','svg') %}
{% if is_img %}
{% else %}
{{ att.filename }}
{% endif %}
{% endfor %}
{% endif %}
{% else %}
No comments yet. Be the first to add an update.
{% endfor %}
{% if ticket.status not in ('closed',) %}
Add Comment
{% endif %}
{% if current_user.is_it_staff %}
Update Ticket
{% endif %}
{% if current_user.is_it_staff %}
Linked Tickets
{% if linked_tickets %}
{% for lnk, other in linked_tickets %}