{% extends "deliver_grant_funding/grant_base.html" %} {% from "govuk_frontend_jinja/components/back-link/macro.html" import govukBackLink %} {% from "govuk_frontend_jinja/components/summary-list/macro.html" import govukSummaryList %} {% from "govuk_frontend_jinja/components/notification-banner/macro.html" import govukNotificationBanner %} {% from "deliver_grant_funding/macros/render_calculated_form_fields.html" import render_calculated_condition_custom_expression_field with context %} {% set type_constants = component.form.collection.type.constants %} {% set active_item_identifier = type_constants.active_nav %} {% if expression %} {% set heading = "Edit a calculated condition" %} {% set submit_label = "Save calculated condition" %} {% set back_link = url_for("deliver_grant_funding.edit_question", grant_id=grant.id, question_id=component.id) if not component.is_group else url_for("deliver_grant_funding.list_group_questions", grant_id=grant.id, group_id=component.id) %} {% else %} {% set heading = "Create a calculated condition" %} {% set submit_label = "Add calculated condition" %} {% set back_link= url_for("deliver_grant_funding.add_question_condition_select_calculation", grant_id=grant.id, component_id=component.id) %} {% endif %} {% set page_title = heading ~ " - " ~ component.name %} {% block beforeContent %} {{ govukBackLink({ "text": "Back", "href": back_link }) }} {% endblock beforeContent %} {% block content %}
{% if confirm_deletion_form %} {% set banner_html %}

Are you sure you want to delete this condition?

{{ confirm_deletion_form.csrf_token }} {{ confirm_deletion_form.confirm_deletion(params={"text": "Yes, delete this condition", "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": component.form.title} }, { "key": { "text": "This question" if not component.is_group else "This group" }, "value": { "text": interpolate(component.text) }, }, ], "classes": "app-!-border-top-line"}) }}
{{ form.csrf_token }} {{ form.expression_name(params={ "hint":{"text":'A brief description of what the calculated answer must be to meet the condition. For example, the ' + ('question' if not component.is_group else 'group') + ' is shown when “Capital and revenue spend are more than the funding amount”.'}, "label": {"classes": "govuk-!-font-weight-bold"},}) }} {{ render_calculated_condition_custom_expression_field(form, component.is_group) }} {{ form.submit(params={"text": submit_label, "classes": "govuk-!-margin-top-6"}) }}
{% if expression %}

Manage condition

Delete condition

{% endif %} {% endblock content %}