{% load i18n %}
{% load crispy_forms_tags %}
<div class="container">
    {{form|crispy}}
    <div class="heading-block text-center">
        <h2 class="fs-5">{% trans "Stela Formset" %}</h2>
    </div>
    <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">
            <div class="row">
                {{formset.empty_form|crispy}}
            </div>
        </div>
    </div>
    <div class="d-flex justify-content-between my-3">
        <button class="btn-clear" onclick="addFormset()" type="button"><i class="fa-solid fa-plus"></i> {% trans "Add" %}</button>
        <button class="btn-clear remove-formset" onclick="clearFormset()" type="button"><i class="fa-solid fa-minus"></i> {% trans "Remove" %}</button>
    </div> 
</div>
<p class="response-footer text-link fw-bold oxanium"></p>
<input type="hidden" name="form-id" value='{{form_name}}'>
<input type="hidden" name="formset_name" value='{{formset_name}}'>
<input type="hidden" name="model_parent" value='{{model_parent}}'>
<input type="hidden" name="model_child" value='{{model_child}}'>
{% if cke %}
    <input type="hidden" name="ckeditor" value="{{cke}}">
{% endif %}
{% if cke_formset %}
    <input type="hidden" name="ckeditor" value="{{cke_formset}}">
{% endif %}
{% if pk %}
    <input type="hidden" name="pk" value="{{pk}}">
{% endif %}
{% if schedule %}
    <input type="hidden" name="schedule" value="{{schedule}}">
{% endif %}
