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

Inspections

{% if current_user.role != 'customer' %}
Scheduled New Inspection
{% endif %}
{# Filters #}
{% if inspectors %}
{% endif %}
{% if inspections.items %}
{% for ins in inspections.items %} {% endfor %}
#DateContractFacilityArea TemplateInspectorScore Status
#{{ ins.id }} {{ ins.inspection_date.strftime('%Y-%m-%d %H:%M') }} {{ ins.facility.project.name if ins.facility and ins.facility.project else '—' }} {{ ins.facility.name }} {% if ins.area %}{{ ins.area.name }}{% else %}{% endif %} {{ ins.template.name }} {% if ins.scheduled_inspection_id %} Scheduled {% endif %} {{ ins.inspector.display_name }} {% if ins.overall_score %} {{ ins.overall_score }}% {% else %}{% endif %} {{ 'Submitted' if ins.status == 'completed' else ins.status|replace('_',' ')|title }} {% if ins.status == 'in_progress' %} {% set hours_open = ((now - ins.inspection_date).total_seconds() / 3600) %} {% if hours_open > 24 %} Stale {% endif %} {% endif %} {% if ins.follow_up_required and not ins.follow_ups.count() %} Follow-up {% endif %} {% if ins.status == 'in_progress' or ins.status == 'flagged' %} Continue {% else %} View {% endif %} {% if current_user.role in ['admin', 'director'] %} {% endif %}
{# Pagination #} {% if inspections.pages > 1 %}
{% endif %} {% else %}
No inspections found.
{% endif %}
{% if current_user.role in ['admin', 'director'] %} {% endif %} {% endblock %} {% block extra_js %} {% if current_user.role in ['admin', 'director'] %} {% endif %} {% endblock %}