{% 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 = "Reports" %} {% set active_item_identifier = "reports" %} {% 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 report ‘{{ delete_report.name }}’?

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

{{ grant.name }} Reports

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

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

{% if not grant.reports %}

There are no monitoring reports for {{ grant.name }}.

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