{% extends base_template|default:"handyhelpers_base.htm" %}
{% load staticfiles %}

{% block local_head %}
    {% include "handyhelpers/component/table_components.htm" %}
{% endblock %}

{% block content %}
    <div class="container-fluid animated fadeIn mb-5">
        <h1><span class="text-primary"><b>{{ title }}:</b></span> {% if sub_title %}<span class="text-secondary"><small><small>{{ sub_title }}</small></small></span>{% endif %}</h1>

        {# To include a create form, exposed via modal, include create_form (dict) in the context of your view. The create_from must include modal_name and link_title fields #}
        {% if create_form %}
        <div class="text-right"><a href="#" data-toggle="modal" data-target="#modal_{{ create_form.modal_name }}"><i class="fas fa-plus-circle mr-2"></i>{{ create_form.link_title }}</a></div>
        {% endif %}

        {% include table %}
    </div>

    {% include 'handyhelpers/component/modals.htm' %}

    {# include generic modal form for the create <object> form if passed from the view #}
    {% with create_form as form_data %}
        {% include 'handyhelpers/generic/generic_modal_form.htm' %}
    {% endwith %}

    {# include custom modal html/js template if passed in from the view #}
    {% if modals %}
        {% include modals %}
    {% endif %}

{% endblock %}
