{% extends "deliver_grant_funding/base.html" %}
{% from "govuk_frontend_jinja/components/summary-list/macro.html" import govukSummaryList %}

{% set page_title = "Check your answers" %}
{% set active_item_identifier = "grants" %}

{% block content %}
  <div class="govuk-grid-row">
    <span class="govuk-caption-l">Set up the grant</span>
    <h1 class="govuk-heading-l">Check your answers</h1>

    {{
      govukSummaryList({
        "rows": [
          {
            "key": {"text": "GGIS reference number"},
            "value": {"text": grant_session.ggis_number},
            "actions": {
              "items": [{
                "href": url_for("deliver_grant_funding.grant_setup_ggis", source=check_your_answers_source),
                "classes": "govuk-link--no-visited-state",
                "text": "Change",
                "visuallyHiddenText": "GGIS reference number"
              }]
            }
          },
          {
            "key": {"text": "Grant name"},
            "value": {"text": grant_session.name},
            "actions": {
              "items": [{
                "href": url_for("deliver_grant_funding.grant_setup_name", source=check_your_answers_source),
                "classes": "govuk-link--no-visited-state",
                "text": "Change",
                "visuallyHiddenText": "grant name"
              }]
            }
          },
          {
            "key": {"text": "Grant code"},
            "value": {"text": grant_session.code},
            "actions": {
              "items": [{
                "href": url_for("deliver_grant_funding.grant_setup_code", source=check_your_answers_source),
                "classes": "govuk-link--no-visited-state",
                "text": "Change",
                "visuallyHiddenText": "grant code"
              }]
            }
          },
          {
            "key": {"text": "Main purpose"},
            "value": {"text": grant_session.description},
            "actions": {
              "items": [{
                "href": url_for("deliver_grant_funding.grant_setup_description", source=check_your_answers_source),
                "classes": "govuk-link--no-visited-state",
                "text": "Change",
                "visuallyHiddenText": "main purpose"
              }]
            }
          },
          {
            "key": {"text": "Main contact"},
            "value": {"html": grant_session.primary_contact_name + "<br>" + grant_session.primary_contact_email},
            "actions": {
              "items": [{
                "href": url_for("deliver_grant_funding.grant_setup_contact", source=check_your_answers_source),
                "classes": "govuk-link--no-visited-state",
                "text": "Change",
                "visuallyHiddenText": "main contact"
              }]
            }
          }
        ]
      })
    }}

    <form method="post" novalidate>
      {{ form.csrf_token }}
      {{ form.submit(params={"text": "Confirm and set up grant"}) }}
    </form>
  </div>
{% endblock %}
