{% from "govuk_frontend_jinja/components/notification-banner/macro.html" import govukNotificationBanner %} {% macro dependency_banner(error, interpolate) %} {% set question_link = url_for("deliver_grant_funding.edit_question", grant_id=error.grant_id, question_id=error.question_id) if not error.question_is_group else url_for("deliver_grant_funding.list_group_questions", grant_id=error.grant_id, group_id=error.question_id) %} {% set depends_on_link = url_for("deliver_grant_funding.edit_question", grant_id=error.grant_id, question_id=error.depends_on_question_id) if not error.depends_on_question_is_group else url_for("deliver_grant_funding.list_group_questions", grant_id=error.grant_id, group_id=error.depends_on_question_id) %} {% set banner_html %}
{{ error.message }}
{{ "Question group" if error.question_is_group else "Question" }}: {{ interpolate(error.question_text) }}
Depends on the answer to: {{ interpolate(error.depends_on_question_text) }}
{% if "depends_on_items_text" in error %}Depends on the options: {{ interpolate(error.depends_on_items_text) }}
{% endif %} {% endset %} {{ govukNotificationBanner(params={"role": "alert", "titleText": "Error", "classes": "app-notification-banner--destructive", "html": banner_html}) }} {% endmacro %} {% macro section_dependency_banner(error) %} {% set question_link = url_for("deliver_grant_funding.list_section_questions", grant_id=error.grant_id, form_id=error.form_id) %} {% set depends_on_link = url_for("deliver_grant_funding.list_section_questions", grant_id=error.grant_id, form_id=error.depends_on_form_id) %} {% set banner_html %}{{ error.message }}
Section: {{ error.form_title }}
Depends on answers in section: {{ error.depends_on_form_title }}
{% endset %} {{ govukNotificationBanner(params={"role": "alert", "titleText": "Error", "classes": "app-notification-banner--destructive", "html": banner_html}) }} {% endmacro %} {% macro section_component_dependency_banner(error, interpolate) %} {% set banner_html %}{{ error.message }}:
Delete the other section references to delete this section.
{% endset %} {{ govukNotificationBanner(params={"role": "alert", "titleText": "Error", "classes": "app-notification-banner--destructive", "html": banner_html}) }} {% endmacro %}