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

{% set type_constants = collection_type.constants %}
{% set page_title = type_constants.plural | uppercase_first %}
{% set active_item_identifier = type_constants.active_nav %}

{% block beforeContent %}
  {{
    govukBackLink({
      "text": "Back",
      "href": url_for(type_constants.list_endpoint, grant_id=grant.id),
    })
  }}
{% endblock %}

{% block content %}
  <div class="govuk-grid-row">
    <div class="govuk-grid-column-two-thirds">
      <span class="govuk-caption-l">{{ grant.name }}</span>
      <form method="post" novalidate>
        {{ form.csrf_token }}
        {{ form.method(params={"fieldset": {"legend": {"text": form.method.label.text, "isPageHeading": true, "classes": "govuk-fieldset__legend--l"} } }) }}

        <div class="govuk-button-group">
          {{ form.submit }}
          <a class="govuk-link govuk-link--no-visited-state" href="{{ url_for(type_constants.list_endpoint, grant_id=grant.id) }}">Cancel</a>
        </div>
      </form>
    </div>
  </div>
{% endblock content %}
