{% import 'macros/forms.html' as forms %} {% import 'macros/modal.html' as modal %} {% macro requests_add_form(form, endpoint, method, id, entity_id) %} {% if id == -1 %} {% set action = url_for(endpoint, entity_id=entity_id) %} {% set title = 'Add Request' %} {% else %} {% set action = url_for(endpoint, id_=id) %} {% set title = 'Edit Request' %} {% endif %} {% set modal_id = 'modal-edit-request-' ~ id %} {% set form_id = 'form-edit-request-' ~ id %} {% call modal.modal(id=modal_id, title=title) %}
{{ forms.script_send_form( form=form, form_name=form_id, method=method, message_field=form_id ~ '-messages' ) }} {% endcall %} {% endmacro %}