{% extends "dashboard/base.html" %}
{% load i18n %}
{% load crispy_forms_tags %}

{% block title-page %}{% trans "Create lease" %}{% endblock %}

{% block content %}

<div class="row">
  <div class="col-md-12">
    <div class="panel panel-default">
      <div class="panel-heading">
        <a class="pull-right btn btn-default btn-xs" href="{% url "dashboard.views.template-list" %}">{% trans "Back" %}</a>
        <h3 class="no-margin"><i class="fa fa-clock-o"></i> {% trans "Create lease" %}</h3>
      </div>
      <div class="panel-body">
        {% with form=form %}
          {% include "display-form-errors.html" %}
        {% endwith %}
        <form method="post">
         {% csrf_token %}
         <div class="row container-fluid">
            <div class="col-md-7">
               {{ form.name|as_crispy_field }}
               <label>Suspend in</label>
               <div class="input-group interval-input">
                  {{ form.suspend_hours }}
                  <div class="input-group-addon">hours</div>
                  {{ form.suspend_days }}
                  <div class="input-group-addon">days</div>
                  {{ form.suspend_weeks }}
                  <div class="input-group-addon">weeks</div>
                  {{ form.suspend_months }}
                  <div class="input-group-addon">months</div>
               </div>
               <label>Delete in</label>
               <div class="input-group interval-input">
                  {{ form.delete_hours }}
                  <div class="input-group-addon">hours</div>
                  {{ form.delete_days }}
                  <div class="input-group-addon">days</div>
                  {{ form.delete_weeks }}
                  <div class="input-group-addon">weeks</div>
                  {{ form.delete_months }}
                  <div class="input-group-addon">months</div>
               </div>
            </div>
            <div class="col-md-5">
              {{ form.roles }}
            </div>
           <div class="form-group">
              <div class="controls ">
                <input type="submit" name="submit" value="Create lease" class="btn btn-primary" id="submit-id-submit">
              </div>
           </div>
         </div>
      </form>
      </div>
    </div>
  </div>
</div>

{% endblock %}
