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

{% set page_title = "Add a question group - " ~ db_form.title %}
{% set type_constants = db_form.collection.type.constants %}
{% set active_item_identifier = type_constants.active_nav %}
{% set link = url_for("deliver_grant_funding.list_section_questions", grant_id=grant.id, form_id=db_form.id) if not parent else url_for('deliver_grant_funding.list_group_questions', grant_id=grant.id, group_id=parent.id) %}

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

{% block content %}
  <div class="govuk-grid-row">
    <div class="govuk-grid-column-two-thirds">
      <span class="govuk-caption-l">{{ grant.name }}</span>
      <h1 class="govuk-heading-l">What is the name of the question group?</h1>
      <p class="govuk-body">Use question groups to show or hide related questions together or show questions on the same page.</p>

      <form method="post" novalidate>
        {{ form.csrf_token }}
        {{ form.name(params={"label": {"classes": "govuk-visually-hidden"} }) }}

        <div class="govuk-button-group">
          {{ form.submit(params={"text": "Continue"}) }}
          <a class="govuk-link govuk-link--no-visited-state" href="{{ link }}">Cancel</a>
        </div>
      </form>
    </div>
  </div>
{% endblock content %}
