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

{% set page_title = "Do submissions require certification? - " ~ 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.requires_certification(params={
            "fieldset": {"legend": {"text": form.requires_certification.label.text, "isPageHeading": true, "classes": "govuk-fieldset__legend--l"} },
            "hint": {"text": "Certification requires a certifier (like a Section 151 officer) to sign off a " ~ type_constants.singular ~ " before it's submitted."},
          })
        }}

        <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 %}
