{% extends base_template %}
{% load helpers %}

{% block extra_controls %}
    {% if perms.tenancy.add_contactassignment %}
    <a href="{% url 'tenancy:contactassignment_add' %}?content_type={{ object|content_type_id }}&object_id={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm">
        <i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add a contact
    </a>
  {% endif %}
{% endblock %}

{% block content %}
    {% include 'inc/table_controls_htmx.html' with table_modal="ContactAssignmentTable_config" %}
    <form method="post">
        {% csrf_token %}
        <div class="card">
            <div class="card-body" id="object_list">
                {% include 'htmx/table.html' %}
            </div>
        </div>
    </form>
{% endblock content %}

{% block modals %}
    {{ block.super }}
    {% table_config_form table %}
{% endblock modals %}
