{% from "common/macros/submissions.html" import submission_answers with context %}

<div class="govuk-grid-row">
  <div class="govuk-grid-column-one-quarter-from-desktop app-section-nav-container">
    <nav aria-label="{{ constants.singular | capitalize }} sections">
      <ul class="govuk-list app-section-nav-list">
        <li class="app-section-nav-list__item app-section-nav-list__item--active">
          <a class="govuk-link govuk-link--no-visited-state" href="#collection-response">Submission responses</a>
        </li>
        {% for form in helper.get_ordered_visible_forms() %}
          <li class="app-section-nav-list__item">
            <a class="govuk-link govuk-link--no-visited-state" href="#form-{{ form.id }}">{{ form.title }}</a>
          </li>
        {% endfor %}
      </ul>
    </nav>
  </div>
  <div class="govuk-grid-column-three-quarters-from-desktop">
    <h2 id="collection-response" class="govuk-heading-m">Submission responses</h2>
    <p class="govuk-body">View all responses to the {{ helper.submission.collection.name }} by {{ helper.submission.grant_recipient.organisation.name if helper.submission.grant_recipient else helper.submission.created_by.email }}.</p>
    <a class="govuk-button govuk-button--secondary" href="{{ url_for('deliver_grant_funding.export_submission_pdf', grant_id=helper.collection.grant_id, submission_id=helper.submission.id) }}">Download responses as PDF</a>

    {{ submission_answers(helper, should_show_answers_diff=helper.is_submitted) }}
  </div>
</div>
