{% import 'macros/forms.html' as forms %} {% import 'macros/modal.html' as modal %} {% macro dilutions_add_form(form, endpoint, method, id, antibody_id) %} {% if id == -1 %} {% set action = url_for(endpoint, antibody_id=antibody_id) %} {% set title = 'Add Dilution' %} {% else %} {% set action = url_for(endpoint, id_=id, antibody_id=antibody_id) %} {% set title = 'Edit Dilution' %} {% endif %} {% set modal_id = 'modal-edit-dilution-' ~ id %} {% set form_id = 'form-edit-dilution-' ~ 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 %}