{% extends "deliver_grant_funding/grant_base.html" %} {% from "govuk_frontend_jinja/components/notification-banner/macro.html" import govukNotificationBanner %} {% from "govuk_frontend_jinja/components/summary-list/macro.html" import govukSummaryList %} {% from "govuk_frontend_jinja/components/button/macro.html" import govukButton %} {% from "deliver_grant_funding/macros/dependency_banner.html" import dependency_banner %} {% from "deliver_grant_funding/macros/question_table.html" import question_table %} {% from "deliver_grant_funding/macros/group_nesting_error_banner.html" import group_nesting_error_banner %} {% from "deliver_grant_funding/macros/deliver_grant_funding_collection_breadcrumb.html" import deliver_grant_funding_collection_breadcrumb %} {% set page_title = group.name ~ " - " ~ db_form.title %} {% set type_constants = db_form.collection.type.constants %} {% set active_item_identifier = type_constants.active_nav %} {% set grant_admin = authorisation_helper.is_deliver_grant_admin(grant.id, current_user) %} {% block beforeContent %} {% set parent_item = None %} {% if group.parent %} {% set parent_html %} Question group: {{ group.parent.name }} {% endset %} {% set parent_item={"html": parent_html, "href": url_for("deliver_grant_funding.list_group_questions", grant_id=grant.id, group_id=group.parent_id)} %} {% endif %} {{ deliver_grant_funding_collection_breadcrumb(grant=grant, collection=db_form.collection, form=db_form, immediate_parent_breadcrumb_item=parent_item,this_page_breadcrumb_item={"text":group.name}) }} {% endblock beforeContent %} {% block content %}
Are you sure you want to delete this question group?
{% endset %} {{ govukNotificationBanner(params={"role": "alert", "titleText": "Warning", "classes": "", "html": banner_html}) }} {% endif %}You cannot change the display type because this group has one or more nested groups.
{% endif %} {% if group.contains_add_another_components %}You cannot allow this question group to be answered more than once as it already contains one or more questions that can be answered more than once.
{% endif %} {% if group.contains_questions_depended_on_elsewhere %}You cannot allow this question group to be answered more than once as it contains questions that are depended on by other questions in this form.
{% endif %} {% if group.parent and group.parent.add_another_container %}You cannot allow this question group to be answered more than once as it is already contained in a group that can be answered more than once.
{% endif %}Customise the add another summary page by selecting how each response to this question group should be summarised or providing guidance on answering this question group multiple times.
{% set answer_summary_list_html %} {% if group.questions_in_add_another_summary | length %}A comma separated list including the answers to:
{{ interpolate(group.add_another_guidance_body, with_interpolation_highlighting=True) }}
{% else %}
(None set)
{% endif %}
{% endset %}
{{
govukSummaryList({
"rows": [{
"key": {"text": "Answer summary"},
"value": {"html": answer_summary_list_html},
"actions": {
"items": [{
"text": "Change",
"visuallyHiddenText": "add another response summary",
"href": url_for("deliver_grant_funding.change_group_add_another_summary", grant_id=grant.id, group_id=group.id)
}] if group.questions_in_add_another_summary else []
}
}, {
"key": {"text": "Guidance text"},
"value": {"html": guidance_text},
"actions": {
"items": [{
"text": "Change",
"visuallyHiddenText": "add another guidance text",
"href": url_for("deliver_grant_funding.manage_add_another_guidance", grant_id=grant.id, group_id=group.id)
}]
}
}]
})
}}
This question group has no questions.
{% else %} {{ question_table(group, interpolate, role_can_edit=grant_admin, enum=enum) }} {% endif %} {% if grant_admin %} {{ "Add another question" if group.cached_questions else "Add a question" }} {% if group.can_have_child_group and not group.presentation_options.show_questions_on_the_same_page %} {{ "Add a question group" }} {% endif %} {% if not group.can_have_child_group %}You cannot add a nested group because this group is already nested.
{% elif group.same_page %}You cannot add a nested group when display is set to show all questions on the same page.
{% endif %} {% endif %}Only add guidance if you need to give a longer explanation of how to answer the question group, or to format your content with paragraphs, headings, lists or links.
{% if group.guidance_body %} {% set guidance_text %}{{ interpolate(group.guidance_body, with_interpolation_highlighting=True) }}
{% endset %}
{{
govukSummaryList({
"rows": [
{"key": {"text": "Page heading"}, "value": {"text": group.guidance_heading}, "actions": {"items": [{"href": url_for('deliver_grant_funding.manage_guidance', grant_id=grant.id, question_id=group.id), "text": "Change", "visuallyHiddenText": "page heading"}] } },
{"key": {"text": "Guidance text"}, "value": {"html": guidance_text}, "actions": {"items": [{"href": url_for('deliver_grant_funding.manage_guidance', grant_id=grant.id, question_id=group.id), "text": "Change", "visuallyHiddenText": "guidance text"}] } },
]
})
}}
{% else %}
Add guidance
{% endif %}
Add conditions to only show this question group if the grant recipient has answered other questions in a particular way.
{% with component=group %} {% include 'deliver_grant_funding/partials/component-conditions-operator-table.html' %} {% endwith %} {% set rows = [] %} {% with component=group %} {% include 'deliver_grant_funding/partials/_implicit-conditions.html' %} {% endwith %} {% with component=group %} {% include 'deliver_grant_funding/partials/_explicit-conditions.html' %} {% endwith %} {% if rows %} {{ govukSummaryList({ "rows": rows, "classes": "app-tasklist-builder" }) }} {% endif %} {{ govukButton({ "text": "Add condition", "href": url_for('deliver_grant_funding.add_question_condition_select_calculation', grant_id=grant.id, component_id=group.id), "classes": "govuk-button--secondary", }) }}Add validations to show an error message if a calculation including at least one answer from the question group does not meet a requirement.
For example, validation to stop users from entering numbers that add up to more than a required amount.
{% set rows = [] %} {% with component=group %} {% include 'deliver_grant_funding/partials/_explicit-validations.html' %} {% endwith %} {% if rows %} {{ govukSummaryList({ "rows": rows, "classes": "app-tasklist-builder" }) }} {% endif %} {% if grant_admin %} {{ govukButton({ "text": "Add more validation" if group.validations else "Add validation", "href": url_for('deliver_grant_funding.add_group_validation', grant_id=grant.id, group_id=group.id), "classes": "govuk-button--secondary govuk-!-margin-bottom-3", }) }} {% endif %} {% else %} {# TODO: content review #}You can only add validations to a question group when questions are displayed on the same page. To add a validation, change the display setting to 'All questions on the same page'.
{% endif %}