{# TODO: replace view_submission.html with this feature flagged implementation when flag is removed #} {% from "deliver_grant_funding/macros/deliver_grant_funding_collection_breadcrumb.html" import deliver_grant_funding_collection_breadcrumb %} {% from "common/partials/mhclg-test-banner.html" import mhclgInlinePageTestDataBanner %} {% from "common/macros/status.html" import submissionStatusTag, assessmentStatusTag with context %} {% from 'common/govuk/tabs/macro.html' import govukTabs %} {% from "govuk_frontend_jinja/components/notification-banner/macro.html" import govukNotificationBanner %} {% from "govuk_frontend_jinja/components/button/macro.html" import govukButton %} {% from "govuk_frontend_jinja/components/summary-list/macro.html" import govukSummaryList %} {% extends "deliver_grant_funding/grant_base.html" %} {% set page_title = "Submission - " ~ helper.long_collection_name %} {% set type_constants = helper.submission.collection.type.constants %} {% set active_item_identifier = type_constants.active_nav %} {% block beforeContent %} {% if helper.is_test %} {{ mhclgInlinePageTestDataBanner("Test submission") }} {% endif %} {{ deliver_grant_funding_collection_breadcrumb(grant=grant, collection=helper.submission.collection, immediate_parent_breadcrumb_item={"text": "Submissions", "href": url_for("deliver_grant_funding.list_submissions", grant_id=grant.id, collection_type=helper.submission.collection.type, collection_id=helper.submission.collection.id, submission_mode=helper.submission.mode)}, this_page_breadcrumb_item={"text": helper.submission.grant_recipient.organisation.name if helper.submission.grant_recipient else helper.submission.created_by.email }) }} {% endblock beforeContent %} {% set formResponsesTabPanel %} {% include "deliver_grant_funding/partials/_submission_responses_tab_panel.html" %} {% endset %} {% set timelineTabPanel %} {% include "deliver_grant_funding/partials/_timeline_tab_panel.html" %} {% endset %} {% block content %}
{% with flashes = get_flashed_messages(category_filter=[enum.flash_message_type.SUBMISSION_REOPENED]) %} {% if flashes %} {% set submission_reopened_html %}

Submission reopened and email sent to {{ helper.submission.grant_recipient.organisation.name if helper.submission.grant_recipient else helper.submission.created_by.email }}

Email sent to {{ helper.submission.grant_recipient.organisation.name ~ " users" if helper.submission.grant_recipient else helper.submission.created_by.email }} with your reason for reopening.

{% endset %} {{ govukNotificationBanner({ "html": submission_reopened_html, "type":"success", "titleText": "Success" }) }} {% endif %} {% endwith %} {% with flashes = get_flashed_messages(category_filter=[enum.flash_message_type.SUBMISSION_CHANGES_REQUESTED]) %} {% if flashes %} {% set changes_requested_html %}

Changes have been requested

We've emailed {{ helper.submission.grant_recipient.organisation.name if helper.submission.grant_recipient else helper.submission.created_by.email }} to let them know what changes have been requested.

{% endset %} {{ govukNotificationBanner({ "html": changes_requested_html, "type":"success", "titleText": "Success" }) }} {% endif %} {% endwith %} {% with flashes = get_flashed_messages(category_filter=[enum.flash_message_type.SUBMISSION_MARKED_AS_APPROVED]) %} {% if flashes %} {% set marked_approved_html %}

Submission marked as approved

This decision has been saved for internal records and is only visible to users within the {{ helper.submission.grant_recipient.organisation.name if helper.submission.grant_recipient else helper.submission.created_by.email }}.

{% endset %} {{ govukNotificationBanner({ "html": marked_approved_html, "type": "success", "titleText": "Success" }) }} {% endif %} {% endwith %} {% with flashes = get_flashed_messages(category_filter=[enum.flash_message_type.SUBMISSION_MARKED_AS_REJECTED]) %} {% if flashes %} {% set marked_rejected_html %}

Submission marked as rejected

This decision has been saved for internal records and is only visible to users within the {{ helper.submission.grant_recipient.organisation.name if helper.submission.grant_recipient else helper.submission.created_by.email }}.

{% endset %} {{ govukNotificationBanner({ "html": marked_rejected_html, "type": "success", "titleText": "Success" }) }} {% endif %} {% endwith %}
{% if delete_form %} {% set banner_html %}

Are you sure you want to reset this test submission?

{{ delete_form.csrf_token }}
{{ delete_form.confirm_deletion(params={"text": "Yes, reset this test submission", "classes": "govuk-button--warning govuk-!-margin-bottom-0"}) }} Cancel
{% endset %} {{ govukNotificationBanner(params={"role": "alert", "titleText": "Important", "classes": "", "html": banner_html}) }} {% endif %}
{{ helper.submission.grant_recipient.organisation.name if helper.submission.grant_recipient else helper.submission.created_by.email }}

Submission

{% if helper.submission.is_assessed %} {{ assessmentStatusTag(helper.assessment_status) }} {% else %} {{ submissionStatusTag(helper.status, helper.submission.is_overdue) }} {% endif %}
{{ govukSummaryList({ "rows": [ { "key": { "text": "Organisation" }, "value": { "text": helper.submission.grant_recipient.organisation.name }, } if helper.submission.grant_recipient else None, { "key": { "text": "Grant name" }, "value": { "text": helper.submission.collection.grant.name } }, { "key": { "text": helper.submission.collection.type.constants.singular | capitalize ~ " name" }, "value": { "text": helper.submission.collection.name } }, { "key": { "text": "Submitted by" }, "value": { "text": helper.submitted_by.name ~ " on " ~ format_date(helper.submission.created_at_utc) }, } if helper.is_submitted else None, ] }) }}
{% if not helper.submission.is_assessed and (helper.can_be_assessed_by_user(current_user) or helper.can_be_reopened_by_user(current_user)) %}
{% if helper.can_be_assessed_by_user(current_user) %} {{ govukButton( params={ "text": "Approve or reject submission", "href": url_for('deliver_grant_funding.approve_or_reject_submission', grant_id=grant.id, submission_id=helper.submission.id) } ) }} {% endif %} {% if helper.can_be_reopened_by_user(current_user) %} {{ govukButton( params={ "text": "Request or allow changes", "href": url_for('deliver_grant_funding.request_or_allow_changes', grant_id=grant.id, submission_id=helper.submission.id), "classes": "govuk-button--secondary" } ) }} {% endif %}
{% endif %} {{ govukTabs({ "classes": "app-custom-gov-tabs", "items": [ { "label": "Submission responses", "id": "submission-responses", "panel": { "html": formResponsesTabPanel } }, { "label": "Timeline", "id": "timeline", "panel": { "html": timelineTabPanel } } ] }) }} {% if helper.submission.mode == enum.submission_mode.TEST %}

Manage test submission

{% endif %} {% endblock content %}