{% load i18n %}
{% load crispy_forms_tags %}     
<div id="formset">
    {{ formset.management_form }}
        {% for form in formset %}
        <div id="form-0" class="formset pt-2">
            {{form|crispy}}
        </div>
        {% endfor %}
    <div id="empty-form" class="d-none">
        {{formset.empty_form|crispy}}
    </div>
</div>
<div class="d-flex justify-content-between my-3">
    {% if schedule %}
        <button class="btn-clear" type="button" onclick="addDateFormset()"><i class="fa-solid fa-plus"></i> {% trans " Add" %}</button>
        <button class="btn-clear" type="button" onclick="clearDateFormset()"><i class="fa-solid fa-minus"></i> {% trans "Remove" %}</button>
    {% else %}
        <button class="btn-clear" type="button" onclick="addFormset()"><i class="fa-solid fa-plus"></i> {% trans " Add" %}</button>
        <button class="btn-clear" type="button" onclick="clearFormset()"><i class="fa-solid fa-minus"></i> {% trans "Remove" %}</button>
    {% endif %}
    
</div>
<input type="hidden" name="form-id" value="{{form_name}}">
{% if pk %}
    <input type="hidden" name="pk" value="{{pk}}">
{% endif %}
{% if user_id %}
    <input type="hidden" name="user_id" value="{{user_id}}">
{% endif %}
{% if model_parent %}
    <input type="hidden" name="model_parent" value="{{model_parent}}">
{% endif %}
{% if model_child %}
    <input type="hidden" name="model_child" value="{{model_child}}">
{% endif %}
{% if schedule %}
    <input type="hidden" name="schedule" value="{{schedule}}">
{% endif %}
