{% extends 'base.html.twig' %} {% import "_modules/bsmacros.html.twig" as bs %} {% block title %} {{ parent() }} - Ticket #{{ ticket.id }} {% endblock %} {% block content %} {% for label, messages in app.flashes %} {% for message in messages %} {{ bs.alert(message, label) }} {% endfor %} {% endfor %}

{{ ticket.subject }}

{% if app.user.isAdmin() %} {% endif %} {% if app.user.isAdmin() or app.user == ticket.createdBy %} Edit {% if ticket.status != 'closed' %} Close {% endif %} {% endif %}
Created by:
{{ ticket.createdBy.username }}
Created on:
{{ ticket.createdAt|date('Y-m-d H:i') }}
Status:
{% set status_class = { 'open': 'primary', 'in_progress': 'info', 'resolved': 'success', 'closed': 'secondary' } %} {{ bs.badge(ticket.status|capitalize, status_class[ticket.status]) }}
{% if ticket.updatedAt %}
Last updated:
{{ ticket.updatedAt|date('Y-m-d H:i') }}
{% endif %}
Priority:
{% set priority_class = { 'low': 'success', 'medium': 'info', 'high': 'warning', 'critical': 'danger' } %} {{ bs.badge(ticket.priority|capitalize, priority_class[ticket.priority]) }}
Assigned to:
{% if ticket.assignedTo %} {{ ticket.assignedTo.username }} {% else %} Unassigned {% endif %}
Description

{{ ticket.description|nl2br }}

{% if ticket.comments|length > 0 %}
Comments ({{ ticket.comments|length }})
{% for comment in ticket.comments %}
{{ comment.author.username }} {% if comment.author.isAdmin() %} {{ bs.badge('Admin', 'danger') }} {% endif %} {% if comment.author == ticket.assignedTo %} {{ bs.badge('Assigned', 'primary') }} {% endif %}
{{ comment.createdAt|date('M d Y g:i A') }}

{{ comment.content|nl2br }}

{% endfor %}
{% endif %} {% if ticket.status != 'closed' %}
Add Comment
{{ form_start(comment_form) }} {{ bs.form_row(comment_form.content) }} {{ form_end(comment_form) }}
{% endif %}
{% endblock %} {% block scripts %} {{ parent() }} {% endblock %}