{% include 'header.twig' %}
<div class="wrapper-content__header">
          </div>
    <div class="wrapper-content__body">
      <!-- Main variables *content* -->
      <div id="block_34">
    <div class="ticket-dialog ">
        <div class="bg"></div>
        <div class="divider-top"></div>
        <div class="divider-bottom"></div>
        <div class="container-fluid">
            <div class="row ticket-dialog__alignment">
                <div class="col-lg-12">
                   <div class="component_card">
                      <div class="card">
    <div class="col-md-12">

      {% if error %}
        <div class="alert alert-dismissible alert-danger">
          <button type="button" class="close" data-dismiss="alert">&times;</button>
          {{ errorText }}
        </div>
      {% endif %}
      {% if success %}
        <div class="alert alert-dismissible alert-success">
          <button type="button" class="close" data-dismiss="alert">&times;</button>
          {{ successText }}
        </div>
      {% endif %}

      <div class="well">
        <div class="ticket-dialog__title">{{ messageList['ticket']['subject'] }} {% if messageList["ticket"]["canmessage"] == 1 %} <span class="badge"> This request has been closed by the administrator</span> {% endif %} </div>

              {% if messageList %}
                {% for message in messageList %}
                  {% if message["support"] == 1 %}
                    <div class="ticket-dialog__title">
                      <div class="col-md-12">
                        <div class="ticket-dialog__row  ticket-dialog__row-admin">
                          <div class="ticket-dialog__row-message">{{ message["message"] }}</div>
                        </div>
                        <div class="info text-right">
                          <strong>{{ user["username"] }}</strong>
                          <small class="text-muted">{{ message["time"] }}</small>
                        </div>
                      </div>
                    </div>
                  {% elseif message["subject"] %}
                  {% else %}
                    <div class="ticket-dialog__body component_ticket_messages">
                      <div class="col-md-12">
                        <div class="ticket-dialog__row  ticket-dialog__row-admin">
                          <div class="ticket-dialog__row-message">{{ message["message"] }}</div>
                        </div>
                        <div class="info">
                          <strong>Support manager</strong>
                          <small class="text-muted">{{ message["time"] }}</small><br>
                        </div>
                      </div>
                    </div>
                  {% endif %}

                {% endfor %}
              {% endif %}
            {% if messageList['ticket']['canmessage'] == 2 %}
              <div class="row">
                  <div class="col-md-12">
                    <form method="post" action="tickets/{{ messageList['ticket']['ticket_id'] }}">
                      <div class="form-group panel-border-top"><br>
                        <label for="message" class="control-label">Your message</label>
                        <textarea id="message" rows="5" class="form-control" name="message">{{ data["message"] }}</textarea>
                      </div>
                      <button type="submit" class="btn btn-block btn-primary">Submit</button>
                    </form>
                  </div>
                </div>
              </div>
            {% endif %}

    </div>
  </div>
</div></div>
  </div>
</div></div>
  </div>
</div>
{% include 'footer.twig' %}
