{% extends "admin/master.html" %}
{% import 'admin/layout.html' as layout with context %}
{% from "govuk_frontend_jinja/components/back-link/macro.html" import govukBackLink %}
{% from 'govuk_frontend_jinja/components/error-summary/macro.html' import govukErrorSummary %}

{% block beforeContent %}
  {{ govukBackLink({"text": "Back", "href": url_for('collection_lifecycle.tasklist', grant_id=grant.id, collection_id=collection.id) }) }}
{% endblock %}

{% block action_panel %}
  <div class="govuk-grid-row">
    <div class="govuk-grid-column-two-thirds">
      {{ layout.messages() }}

      {% if form.errors %}
        {{ govukErrorSummary(wtforms_errors(form)) }}
      {% endif %}

      <h1 class="govuk-heading-l">
        <span class="govuk-caption-l">{{ collection.name }}</span>
        {{ title }}
      </h1>

      <form method="post" novalidate>
        {{ form.csrf_token }}

        {{ form.reporting_period_start_date }}
        {{ form.reporting_period_end_date }}
        {{ form.submission_period_start_date }}
        {{ form.submission_period_end_date }}

        {{ form.submit }}
      </form>
    </div>
  </div>
{% endblock %}
