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

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

{% block content %}
<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 "Edit 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 {% if not is_default %} class="col-md-7" {% endif %}>
             {{ 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>
          {% if not is_default %}
          <div class="col-md-5">
            {{ form.roles }}
          </div>
          {% endif %}
         <div class="form-group">
            <div class="controls ">
              <input type="submit" name="submit" value="Save changes" class="btn btn-primary" id="submit-id-submit">
            </div>
         </div>
       </div>
    </form>
  </div>
</div>
{% endblock %}
