{% extends "base.html" %} {% block title %}{{ title }}{% endblock %} {% block content %}
{{ title }}
{{ form.hidden_tag() }} {# Contract selector — UI only; narrows the facility list via AJAX #}
{# Facility — populated by JS once a contract is chosen #}
{{ form.facility_id.label(class="form-label fw-semibold") }} {{ form.facility_id(class="form-select", id="facility_id") }} {% for e in form.facility_id.errors %}
{{ e }}
{% endfor %}
{{ form.template_id.label(class="form-label fw-semibold") }} {{ form.template_id(class="form-select") }} {% for e in form.template_id.errors %}
{{ e }}
{% endfor %}
{{ form.inspector_id.label(class="form-label fw-semibold") }} {{ form.inspector_id(class="form-select") }} {% for e in form.inspector_id.errors %}
{{ e }}
{% endfor %}
{{ form.frequency.label(class="form-label fw-semibold") }} {{ form.frequency(class="form-select") }}
{{ form.next_due_date.label(class="form-label fw-semibold") }} {{ form.next_due_date(class="form-control", type="date") }} {% for e in form.next_due_date.errors %}
{{ e }}
{% endfor %}
Snapped forward to the first matching day. Advances automatically after each completed inspection.
{# ── End date (phase44) ── Hidden for one-time schedules, which end by deactivating when completed. syncFrequency() toggles it; the route forces the column to NULL when frequency == 'once', so a stale DOM value cannot survive a frequency change. #} {# ── Weekly: which days of the week ──────────────────────────── #} {# ── Monthly: day-of-month OR nth weekday ────────────────────── #}
{{ form.notes.label(class="form-label fw-semibold") }} {{ form.notes(class="form-control", rows=3, placeholder="e.g. Front lobby carpet needs extra attention. Check loading dock after 3 PM — key is at the front desk.") }}
Shown to the assigned inspector when they open this inspection, on the web and on the iPad.
{{ form.active(class="form-check-input") }} {{ form.active.label(class="form-check-label") }}
Cancel

Recurring schedules automatically roll their due date forward each time the inspection is completed. The assigned inspector is reminded the day before and on the due date; managers are alerted if it becomes overdue.

{% endblock %} {% block extra_js %} {% endblock %}