{% import 'macros/form.html'as f with context %}
{% macro render_modal_window(id, endpoint_action, btn_class='primary',
                             btn_comfirm_text='OK', title_form='' ) %}
    <div class="modal fade" id="{{ id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
         aria-hidden="true">
        <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">{{ title_form }}</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    {{ caller() }}
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
                    {% call f.form_tag(endpoint_action, fid='modal-form', **kwargs) %}
                        <button type="button" class="btn btn-{{ btn_class }} sb-form">{{ btn_comfirm_text }}</button>
                    {% endcall %}
                </div>
            </div>
        </div>
    </div>
{% endmacro %}

