{% extends "base.html" %} {% block title %}Inspections{% endblock %} {% block content %}
| # | Date | Contract | Facility | Area | Template | Inspector | Score | 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 }} | {{ 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 %} |