{% extends "ts/date_input.html" %}
{% load is_in_filter %}

{% block title %}{{ section.title }}{% endblock %}

{% block date_input %}
    <script type="text/javascript">
      $(function() {
        $("#id_e_date").date_input();
      });
    </script>
{% endblock %}

{% block content %}
<h1>Edit ticket #{{ticket.instance.id}}</h1>

<form method="POST" action="/ts/edit/{{ticket.instance.id}}/">
<div class="detail">
  <div class="row single">
    <div>
      <h3>{{ticket.s_desc.label_tag}}:</h3>{{ticket.s_desc}}
    </div>
  </div>
  <div class="clear">
    <div class="row one"><h3>{{ticket.resp.label_tag}}:</h3>{{ticket.resp}}</div>
    <div class="row two"><h3>{{ticket.queue.label_tag}}:</h3>{{ticket.queue}}</div>
  </div>
  <div>
    <div class="row one"><h3>{{ticket.urg.label_tag}}:</h3>{{ticket.urg}}</div>
    <div class="row two"><h3>{{ticket.status.label_tag}}</h3>{{ticket.status}}</div>
  </div>
  <div>
    <div class="row one"><h3>Creator:</h3>{{ticket.instance.creator}}</div>
    <div class="row two"><h3>Created:</h3>{{ticket.instance.s_date|date:"d.m.Y H:i"}}</div>
  </div>
  {% if ticket.instance.done %}
  <div>
    <div class="row one"><h3>{{ticket.e_date.label_tag}}:</h3>{{ticket.e_date}}</div>
    <div class="row two"><h3 style="color: green">Done</h3>{{ticket.instance.d_date|date:"d.m.Y H:i"}}</h3></div>
  </div>
  {% else %}
  <div class="row clear">
    <h3>{{ticket.e_date.label_tag}}:</h3>{{ticket.e_date}}
  </div>
  {% endif %}
  <div class="row last clear">
    <h3>{{ticket.l_desc.label_tag}}:</h3>
    {{ticket.l_desc}}</textarea>
  </div>
  {% if message %} <div class="error">{{ message }}</div> {% endif %}
</div>
<br />
<div class="toolbar"><input type="submit" name="submit" value="Save" /></div>
</form>
{% endblock %}
