{% extends "deliver_grant_funding/grant_base.html" %}
{% from "govuk_frontend_jinja/components/back-link/macro.html" import govukBackLink %}

{% set page_title = "Can submissions be reopened? - " ~ collection.name %}
{% set type_constants = collection.type.constants %}
{% set active_item_identifier = type_constants.active_nav %}

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

{% block content %}
  <div class="govuk-grid-row">
    <div class="govuk-grid-column-two-thirds">
      <span class="govuk-caption-l">{{ collection.name }}</span>
      <form method="post" novalidate>
        {{ form.csrf_token }}

        {{
          form.allow_submission_reopening(params={
            "fieldset": {"legend": {"text": form.allow_submission_reopening.label.text, "isPageHeading": true, "classes": "govuk-fieldset__legend--l"} },
            "items": [
              {
                "hint": {"text": "Grant policy team users can request or allow changes to submissions"},
              },
            ]
          })
        }}

        <div class="govuk-button-group">
          {{ form.submit }}
          <a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('deliver_grant_funding.collection_settings', grant_id=grant.id, collection_type=collection.type, collection_id=collection.id) }}">Cancel</a>
        </div>
      </form>
    </div>
  </div>
{% endblock content %}
