{% extends "base.html" %} {% block title %}Scheduled Inspections{% endblock %} {% block content %}

Scheduled Inspections

Planned and recurring inspection assignments.

Inspections {% if current_user.role in ['admin','director','project_manager','auditor'] %} New Schedule {% endif %}
{% if schedules %}
{% for s in schedules %} {% set overdue = s.active and s.next_due_date < today %} {% set due_soon = s.active and not overdue and (s.next_due_date - today).days <= 7 %} {% endfor %}
Facility Template Inspector Frequency Next Due Status
{{ s.facility.name if s.facility else '—' }} {{ s.template.name if s.template else '—' }} {{ s.inspector.display_name if s.inspector else '— Unassigned —' }} {{ s.frequency_label }} {{ s.next_due_date.strftime('%b %d, %Y') }} {% if overdue %} Overdue {% elif due_soon %} Due soon {% endif %} {% if s.active %} Active {% else %} Inactive {% endif %} {# Start is shown only to the assignee — the inspection is theirs to do. #} {% if s.active and s.inspector_id and s.inspector_id == current_user.id %} Start {% endif %} {% if current_user.role in ['admin','director','project_manager','auditor'] %}
{% endif %}
{% else %}
No scheduled inspections yet. {% if current_user.role in ['admin','director','project_manager','auditor'] %} Create one. {% endif %}
{% endif %}
{% endblock %}