{% extends "ui/templates/base/layout.html" %} {% block content %} {% include "modules/partners/templates/partners/_partner_tabs.html" %} {% macro engagement_row(task, column, payload) %} {% set stats = namespace(total=0, completed=0, blocked=0, review=0, rework=0, assignees=[]) %} {% for stat_column in payload.columns %} {% for item in stat_column.tasks %} {% if item.subscription_id == task.subscription_id %} {% set stats.total = stats.total + 1 %} {% if (item.status or '')|lower in ['completed', 'not_applicable', 'cancelled'] %} {% set stats.completed = stats.completed + 1 %} {% endif %} {% if (item.status or '')|lower == 'blocked' %} {% set stats.blocked = stats.blocked + 1 %} {% endif %} {% if stat_column.code == 'pending_review' %} {% set stats.review = stats.review + 1 %} {% endif %} {% if stat_column.code == 'rework_sent' %} {% set stats.rework = stats.rework + 1 %} {% endif %} {% if item.assignee_display and item.assignee_display not in stats.assignees %} {% set _ = stats.assignees.append(item.assignee_display) %} {% endif %} {% endif %} {% endfor %} {% endfor %} {{ task.business_display }} {% if task.legal_client_display %}
{{ task.legal_client_display }}
{% endif %} {% if task.scope_context_display %}
{{ task.scope_context_display }}
{% endif %}
{{ task.engagement_label }}
Engagement #{{ task.subscription_id }}
{{ task.period_label_display }}
{% if task.financial_year_display %}
FY {{ task.financial_year_display }}
{% endif %} {% if task.engagement_start_date or task.engagement_end_date %}
{% if task.engagement_start_date %}{{ task.engagement_start_date }}{% endif %} {% if task.engagement_start_date and task.engagement_end_date %} → {% endif %} {% if task.engagement_end_date %}{{ task.engagement_end_date }}{% endif %}
{% endif %} {% if task.engagement_due_date %}
Due {{ task.engagement_due_date }}
{{ task.due_status_label }}
{% else %}
No statutory due date
{% endif %} {% if column.code == 'pending_review' %} Pending Review {% elif column.code == 'clarification_required' %} Clarification Required {% elif column.code == 'rework_sent' %} Rework Sent {% elif column.code == 'approved' %} In Progress {% else %} Completed {% endif %}
{{ stats.completed }} / {{ stats.total }}
closed task{{ '' if stats.completed == 1 else 's' }} / visible task{{ '' if stats.total == 1 else 's' }}
{% if stats.review %}{{ stats.review }} review{% endif %} {% if stats.blocked %}{{ stats.blocked }} blocked{% endif %} {% if stats.rework %}{{ stats.rework }} rework{% endif %} {% if not stats.review and not stats.blocked and not stats.rework %}No review exception{% endif %}
{% for assignee in stats.assignees[:3] %}
{{ assignee }}
{% endfor %} {% if stats.assignees|length > 3 %}
+{{ stats.assignees|length - 3 }} more
{% endif %} {% if not stats.assignees %}Unassigned{% endif %}
{{ task.priority_label }}
{% if task.internal_target_date %}Task target {{ task.internal_target_date }}{% else %}No task target{% endif %}
Open Review {% endmacro %} {% macro panel(title, subtitle, ids, payload, tone, page_param, current_page, page_size, filter_query) %}
{% set total_items = ids|length %} {% set total_pages = ((total_items + page_size - 1) // page_size) if total_items else 1 %} {% set page = current_page if current_page > 0 else 1 %} {% if page > total_pages %}{% set page = total_pages %}{% endif %} {% set start_index = (page - 1) * page_size %} {% set page_ids = ids[start_index:start_index + page_size] %}

{{ title }}

{{ subtitle }}

{% if total_items %}

Showing {{ start_index + 1 }}-{{ [start_index + page_ids|length, total_items]|min }} of {{ total_items }}

{% endif %}
{% if tone == 'review' %} {{ total_items }} engagement{{ '' if total_items == 1 else 's' }} {% elif tone == 'progress' %} {{ total_items }} engagement{{ '' if total_items == 1 else 's' }} {% else %} {{ total_items }} engagement{{ '' if total_items == 1 else 's' }} {% endif %}
{% set rendered = namespace(seen=[]) %} {% for column in payload.columns %} {% for task in column.tasks %} {% if task.subscription_id and task.subscription_id in page_ids and task.subscription_id not in rendered.seen %} {% set _ = rendered.seen.append(task.subscription_id) %} {{ engagement_row(task, column, payload) }} {% endif %} {% endfor %} {% endfor %} {% if total_items == 0 %}{% endif %}
Business / Client / Engagement Period / Due Status Task Progress Review Items Assigned Team Priority / Target Action
No engagements in this section.
{% if total_items > page_size %}
Page {{ page }} of {{ total_pages }}
{% if page > 1 %}Previous{% else %}Previous{% endif %} {{ page }} / {{ total_pages }} {% if page < total_pages %}Next{% else %}Next{% endif %}
{% endif %}
{% endmacro %}

Partner Review Board

Engagement-level review queue with business identity, engagement period, statutory due date and independent pagination for each section.

Active FY context: {{ payload.active_financial_year or 'Not set' }}
Clear
{% set metrics = namespace(pending_review=[], clarification_required=[], rework_sent=[], approved=[], completed=[], overdue=[], due_soon=[]) %} {% for column in payload.columns %} {% for task in column.tasks %} {% if task.subscription_id %} {% if column.code == 'pending_review' and task.subscription_id not in metrics.pending_review %}{% set _ = metrics.pending_review.append(task.subscription_id) %} {% elif column.code == 'clarification_required' and task.subscription_id not in metrics.clarification_required %}{% set _ = metrics.clarification_required.append(task.subscription_id) %} {% elif column.code == 'rework_sent' and task.subscription_id not in metrics.rework_sent %}{% set _ = metrics.rework_sent.append(task.subscription_id) %} {% elif column.code == 'approved' and task.subscription_id not in metrics.approved %}{% set _ = metrics.approved.append(task.subscription_id) %} {% elif column.code == 'completed' and task.subscription_id not in metrics.completed %}{% set _ = metrics.completed.append(task.subscription_id) %}{% endif %} {% if task.due_status_code == 'overdue' and task.subscription_id not in metrics.overdue %}{% set _ = metrics.overdue.append(task.subscription_id) %}{% endif %} {% if task.due_status_code in ['today','soon'] and task.subscription_id not in metrics.due_soon %}{% set _ = metrics.due_soon.append(task.subscription_id) %}{% endif %} {% endif %} {% endfor %} {% endfor %}
Pending Review
{{ metrics.pending_review|length }}
Awaiting partner review
Clarification
{{ metrics.clarification_required|length }}
Blocked for clarification
Rework
{{ metrics.rework_sent|length }}
Rework outstanding
In Progress
{{ metrics.approved|length }}
Moving with team
Completed
{{ metrics.completed|length }}
Completed engagements
Overdue
{{ metrics.overdue|length }}
Past engagement due date
Due ≤ 7 Days
{{ metrics.due_soon|length }}
Due today / next 7 days
{# Exactly three board sections. Existing task-level states are preserved inside Review Required. #} {% set groups = namespace(review=[], progress=[], completed=[]) %} {% for column in payload.columns %}{% if column.code in ['pending_review', 'clarification_required', 'rework_sent'] %}{% for task in column.tasks %}{% if task.subscription_id and task.subscription_id not in groups.review %}{% set _ = groups.review.append(task.subscription_id) %}{% endif %}{% endfor %}{% endif %}{% endfor %} {% for column in payload.columns %}{% if column.code == 'approved' %}{% for task in column.tasks %}{% if task.subscription_id and task.subscription_id not in groups.review and task.subscription_id not in groups.progress %}{% set _ = groups.progress.append(task.subscription_id) %}{% endif %}{% endfor %}{% endif %}{% endfor %} {% for column in payload.columns %}{% if column.code == 'completed' %}{% for task in column.tasks %}{% if task.subscription_id and task.subscription_id not in groups.review and task.subscription_id not in groups.progress and task.subscription_id not in groups.completed %}{% set _ = groups.completed.append(task.subscription_id) %}{% endif %}{% endfor %}{% endif %}{% endfor %} {% set review_page = request.query_params.get('review_page', '1')|int %} {% set progress_page = request.query_params.get('progress_page', '1')|int %} {% set completed_page = request.query_params.get('completed_page', '1')|int %} {{ panel('Review Required', 'Pending review, clarification-required and rework engagements are shown first.', groups.review, payload, 'review', 'review_page', review_page, page_size, filter_query) }} {{ panel('In Progress', 'Engagements currently moving with the team and not presently waiting in the review queue.', groups.progress, payload, 'progress', 'progress_page', progress_page, page_size, filter_query) }} {{ panel('Completed', 'Completed engagement rows remain available separately for review history and reference.', groups.completed, payload, 'completed', 'completed_page', completed_page, page_size, filter_query) }}
Review remains task-level inside the engagement. This board only groups the existing task records into one engagement row for easier partner navigation.
{% endblock %}