{% extends "ui/base-devices.html" %}

{% load url from future %}
{% load icons %}
{% load bob %}

{% block contentarea %}
  <div class="row-fluid">
    <div class="span10">
        <form class="form form-horizontal device-deploy-form" method="POST">
            {% csrf_token %}
            {% for f in form.visible_fields %}
            <div class="control-group {{ f.css_classes }}
                    {% if f.errors %}error{% endif %}
                ">
                <label class="{% if f.field.required %}required{% endif %}">
                    {{ f.label }}
                </label>
                <div>
                    {{ f }}
                    {%  if f.help_text %}
                        <span class="help-inline">{{ f.help_text }}</span>
                    {%  endif %}
                    {% for e in f.errors %}
                        <div class="alert alert-error">{{ e }}</div>
                    {% endfor %}
                </div>
            </div>
            {% endfor %}
            <div class="action-list">
                {% for kind, action in actions %}
                <div class="alert alert-{{ kind }}">{{ action }}</div>
                {% endfor %}
            </div>
            <div class="form-actions">
                <button class="btn btn-inverse pull-right" type="submit" name="deploy">
                    {% icon 'fugue-wand-hat' %}&nbsp;{{ action_name }}
                </button>
            </div>
        </form>
    </div>
    <div class="span2 template-tabs">
      {% tab_menu template_menu_items template_selected side='right' %}
    </div>
  </div>
{% endblock %}
