{% include 'header.twig' %}
<style>
.ticket-title {
    color: #007bff;
    padding: 10px 20px;
    border: 1px dashed #007bff;
    display: inline-block;
    border-radius: 5px;
}
.row.ticket-message-block.ticket-message-right {
    color: white;
}
.row.ticket-message-block.ticket-message-left {
    color: white;
}
.message {
    background: #1c1c1e;
    padding: 10px;
    border-radius: 5px;
}
.ticket-message-left .message {
    background: white;
    color: #1c1c1e;
}
</style>
         <div class="app-content">
            <!-- page-content -->
            <div class="container-fluid">
               <div class="row mt-4">
                  <div class="col-lg-12">
                     <section class="order-side">
                        <div class="row">
                           <div class="col-lg-12 col-12 mb-5 mb-lg-0">
                              <div class="g-card dc-dblue">
                                 <div class="g-card-body" id="dc-body">
								 <div class="text-center mb-3"><div class="ticket-title">{{ messageList['ticket']['subject'] }} {% if messageList["ticket"]["canmessage"] == 1 %} <span class="badge"> Kilitli</span> {% endif %} </div></div>
								 
								  {% if messageList %}
									{% for message in messageList %}
									  {% if message["support"] == 1 %}
										<div class="row ticket-message-block ticket-message-right">
											 <div class="col-md-1"></div>
												<div class="col-md-11" style="margin-bottom: 10px">
													<div class="ticket-message">
														<div class="message">{{ message["message"] }}</div>
													</div>
													<div class="info text-right mt-2">
														<strong>{{ user["username"] }}</strong>
														<small class="text-muted">{{ message["time"] }}</small>
													</div>
												</div>
											<div class="col-md-1"></div>
										</div>
										{% elseif message["subject"] %}
										{% else %}
										<div class="row ticket-message-block ticket-message-left">
											<div class="col-md-11" style="margin-bottom: 10px">
												<div class="ticket-message">
													<div class="message">
														{{ message["message"] }}
													</div>
												</div>
												<div class="info mt-2">
													<strong>Destek Ekibi</strong>
													<small class="text-muted">{{ message['time'] }}</small>
												</div>
											 </div>
											<div class="col-md-1"></div>
										</div>
										{% endif %}
									  {% endfor %}
									{% endif %}
									
																		
									{% if messageList['ticket']['canmessage'] == 2 %}
									<form method="post" action="tickets/{{ messageList['ticket']['ticket_id'] }}">
									  {% if error %}
										<div class="alert alert-dismissible alert-danger">
										  <button type="button" class="close" data-dismiss="alert">×</button>
										  {{ errorText }}
										</div>
									  {% endif %}
									  {% if success %}
										<div class="alert alert-dismissible alert-success">
										  <button type="button" class="close" data-dismiss="alert">×</button>
										  {{ successText }}
										</div>
									  {% endif %}
                                       <div class="form-group message-2 mt-5">
                                          <label for="message" class="control-label">Mesajınız</label>
                                          <textarea class="form-control" rows="7" id="message" name="message" placeholder="Lütfen mesajınızı giriniz..." style="height:150px!important"></textarea>
                                       </div>
									   <input type="hidden" name="_csrf" value="{{csrftoken}}">
                                       <button type="submit" class="btn btn-primary btn-lg btn-block">Cevapla</button>
                                    </form>
									{% endif %}
                                 </div>
                              </div>
                              <!-- d-card end -->
                           </div>

                        </div>
                     </section>
                  </div>
                  <!-- page-content end -->
               </div>
               <!-- app-content -->
            </div>
         </div>

      </div>

{% include 'footer.twig' %}
