{% import 'macros/forms.html' as forms %} {% import 'macros/modal.html' as modal %} {% macro bacteria_add_form(form, endpoint, method, id, plasmid_id) %} {% if id == -1 %} {% set action = url_for(endpoint, plasmid_id=plasmid_id) %} {% set title = 'Add Glycerol Stock' %} {% else %} {% set action = url_for(endpoint, id_=id) %} {% set title = 'Edit Glycerol Stock' %} {% endif %} {% set modal_id = 'modal-edit-glycerol-stock-' ~ id %} {% set form_id = 'form-edit-glycerol-stock-' ~ id %} {% call modal.modal(id=modal_id, title=title) %}
{{ form.hidden_tag() }}
{{ forms.field_row(form.transformation_date, 'Transformed') }}
{{ forms.field_row(form.disposal_date, 'Disposed') }}
{{ forms.field_row(form.strain, 'Strain') }}
{{ forms.field_row(form.storage_place, 'Storage place') }}
{{ form.submit() }}
{{ forms.script_send_form( form=form, form_name=form_id, method=method, message_field=form_id ~ '-messages' ) }} {% endcall %} {% endmacro %}