Aug 5 - Update code to follow up ST - MT14b
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
{# ── "Confirm receipt" result page (phase50) ─────────────────────────────────
|
||||
Landing page for the one-click link in a scheduled-inspection assignment or
|
||||
reminder email. Standalone — NOT extending base.html — because the viewer is
|
||||
typically not logged in and base.html's nav assumes current_user. Same shape
|
||||
as the public QR scan pages (facility_qr/area.html).
|
||||
|
||||
`status` is always set; `schedule` only for the statuses that found one.
|
||||
confirmed — newly acknowledged (the happy path)
|
||||
already — acknowledged before; a re-click or an email prefetch
|
||||
reassigned — the token's inspector is no longer the assignee
|
||||
inactive — schedule paused or ended since the email went out
|
||||
expired — token older than 30 days
|
||||
invalid — bad signature / mangled link
|
||||
missing — schedule deleted since the email went out
|
||||
#}
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title>Confirm Receipt — Scheduled Inspection</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css">
|
||||
<style>
|
||||
body { background:#f1f5f9; color:#1f2937; }
|
||||
.cf-wrap { max-width:520px; margin:3rem auto; padding:0 1rem; }
|
||||
.cf-card { background:#fff; border-radius:.75rem; padding:2rem 1.5rem; text-align:center;
|
||||
box-shadow:0 1px 3px rgba(0,0,0,.08); }
|
||||
.cf-icon { font-size:3.5rem; line-height:1; }
|
||||
.cf-meta { background:#f8fafc; border-radius:.5rem; padding:.9rem 1rem; text-align:left;
|
||||
font-size:.9rem; margin-top:1.25rem; }
|
||||
.cf-meta .lbl { color:#64748b; font-size:.75rem; text-transform:uppercase;
|
||||
letter-spacing:.03em; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="cf-wrap">
|
||||
<div class="cf-card">
|
||||
|
||||
{% if status == 'confirmed' %}
|
||||
<div class="cf-icon text-success"><i class="bi bi-check-circle-fill"></i></div>
|
||||
<h1 class="h4 mt-3 mb-2">Receipt confirmed</h1>
|
||||
<p class="text-muted mb-0">
|
||||
Thanks — we've let the scheduler know you've seen this request.
|
||||
Nothing else to do right now.
|
||||
</p>
|
||||
|
||||
{% elif status == 'already' %}
|
||||
<div class="cf-icon text-success"><i class="bi bi-check-circle"></i></div>
|
||||
<h1 class="h4 mt-3 mb-2">Already confirmed</h1>
|
||||
<p class="text-muted mb-0">
|
||||
You confirmed this one earlier. No need to do anything else.
|
||||
</p>
|
||||
|
||||
{% elif status == 'reassigned' %}
|
||||
<div class="cf-icon text-warning"><i class="bi bi-person-x"></i></div>
|
||||
<h1 class="h4 mt-3 mb-2">No longer assigned to you</h1>
|
||||
<p class="text-muted mb-0">
|
||||
This scheduled inspection has been reassigned to someone else since the
|
||||
email was sent, so there's nothing for you to confirm.
|
||||
</p>
|
||||
|
||||
{% elif status == 'inactive' %}
|
||||
<div class="cf-icon text-secondary"><i class="bi bi-pause-circle"></i></div>
|
||||
<h1 class="h4 mt-3 mb-2">This schedule is no longer active</h1>
|
||||
<p class="text-muted mb-0">
|
||||
It has been paused or has reached its end date. No action is needed.
|
||||
</p>
|
||||
|
||||
{% elif status == 'expired' %}
|
||||
<div class="cf-icon text-secondary"><i class="bi bi-hourglass-bottom"></i></div>
|
||||
<h1 class="h4 mt-3 mb-2">This link has expired</h1>
|
||||
<p class="text-muted mb-0">
|
||||
Confirmation links are good for 30 days. Sign in to the schedules page to
|
||||
confirm, or ask your supervisor to resend the assignment.
|
||||
</p>
|
||||
|
||||
{% elif status == 'missing' %}
|
||||
<div class="cf-icon text-secondary"><i class="bi bi-question-circle"></i></div>
|
||||
<h1 class="h4 mt-3 mb-2">Schedule not found</h1>
|
||||
<p class="text-muted mb-0">
|
||||
This scheduled inspection has since been removed. No action is needed.
|
||||
</p>
|
||||
|
||||
{% else %}
|
||||
<div class="cf-icon text-danger"><i class="bi bi-x-circle"></i></div>
|
||||
<h1 class="h4 mt-3 mb-2">This link isn't valid</h1>
|
||||
<p class="text-muted mb-0">
|
||||
The link may have been copied incompletely. Try tapping it directly from
|
||||
the email, or sign in to confirm from the schedules page.
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if schedule %}
|
||||
<div class="cf-meta">
|
||||
<div class="lbl">Inspection</div>
|
||||
<div class="mb-2">
|
||||
{{ schedule.template.name if schedule.template else '—' }}
|
||||
at {{ schedule.facility.name if schedule.facility else '—' }}
|
||||
</div>
|
||||
<div class="lbl">Schedule</div>
|
||||
<div>
|
||||
{{ schedule.recurrence_label }}{% if schedule.due_date %} · due
|
||||
{{ schedule.due_date.strftime('%b %d, %Y') }}{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<p class="text-center text-muted small mt-3 mb-0">
|
||||
Janitorial QC System — automated message. Do not reply to the email.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -84,8 +84,37 @@
|
||||
{% if s.active %}<span class="badge bg-success">Active</span>
|
||||
{% elif s.is_expired %}<span class="badge bg-dark">Ended</span>
|
||||
{% else %}<span class="badge bg-secondary">Paused</span>{% endif %}
|
||||
{# phase50 — receipt acknowledgement. Only meaningful for plan
|
||||
mode: an auto schedule materialises itself, so there is no
|
||||
request for anyone to receive. #}
|
||||
{% if s.mode == 'plan' and s.inspector_id %}
|
||||
{% if s.is_acknowledged %}
|
||||
<span class="badge bg-light text-success border border-success ms-1"
|
||||
title="Inspector confirmed receipt on {{ s.acknowledged_at.strftime('%b %d, %Y %I:%M %p') }}">
|
||||
<i class="bi bi-check-circle"></i> Confirmed
|
||||
</span>
|
||||
{% elif s.active %}
|
||||
<span class="badge bg-light text-warning border border-warning ms-1"
|
||||
title="The assigned inspector has not confirmed receipt yet">
|
||||
<i class="bi bi-hourglass-split"></i> Awaiting confirmation
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-end">
|
||||
{# Assignee-only, like Start: a manager must not be able to confirm
|
||||
on someone's behalf, since the record means "this person saw it". #}
|
||||
{% if s.active and s.mode == 'plan' and not s.is_acknowledged
|
||||
and s.inspector_id == current_user.id %}
|
||||
<form method="POST" class="d-inline"
|
||||
action="{{ url_for('inspection_schedules.acknowledge', schedule_id=s.id) }}">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-success"
|
||||
title="Confirm you have received this request">
|
||||
<i class="bi bi-check-lg"></i> Confirm
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% if s.active and s.mode == 'plan'
|
||||
and (current_user.role != 'inspector' or s.inspector_id == current_user.id) %}
|
||||
<a href="{{ url_for('inspection_schedules.start', schedule_id=s.id) }}"
|
||||
|
||||
Reference in New Issue
Block a user