{% include 'header.twig' %}
<div class="content">
        <!-- page and other top info -->
        <div id="page_info">

        </div>
        <!-- // page and other top info -->
        {% if contentText %}
<div class="card mt-2 mb-2">																
{{ contentText }}
</div>
{% endif %}
<section id="viewTicket">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-8">
                <div class="card card_v2">
                    <div class="card-body">
                        <div id="def_side_title">
                        
                            <div class="icon">
                              <i class="fas fa-question"></i>
                            </div>
                            <div class="name">
                                {{ messageList['ticket']['subject'] }}
                            </div>
                        </div>
                        <hr>
                        {% if messageList %}
                            {% for message in messageList %}
                            {% if message["support"] == 1 %}
                        <div class="ticket_chats">
                                                                                                                      <div class="row ticket-message-block ticket-message-right msg_user">
                                  <div class="col-md-2"></div>
                                  <div class="col-md-10">
                                    <div class="ticket-message">
                                      <div class="message">{{ message["message"]|replace({'\r\n': '<br>', '\n': '<br>'}) }}</div>
                                    </div>
                                    <div class="info text-end">
                                      <strong>{{ user["username"] }}</strong>
                                      <small class="text-muted">{{ message["time"] }}</small>
                                    </div>
                                  </div>
                                </div>
                                         {% elseif message["subject"] %}
                            {% else %}                                                                               <div class="row ticket-message-block ticket-message-left msg_admin">
                                  <div class="col-md-10">
                                    <div class="ticket-message">
                                      <div class="message">{{ message["message"]|replace({'\r\n': '<br>', '\n': '<br>'}) }}</div>
                                    </div>
                                    <div class="info">
                                      <strong>support</strong>
                                      <small class="text-muted">{{ message["time"] }}</small>
                                    </div>
                                  </div>
                                  <div class="col-md-2"></div>
                                </div>
                                             {% endif %}
                            {% endfor %}
                            {% endif %}                                         
                                                                                      
  
                          <hr>
                                                   {% if messageList['ticket']['canmessage'] == 2 %}   <div class="row">
                                <div class="col-md-12">
                                    <form method="post" action="tickets/{{ messageList['ticket']['ticket_id'] }}" enctype="multipart/form-data">
                                                                                                                    <div class="form-group panel-border-top">
                                          <label for="message" class="control-label">Message</label>
                                          <textarea id="message" rows="5" class="form-control" style="height: 200px;" name="message">{{ data["message"] }}</textarea>
                                          
                                          
                                        </div>
                    
                                      
                                                                                <button type="submit" class="btn btn-primary d-block w-100" id="submitButton">Submit</button>
                                      </form>
                                      {% endif %}
                                </div>
                                <div class="col-md-4">
                    
                                </div>
                            </div>
                                 </div>
    </div>
  </section>
{% if contentText2 %}
<div class="card mt-3 mb-4">
{{ contentText2 }}
</div>
{% endif %}
{% include 'footer.twig' %}
