<div class="card p-3 mb-3">
    <h6>Buildings & Units</h6>

    <ul class="list-group">
        {% for b in buildings %}
        <li class="list-group-item">
            <strong>{{ b.name }}</strong>
            <ul>
                {% for u in units %}
                    {% if u.building_id == b.id %}
                        <li>{{ u.name }}</li>
                    {% endif %}
                {% endfor %}
            </ul>
        </li>
        {% endfor %}
    </ul>
</div>