{% extends 'tom_common/base.html' %} {% load bootstrap4 crispy_forms_tags static tom_education_extras %} {% block title %}Submit Observation{% endblock %} {% block content %}

↵ {{ target.name }}

Submit an observation to {{ form.facility.value }}

{% if templates %} Create from template: {% for name, url in templates %} {{ name }}{% if not forloop.last %},{% endif %} {% endfor %} {% endif %}

{% if form.facility.value != 'LCO' %} {% crispy form %} {% else %} {# Render the LCO form 'by hand' instead of with crispy for more flexibility over the layout #} {% csrf_token %} {% bootstrap_form_errors form %} {{ form.facility }} {{ form.target_id }} {{ form.observation_type }}
{% bootstrap_field form.name %} {% bootstrap_field form.proposal %} {% bootstrap_field form.ipp_value %} {% bootstrap_field form.observation_mode %}
{% bootstrap_field form.instrument_type %} {% bootstrap_field form.max_airmass %} {% bootstrap_field form.start %} {% bootstrap_field form.end %}
{% endif %}

Filters

{% for filter_code, filter_name, keys in filter_fields %} {% for key in keys %} {% endfor %} {% endfor %}
Exposure count Exposure time
{{ filter_name }} {% bootstrap_field form|get_form_field:key show_label=False placeholder="" %}
{% buttons %} {# Show submit button if we are not using crispy #} {% if form.facility.value == 'LCO' %} {# TODO: make submit and create-new buttons appear side-by-side #} {# with crispy (non-LCO) form, instead of in separate
s #} {% bootstrap_button "Submit" button_type="submit" button_class="btn-primary" %} {% endif %} {% if show_new_template_action %} {% with new_template_action_button as b %} {% bootstrap_button b.1 button_type="submit" name=b.0 %} {% endwith %} {% endif %} {% endbuttons %} {# For the LCO form, include JavaScript to filter 'filters' based on the selected instrument #} {% if instrument_filters %} {% endif %} {% endblock %}