{% load i18n ui help %}{% comment %} The form of one input of the Inputs panel (#198, #199): only that input's fields, what applying will update, then one primary button, Apply, and Cancel. In a side sheet (stations/_input_sheets.html, ``in_sheet``) Cancel closes it; on its own page (stations/input_edit.html) Cancel returns to ``next``. The body scrolls between the header and the foot, so Apply stays in view however long the form (the index settings). The station's fields are checked as they change, as on the first visit (stations/_unit.html), and so are the index settings (stations/_indices_unit.html). Context: analysis, sheet (views.sheet_context: key, title, intro, form, impact, settings_source), next, form_id, in_sheet; action (optional: where the form is sent, a workspace's setting, #234) and workspace_level (its base period is not checked against one station's data). {% endcomment %}
{% csrf_token %}

{{ sheet.intro }}

{% include "components/form_errors.html" with form=sheet.form %} {% if sheet.key == "file" %} {% include "components/dropzone.html" with field=sheet.form.station_file hint="" %} {% elif sheet.key == "station" %} {% include "stations/_unit.html" with group="station_name" form=sheet.form %}
{% include "stations/_unit.html" with group="latitude" form=sheet.form %} {% include "stations/_unit.html" with group="longitude" form=sheet.form %}
{% elif sheet.key == "base-period" %} {% if workspace_level %}{% include "stations/_unit.html" with group="base_period" form=sheet.form analysis=None %}{% else %}{% include "stations/_unit.html" with group="base_period" form=sheet.form %}{% endif %} {% elif sheet.key == "thresholds" %} {% section_help "quality.thresholds" inline=True %}
{% for field in sheet.form %} {% include "components/field.html" with field=field unit=field.field.unit narrow=True %} {% endfor %}
{% elif sheet.key == "settings" %} {% include "stations/_settings_fields.html" with form=sheet.form settings_source=sheet.settings_source heading=in_sheet|yesno:"h3,h2" %} {% endif %}
{% icon "refresh" %}

{% for sentence in sheet.impact %}{% if forloop.first %}{{ sentence }}{% else %} {{ sentence }}{% endif %}{% endfor %}

{% turnstile %}
{% translate "Apply" as apply_label %} {% include "components/button.html" with label=apply_label type="submit" describedby=form_id|add:"-impact" %} {% translate "Cancel" as cancel_label %} {% if in_sheet %} {% else %}{% include "components/button.html" with label=cancel_label href=next variant="ghost" %}{% endif %}