{% extends "pyfarm/user_interface/layout.html" %}
{% block title %}Create Queue{% endblock %}
{% block jobqueues_nb_class %}active{% endblock %}
{% block content %}
<form method="POST" action="{{ url_for('jobqueue_create_ui') }}" class="form-horizontal">
  <div class="form-group">
    <label for="name" class="col-sm-2 control-label">Name</label>
    <div class="col-sm-10">
      <input id="name" class="form-control" name="name" type="text"/>
    </div>
  </div>
  <div class="form-group">
    <label for="parent" class="col-sm-2 control-label">Parent Queue</label>
    <div class="col-sm-10">
      <select class="form-control" id="parent" name="parent">
        <option value="">-</option>
        {% for queue in jobqueues %}
        {% if queue.id == parent %}
        <option value="{{ queue.id }}" selected>{{ queue.path() }}</option>
        {% else %}
        <option value="{{ queue.id }}">{{ queue.path() }}</option>
        {% endif %}
        {% endfor %}
      </select>
    </div>
  </div>
  <div class="form-group">
    <label for="minimum_agents" class="col-sm-2 control-label">Minimum Agents</label>
    <div class="col-sm-10">
      <input id="minimum_agents" class="form-control" name="minimum_agents" type="text"/>
    </div>
  </div>
  <div class="form-group">
    <label for="maximum_agents" class="col-sm-2 control-label">Maximum Agents</label>
    <div class="col-sm-10">
      <input id="maximum_agents" class="form-control" name="maximum_agents" type="text"/>
    </div>
  </div>
  <div class="form-group">
    <label for="priority" class="col-sm-2 control-label">Priority</label>
    <div class="col-sm-10">
      <input id="priority" class="form-control" name="priority" type="text"/>
    </div>
  </div>
  <div class="form-group">
    <label for="weight" class="col-sm-2 control-label">Weight</label>
    <div class="col-sm-10">
      <input id="weight" class="form-control" name="weight" type="text"/>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <input type="submit" class="btn btn-primary btn-large" value="Create"/>
    </div>
  </div>
</form>
{% endblock %}
