{% if areas_exist %}
{% if not facility_occupants %}

Nobody is in an access controlled
{{ facility_name }} area

{% else %} {% regroup facility_occupants by area as area_occupants %}

Area occupancy

Staff members are highlighted in  green 
Service personnel are highlighted in  orange 
{% if reservations_can_expire %} Users with expired reservations are highlighted in  red  {% endif %} Users logged in outside of their allowed schedule are highlighted in  red 

{% for area in area_occupants %} {% include 'occupancy/occupancy_content.html' with area=area.grouper occupants=area.list transparent_bg=True center_th=True %} {% endfor %} {% endif %}
{% endif %} {% if tools_exist %}
{% if usage_events %}

Tool usage

{% if usage_events|length > 1 %}{{ usage_events|length }} tools are in use{% endif %} 

{# Panel is used to make table borders rounded. #}
{% for u in usage_events %} {% endfor %}
Tool User In use since...
{{ u.tool }} {{ u.operator.first_name }} {{ u.operator.last_name }}{% if u.user != u.operator %} on behalf of {{ u.user.first_name }} {{ u.user.last_name }}{% endif %} {{ u.start|date:"MONTH_DAY_FORMAT" }} @ {{ u.start|time }}
{% else %}

No {{ facility_name }} tools are in use

{% endif %}
{% endif %} {% if alerts or disabled_resources %}

Alerts and outages

{# For spacing #} 

{% for a in alerts %}
{% if a.title %}{{ a.title }}
{% endif %} {{ a.contents|linebreaks }}
{% endfor %} {% for r in disabled_resources %}
Resource outage: {{ r }}
{{ r.restriction_message }}
{% endfor %}
{% endif %}