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

{% set constants = submission_helper.collection.type.constants %}
{% set title_text = "Confirm sign off and submit " ~ constants.singular if submission_helper.collection.requires_certification else "Confirm and submit " ~ constants.singular %}
{% set action_text = "Confirm sign off and submit" if submission_helper.collection.requires_certification else "Confirm and submit" %}
{% set page_title = title_text ~ ": " ~ submission_helper.long_collection_name %}

{% set active_item_identifier = constants.active_nav %}

{% set return_link = url_for("access_grant_funding.route_to_submission", organisation_id=grant_recipient.organisation.id, grant_id=grant_recipient.grant.id, collection_id = submission_helper.collection_id) %}

{% block beforeContent %}
  {{ super() }}
  {{
    govukBackLink({
      "href": return_link,
      "text": "Back"
    })
  }}
{% endblock beforeContent %}

{% block content %}
  <div class="govuk-grid-row">
    <div class="govuk-grid-column-two-thirds">
      <h1 class="govuk-heading-l">{{ title_text }}</h1>
      <p class="govuk-body">You are submitting the {{ submission_helper.long_collection_name }} {{ constants.singular }} for {{ submission_helper.grant.name }}.</p>
      <p class="govuk-body">By submitting this {{ constants.singular }}, you confirm that the information provided in the {{ constants.singular }} is correct.</p>

      <form method="POST" novalidate>
        <div class="govuk-button-group">
          {{ form.csrf_token }}
          {{ form.submit(params={"text": action_text }) }}
          <a class="govuk-link govuk-link--no-visited-state" href="{{ return_link }}">Cancel</a>
        </div>
      </form>
    </div>
  </div>
{% endblock %}
