{% extends "menu.html" %}

{% block head %}
    <script src="/media/js/common.js" type="text/javascript"></script>
    <script src="/media/js/add_filter.js" type="text/javascript"></script>
{% endblock %}

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

{% block content %}
<h1>Filter tickets</h1>
<form method="get" action="/ts/filter">
<div class="detail">
  <div class="row single">
    <h3>Status</h3>
  {% for stat in status %}
    <input type="checkbox" name="status" value="{{stat.1}}" /> {{stat.1}}
  {% endfor %}
  </div>
  <div class="row single">
    <h3>Urgency</h3>
  {% for urg in urgency %}
    <input type="checkbox" name="urg" value="{{urg.1}}" /> {{urg.1}}
  {% endfor %}
  </div>
  <div class="row single">
    <h3>Requestor</h3>
      <select name="creator">
        <option></option>
        {% for u in users %}{% ifequal u ticket.resp %}
	<option value="{{u.id}}" selected="selected">{{u}}</option>
        {% else %}
	<option value="{{u}}">{{u}}</option>
        {% endifequal %}{% endfor %}
      </select>
      <img src="/media/images/add.png" alt="add" onclick="add_filter(event, 'SELECT')" /> <noscript>We are sorry, but to use several fields, You must enable javascript.</noscript>
  </div>
  <div class="row single">
    <h3>Responsible</h3>
      <select name="resp">
        <option></option>
        {% for u in users %}{% ifequal u ticket.resp %}
	<option value="{{u.id}}" selected="selected">{{u}}</option>
        {% else %}
	<option value="{{u}}">{{u}}</option>
        {% endifequal %}{% endfor %}
      </select>
      <img src="/media/images/add.png" alt="add" onclick="add_filter(event, 'SELECT')" /> <noscript>We are sorry, but to use several fields, You must enable javascript.</noscript>
  </div>
  <div class="row single">
    <h3>Queue</h3>
      <select name="queue">
        <option value="" selected="selected">---------</option>
        {% for q in queue %}{% ifequal q ticket.queue %}
	<option value="{{ticket.queue}}" selected="selected">{{ticket.queue}}</option>
        {% else %}
          <option value="{{q}}">{{q}}</option>
        {% endifequal %}{% endfor %}
      </select>
      <img src="/media/images/add.png" alt="add" onclick="add_filter(event, 'SELECT')" /> <noscript>We are sorry, but to use several fields, You must enable javascript.</noscript>
  </div>
  <div class="row single">
    <div>
      <h3>Short description</h3> <input type="text" name="s_desc" />
    </div>
  </div>
  <div class="row single last">
    <h3>Description</h3> <input type="text" name="l_desc" />
  </div>
</div>
<br />
<div class="toolbar"><input type="submit" value="Filter" /></div>
</form>
{% endblock %}
