{% extends "base.html" %} {% block title %}Facilities{% endblock %} {# MODERN facilities page (design A/B test — slide 5 of JQC_design). The four hub cards are new; everything below them is the original grouped facility list, delete modal and JS, unchanged — no functionality removed. #} {% block content %}
Facilities
Manage facility records, statistics and QR access
{% if not current_user.is_inspector %}
Print QR Code
Generate and print scannable QR codes for every facility entrance and asset.
Open →
{% endif %}
Facilities Information
View addresses, contacts, contracts and service details in one place.
Open →
Facilities Statistics
Track inspection scores and issue trends by location over time.
Open →
{% if current_user.role in ['admin', 'director'] %}
Customize
Configure inspection templates, checklist items and scoring for your facilities.
Open →
{% endif %}
{# ── Original facility list (unchanged) ───────────────────────────────── #}

All Facilities

{% if not current_user.is_inspector %} Print All QR Codes {% endif %} {% if current_user.role in ['admin', 'director'] %} Add Facility {% endif %}
{% if grouped %} {% for group_key, group in grouped.items() %} {# ── Contract group header ────────────────────────────────────────────── #} {% set collapse_id = 'contract-' ~ loop.index %}
{{ group.facilities|length }} {% if group.project and current_user.role in ['admin', 'director', 'project_manager', 'auditor'] %} {% endif %}
{# ── Collapsible card grid ─────────────────────────────────────────── #}
{% for facility in group.facilities %}
{{ facility.name }} {% if not facility.active %} Inactive {% endif %}
{% if facility.address %}

{{ facility.address }}

{% endif %}
{{ facility.areas.count() }} areas
{% endfor %}
{% endfor %} {% else %}
No facilities configured yet.
{% endif %} {% if current_user.role == 'admin' %} {% endif %} {% endblock %} {% block extra_js %} {% endblock %}