{% extends "base.html" %} {% load crispy_forms_tags %}
{% block title %}
  Add/Edit User Facility Allotment
{% endblock title %}
{% block content %}
  <a href="{% url 'common:user_facility_allotments' %}">&larr; Back</a>
{% if perms.common.change_userfacilityallotment %}

<div class="row">
  <div class="col-xl-10 col-lg-10 col-md-10 col-sm-12">
    <div class="row align-page-content">
      <div class="card-header">
        <div class="toolbar float-right">
          {% if object.pk %} {% if perms.common.delete_userfacilityallotment %}
          <a
            href="{% url 'common:user_facility_allotment_delete' object.pk %}"
            class="btn btn-danger btn-icon-split"
          >
            <span class="icon text-white-50">
              <i class="fas fa-trash"></i>
            </span>
            <span class="text">Delete User Facility Allotment</span>
          </a>
          {% endif %} {% endif %}
        </div>
      </div>

      <div class="row d-block">
        <div class="col-lg-2"></div>
        <div class="col-lg-8 center-form">
          <div class="p-lg-5 p-xs-1 p-sm-1">
            <div class="text-left">
              <h1 class="h4 text-gray-900 mb-4">
                {% if object.pk %}
                  Edit User Facility Allotment
                {% else %}
                  Create User Facility Allotment
                {% endif %}
              </h1>
            </div>
            {% crispy form %}
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

{% else %}
  <p>You do not have permission to edit user facility allotments.</p>
{% endif %}
{% endblock content %}
