{% extends "deliver_grant_funding/grant_base.html" %} {% from "deliver_grant_funding/macros/deliver_grant_funding_collection_breadcrumb.html" import deliver_grant_funding_collection_breadcrumb %} {% from "govuk_frontend_jinja/components/notification-banner/macro.html" import govukNotificationBanner %} {% from "deliver_grant_funding/macros/dependency_banner.html" import dependency_banner %} {% from "deliver_grant_funding/macros/dependency_banner.html" import section_component_dependency_banner %} {% from "deliver_grant_funding/macros/question_table.html" import question_table %} {% set type_constants = db_form.collection.type.constants %} {% set page_title = db_form.title %} {% set active_item_identifier = type_constants.active_nav %} {% set can_edit = authorisation_helper.can_edit_collection(current_user, db_form.collection_id) %} {% set form_has_questions = db_form.cached_questions | length > 0 %} {% set collection_has_data_sources = db_form.collection.data_sources | length > 0 %} {% set preview_blocked_by_data_sources = collection_has_data_sources and form_has_questions %} {% set can_preview = form_has_questions and not collection_has_data_sources and db_form.collection.status != enum.collection_status.CLOSED %} {% block beforeContent %} {{ deliver_grant_funding_collection_breadcrumb(grant=grant, collection=db_form.collection, this_page_breadcrumb_item={"text":db_form.title}) }} {% endblock beforeContent %} {% block content %}
{% with flashes = get_flashed_messages(category_filter=[enum.flash_message_type.SUBMISSION_TESTING_COMPLETE.value]) %} {% if flashes %} {{ govukNotificationBanner(params={"titleText": "Preview complete", "text": flashes[0]}) }} {% endif %} {% set errors = None %} {% endwith %} {% with flashes = get_flashed_messages(category_filter=[enum.flash_message_type.SECTION_COMPONENT_DEPENDENCY_ERROR.value]) %} {% if flashes %} {{ section_component_dependency_banner(flashes[0], interpolate=interpolate) }} {% endif %} {% endwith %} {% if delete_form %} {% set banner_html %}

Are you sure you want to delete this section?

{{ delete_form.csrf_token }}
{{ delete_form.confirm_deletion(params={"text": "Yes, delete this section", "classes": "govuk-button--warning govuk-!-margin-bottom-0"}) }} Cancel
{% endset %} {{ govukNotificationBanner(params={"role": "alert", "titleText": "Important", "classes": "", "html": banner_html}) }} {% endif %} {% with flashes = get_flashed_messages(category_filter=[enum.flash_message_type.DEPENDENCY_ORDER_ERROR.value]) %} {% if flashes %} {{ dependency_banner(flashes[0], interpolate=interpolate) }} {% endif %} {% endwith %}

{{ db_form.title }}

{% if preview_blocked_by_data_sources and db_form.collection.status != enum.collection_status.CLOSED %}

You cannot preview sections in this {{ type_constants.singular }} because it requires uploaded data.

{% endif %}
{% if can_preview %}
{{ form.csrf_token }} {{ form.submit(params={"text": "Preview section", "classes": "govuk-button--secondary" }) }}
{% endif %}

Questions

{% if not db_form.cached_all_components %}

This section has no questions.

{% else %} {{ question_table(db_form, interpolate, role_can_edit=can_edit, enum=enum) }} {% endif %} {% if can_edit %} {% endif %}
{% if can_edit %}

Manage section

{% endif %}
{% endblock content %}