{% extends "deliver_grant_funding/grant_base.html" %} {% from "govuk_frontend_jinja/components/button/macro.html" import govukButton %} {% from "govuk_frontend_jinja/components/notification-banner/macro.html" import govukNotificationBanner %} {% from "common/macros/status.html" import grantStatusTag with context %} {% from "common/macros/status.html" import grantStatusDescription with context %} {% from "deliver_grant_funding/macros/collection_card.html" import collection_card with context %} {% set page_title = "Forms" %} {% set active_item_identifier = "pre_award" %} {% set grant_admin = authorisation_helper.is_deliver_grant_admin(grant.id, current_user) %} {% block content %}
{# TODO: FSPT-549 - show flash messages consistently everywhere with a standard interface #} {% with flashes = get_flashed_messages(with_categories=true) %} {% for category, message in flashes %} {% if category == enum.flash_message_type.COLLECTION_CREATED %} {% set banner_html %}

{{ (message.name ~ " " ~ message.singular ~ " created") | uppercase_first }}

View your {{ message.name }} {{ message.singular }}.

{% endset %} {{ govukNotificationBanner({ "html": banner_html, "type": "success" }) }} {% else %} {{ govukNotificationBanner({ "text": message, "type": category }) }} {% endif %} {% endfor %} {% endwith %} {% if delete_form %} {% set banner_html %}

Are you sure you want to delete the form ‘{{ delete_pre_award_form.name }}’?

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

{{ grant.name }} Forms

Grant status: {{ grantStatusTag(grant.status) }}

{{ grantStatusDescription(grant, enum.collection_type_enum.APPLICATION) }}

{% if not grant.pre_award_forms %}

There are no pre-award forms for {{ grant.name }}.

{% else %} {% for form in grant.pre_award_forms %} {{ collection_card(form) }} {% endfor %} {% endif %} {% if grant_admin %} {{ govukButton({ "text": "Create a form" if not grant.pre_award_forms else "Create another form", "classes": "" if not grant.pre_award_forms else "govuk-button--secondary", "href": url_for('deliver_grant_funding.choose_collection_creation_method', grant_id=grant.id, collection_type=enum.collection_type_enum.APPLICATION) }) }} {% endif %}
{% endblock content %}