Aug 3 - Update scheduled task acknowledged

This commit is contained in:
2026-08-03 12:51:01 -04:00
parent 6513e6b4f6
commit 38acb6a52e
8 changed files with 182 additions and 4 deletions
+10
View File
@@ -61,6 +61,16 @@
<td class="text-end">
{# Start is shown only to the assignee — the inspection is theirs to do. #}
{% if s.inspector_id and s.inspector_id == current_user.id %}
{# Receipt confirmation (phase47) — assignee confirms, or shows confirmed. #}
{% if s.is_acknowledged %}
<span class="badge bg-success" title="You confirmed receipt"><i class="bi bi-check-circle"></i> Confirmed</span>
{% else %}
<form method="POST" class="d-inline" action="{{ url_for('scheduled_inspections.acknowledge', schedule_id=s.id) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-sm btn-outline-success py-0" title="Confirm you received this request">
<i class="bi bi-check-lg"></i> Confirm</button>
</form>
{% endif %}
{% set open_id = sched_open_inspections.get(s.id) %}
{% if open_id %}
<a href="{{ url_for('inspections.execute', inspection_id=open_id) }}"
@@ -33,6 +33,7 @@
<th>Next Due</th>
<th>Ends</th>
<th>Status</th>
<th>Confirmation</th>
<th>Created By</th>
<th class="text-end"></th>
</tr>
@@ -74,6 +75,31 @@
<span class="badge bg-secondary">Inactive</span>
{% endif %}
</td>
<td>
{# Receipt confirmation by the assigned inspector (phase47). #}
{% if not s.inspector_id %}
<span class="text-muted"></span>
{% elif s.is_acknowledged %}
<span class="badge bg-success" title="Confirmed by {{ s.inspector.display_name if s.inspector else 'inspector' }}">
<i class="bi bi-check-circle"></i> Confirmed
</span>
<div class="small text-muted">{{ s.acknowledged_at.strftime('%b %d, %Y') }}</div>
{% else %}
<span class="badge bg-warning text-dark" title="The inspector has not confirmed receipt yet">
<i class="bi bi-hourglass-split"></i> Awaiting
</span>
{# The assignee can confirm right here. #}
{% if s.inspector_id == current_user.id %}
<form method="POST" class="d-inline"
action="{{ url_for('scheduled_inspections.acknowledge', schedule_id=s.id) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-sm btn-outline-success mt-1" title="Confirm you received this request">
<i class="bi bi-check-lg"></i> Confirm receipt
</button>
</form>
{% endif %}
{% endif %}
</td>
<td>
{{ s.creator.display_name if s.creator else '—' }}
<div class="small text-muted">{{ s.created_at.strftime('%b %d, %Y') if s.created_at else '' }}</div>