{% extends "deliver_grant_funding/grant_base.html" %} {% from "govuk_frontend_jinja/components/back-link/macro.html" import govukBackLink %} {% from "deliver_grant_funding/macros/select_context_source_header_caption.html" import context_source_heading_caption %} {% from "deliver_grant_funding/macros/select_context_source_return_url.html" import context_source_return_url %} {% set page_title = "Select uploaded data set - " ~ db_form.title %} {% set type_constants = db_form.collection.type.constants %} {% set active_item_identifier = type_constants.active_nav %} {# FIXME: handle back link generation in the view #} {% set back_url = url_for("deliver_grant_funding.select_context_source", grant_id=grant.id, form_id=db_form.id) %} {# Set heading caption and cancel button to for what initiated the `add data` flow #} {% set heading_caption = context_source_heading_caption(add_context_data) %} {% set cancel_url = context_source_return_url(add_context_data, grant, db_form, enum) %} {% block beforeContent %} {{ govukBackLink({ "text": "Back", "href": back_url }) }} {% endblock beforeContent %} {% block content %}
{% if form.data_set.choices | length > 0 %} Question {{ heading_caption }}
{{ form.csrf_token }} {{ form.data_set(params={"fieldset": {"legend": {"text": form.data_set.label.text, "isPageHeading": true, "classes": "govuk-fieldset__legend--l"} } }) }} {{ form.submit(params={"text": "Select data set"}) }} Cancel
{% else %}

Question {{ heading_caption }} {{ form.data_set.label.text }}

There are no data sets to reference in this collection.

Cancel {% endif %}
{% endblock content %}