{% from "govuk_frontend_jinja/components/back-link/macro.html" import govukBackLink %}
{% from "common/macros/status.html" import submissionStatusTag with context %}
{% from "common/macros/collections.html" import collection_tasklist with context %}
{% extends "deliver_grant_funding/runner/base.html" %}

{% set page_title = "Collection for " ~ runner.submission.name %}

{% set form = runner.tasklist_form %}

{% block beforeContent %}
  {# the top level back behaviour is likely context specific #}
  {{
    govukBackLink({
        "text": "Back",
        "href": url_for("deliver_grant_funding.list_collection_sections", grant_id=runner.submission.grant.id, collection_type=runner.submission.collection.type, collection_id=runner.submission.collection.id)
    })
  }}
{% endblock beforeContent %}

{% block content %}
  <div class="govuk-grid-row">
    <div class="govuk-grid-column-two-thirds">
      <h1 class="govuk-heading-l">{{ runner.submission.name }}</h1>

      <dl class="app-metadata govuk-!-margin-bottom-7">
        <dt class="app-metadata__key">Status:</dt>
        <dd class="app-metadata__value" data-testid="submission-status">{{ submissionStatusTag(runner.submission.status, runner.submission.submission.is_overdue) }}</dd>
      </dl>
    </div>
  </div>

  {{ collection_tasklist(runner) }}
{% endblock content %}
