{% extends "access_grant_funding/base.html" %} {% from "govuk_frontend_jinja/components/table/macro.html" import govukTable %} {% from "common/macros/status.html" import submissionStatusTag with context %} {% from "common/macros/status.html" import multiSubmissionStatusTag with context %} {% from "govuk_frontend_jinja/components/notification-banner/macro.html" import govukNotificationBanner %} {% set page_title = "Forms" %} {% set active_item_identifier = "pre_award" %} {% block content %}
{% with flashes = get_flashed_messages(category_filter=[enum.flash_message_type.SUBMISSION_SIGN_OFF_DECLINED]) %} {% if flashes %} {% set submission_declined_html %}

{{ flashes[0]["collection_type_singular"] | uppercase_first }} declined

{{ flashes[0]["collection_name"] }} {{ flashes[0]["collection_type_singular"] }} for {{ flashes[0]["grant_name"] }} sign off declined and sent back to {{ flashes[0]["sent_for_certification_by"] }}. View {{ flashes[0]["collection_type_singular"] }}

{% endset %} {{ govukNotificationBanner({ "html": submission_declined_html, "type":"success", "titleText": "Confirmed" }) }} {% endif %} {% endwith %}

Forms

{% if pre_award_forms|length > 0 %}

Grant funding

View and complete forms relating to grant funding. These may include forms to apply for, express interest for, or accept grant funding.

{{ collections_table(pre_award_forms, enum.collection_type_enum.APPLICATION) }}
{% endif %}

Monitoring reports

View and complete monitoring reports if you have been successful for grant funding.

{% if monitoring_reports|length == 0 %}

There are no reports for this grant.

{% else %} {{ collections_table(monitoring_reports, enum.collection_type_enum.MONITORING_REPORT) }} {% endif %}
{% endblock %} {% macro collections_table(collections, section_collection_type) %} {% set rows=[] %} {% for collection in collections %} {% set collection_name = collection.name or (format_date_range_short(collection.reporting_period_start_date, collection.reporting_period_end_date) if (collection.reporting_period_start_date and collection.reporting_period_end_date) else "Dates to be confirmed") %} {% set collection_submissions = submissions | selectattr("collection_id", "equalto", collection.id) | list %} {% set collection_helper = collection_helpers | selectattr("id", "equalto", collection.id) | list | first %} {% if collection.allow_multiple_submissions %} {% set submission_status_html %} {{ multiSubmissionStatusTag(collection_submissions, collection_helper, collection.is_overdue) }} {% endset %} {% set collection_action_html %} Go to {{ collection.type.constants.plural }} for {{ collection_name }} {% endset %} {% do rows.append([ {"text": collection_name}, {"text": format_date_short(collection.submission_period_end_date) if collection.submission_period_end_date else "Dates to be confirmed"}, {"html": submission_status_html}, {"html": collection_action_html} ]) %} {% else %} {% set submission = (collection_submissions | first) if collection_submissions else none %} {% set submission_status = SubmissionHelper.get_status(submission.submission, collection) %} {% set submission_status_html %} {{ submissionStatusTag(submission_status, submission.submission.is_overdue if submission else collection.is_overdue) }} {% endset %} {% set collection_action_config = SubmissionHelper.get_access_submission_action(collection, grant_recipient, submission.submission) %} {% set collection_action_html %} {% if collection_action_config.href %} {{ collection_action_config.label }} for {{ collection_name }} {% elif collection_action_config.label %} {{ collection_action_config.label }} {% endif %} {% endset %} {# todo: standardise this behaviour everywhere by adding this logic as a property on the model if its signed off #} {% do rows.append([ {"text": collection_name}, {"text": format_date_short(collection.submission_period_end_date) if collection.submission_period_end_date else "Dates to be confirmed"}, {"html": submission_status_html}, {"html": collection_action_html} ]) %} {% endif %} {% endfor %} {% set actions_html %} Actions {% endset %} {{ govukTable(params={ "firstCellIsHeader": false, "head":[ {"text": section_collection_type.constants.plural | uppercase_first}, {"text": "Due date"}, {"text": "Status"}, {"html": actions_html} ], "rows":rows }) }} {% endmacro %}