{% import 'macros/forms.html' as forms %} {% import 'macros/modal.html' as modal %} {% macro preparations_add_form(form, endpoint, method, id, plasmid_id) %} {% if id == -1 %} {% set action = url_for(endpoint, plasmid_id=plasmid_id) %} {% set title = 'Add Preparation' %} {% else %} {% set action = url_for(endpoint, id_=id) %} {% set title = 'Edit Preparation' %} {% endif %} {% set modal_id = 'modal-edit-preparation-' ~ id %} {% set form_id = 'form-edit-preparation-' ~ id %} {% call modal.modal(id=modal_id, title=title) %}
{{ form.hidden_tag() }}
{{ forms.field_row(form.preparation_date, 'Prepared on') }}
{{ forms.field_row(form.emptied_date, 'Emptied on') }}
{{ forms.field_row(form.eluent, 'Eluent') }}
{{ forms.field_row(form.strain, 'Strain') }}
{{ forms.field_row(form.concentration, 'Concentration [ng/µl]') }}
{{ forms.field_row(form.storage_place, 'Storage place') }}
{{ forms.field_row(form.method, 'Method') }}
{{ form.submit() }}
{{ forms.script_send_form( form=form, form_name=form_id, method=method, message_field=form_id ~ '-messages' ) }} {% endcall %} {% endmacro %}