{% 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 = "Reports" %} {% set active_item_identifier = "reports" %} {% block content %}
{{ flashes[0]["collection_name"] }} report for {{ flashes[0]["grant_name"] }} sign off declined and sent back to {{ flashes[0]["sent_for_certification_by"] }}. View report
{% endset %} {{ govukNotificationBanner({ "html": submission_declined_html, "type":"success", "titleText": "Confirmed" }) }} {% endif %} {% endwith %}There are no reports for this grant.
{% else %} {% set rows=[] %} {% for report in monitoring_reports %} {% set report_name = report.name or (format_date_range_short(report.reporting_period_start_date, report.reporting_period_end_date) if (report.reporting_period_start_date and report.reporting_period_end_date) else "Dates to be confirmed") %} {% set report_submissions = submissions | selectattr("collection_id", "equalto", report.id) | list %} {% set collection_helper = collection_helpers | selectattr("id", "equalto", report.id) | list | first %} {% if report.allow_multiple_submissions %} {% set submission_status_html %} {{ multiSubmissionStatusTag(report_submissions, collection_helper, report.is_overdue) }} {% endset %} {% set report_action_html %} Go to reports for {{ report_name }} {% endset %} {% do rows.append([ {"text": report_name}, {"text": format_date_short(report.submission_period_end_date) if report.submission_period_end_date else "Dates to be confirmed"}, {"html": submission_status_html}, {"html": report_action_html} ]) %} {% else %} {% set submission = (report_submissions | first) if report_submissions else none %} {% set submission_status = SubmissionHelper.get_status(submission.submission, report) %} {% set submission_status_html %} {{ submissionStatusTag(submission_status, submission.submission.is_overdue if submission else report.is_overdue) }} {% endset %} {% set report_action_config = SubmissionHelper.get_access_submission_action(report, grant_recipient, submission.submission) %} {% set report_action_html %} {% if report_action_config.href %} {{ report_action_config.label }} for {{ report_name }} {% elif report_action_config.label %} {{ report_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": report_name}, {"text": format_date_short(report.submission_period_end_date) if report.submission_period_end_date else "Dates to be confirmed"}, {"html": submission_status_html}, {"html": report_action_html} ]) %} {% endif %} {% endfor %} {% set actions_html %} Actions {% endset %} {{ govukTable(params={ "firstCellIsHeader": false, "head":[ {"text": "Report"}, {"text": "Due date"}, {"text": "Status"}, {"html": actions_html} ], "rows":rows }) }} {% endif %}