{% extends "deliver_grant_funding/grant_base.html" %} {% from "govuk_frontend_jinja/components/back-link/macro.html" import govukBackLink %} {% from "govuk_frontend_jinja/components/notification-banner/macro.html" import govukNotificationBanner %} {% from "govuk_frontend_jinja/components/summary-list/macro.html" import govukSummaryList %} {% from "deliver_grant_funding/collections/_render_managed_expression_form.html" import render_managed_expression_form %} {% set type_constants = question.form.collection.type.constants %} {% set active_item_identifier = type_constants.active_nav %} {% set page_title = "Add validation - " ~ question.name %} {% block beforeContent %} {{ govukBackLink({ "text": "Back", "href": url_for("deliver_grant_funding.edit_question", grant_id=grant.id, question_id=question.id) }) }} {% endblock beforeContent %} {% block content %} {% set heading = "Edit validation" if expression else "Add validation" %} {% set submit_label = "Save validation" if expression else "Add validation" %}
{% if confirm_deletion_form %} {% set banner_html %}

Are you sure you want to delete this validation?

{{ confirm_deletion_form.csrf_token }} {{ confirm_deletion_form.confirm_deletion(params={"text": "Yes, delete this validation", "classes": "govuk-button--warning govuk-!-margin-bottom-0"}) }} Cancel
{% endset %} {{ govukNotificationBanner(params={"role": "alert", "titleText": "Warning", "classes": "", "html": banner_html}) }} {% endif %}

{{ heading }}

{{ govukSummaryList({ "rows": [ {"key": {"text": "Section"}, "value": {"text": question.form.title} }, {"key": {"text": "Question"}, "value": {"text": interpolate(question.text, with_interpolation_highlighting=True)} }, ], "classes": "app-!-border-top-line" }) }} {% if form is not none %} {% set label_html %} What does the answer to {{ interpolate(question.text) }} need to be? {% endset %} {{ render_managed_expression_form(form, label_html=label_html, submit_label=submit_label, grant_id=grant.id, question_id=question.id) }} {% if expression %}

Manage validation

Delete validation

{% endif %} {% else %}

This question cannot be validated.

{% endif %}
{% endblock content %}