[ {% for x in usage_events %} { {% if personal_schedule %} "title": "{{ x.tool.name }}", {% else %} "title": "{% if x.operator.id != x.user.id %}{{ x.operator }} on behalf of {% endif %}{{ x.user }}", {% endif %} {% if x.operator.id == x.user.id %} "tooltip": "{{ x.tool.name }} usage for {{ x.user }}", {% else %} "tooltip": "{{ x.tool.name }} usage for {{ x.user }}, operated by {{ x.operator }}", {% endif %} "id": {{ x.id }}, "start": "{{ x.start|date:"c" }}", {# Usage events that are less than 15 minutes are artificially lengthened for display purposes. #} "end": "{{ x.get_visual_end|date:"c" }}", "details_url": "{% url 'usage_details' x.id %}" }{% if not forloop.last %},{% elif area_access_events or missed_reservations %},{% endif %} {% endfor %} {% for x in area_access_events %} { "title": "{{ x.area }} access billed to project {{ x.project }} {% if x.staff_charge %}by {{ x.staff_charge.staff_member }}{% endif %}", "tooltip": "{{ x.area }} access for {{ x.customer }} billed to project {{ x.project }} {% if x.staff_charge %}by {{ x.staff_charge.staff_member }}{% endif %}", "id": {{ x.id }}, "color": "#e68a00", "start": "{{ x.start|date:"c" }}", {# Area access events that are less than 15 minutes are artificially lengthened for display purposes. #} "end": "{{ x.get_visual_end|date:"c" }}", "details_url": "{% url 'area_access_details' x.id %}" }{% if not forloop.last %},{% elif missed_reservations %},{% endif %} {% endfor %} {% for x in missed_reservations %} { {% if personal_schedule %} "title": "Missed reservation for the {{ x.reservation_item }}", {% else %} "title": "Missed reservation by {{ x.user }}", {% endif %} {% if x.creator.id == x.user.id %} "tooltip": "Missed {{ x.reservation_item.name }} reservation for {{ x.user }}", {% else %} "tooltip": "Missed {{ x.reservation_item.name }} reservation for {{ x.user }}, created by {{ x.creator }}", {% endif %} "id": {{ x.id }}, "color": "#ff0000", "start": "{{ x.start|date:"c" }}", "end": "{{ x.end|date:"c" }}", "details_url": "{% url 'reservation_details' x.id %}" }{% if not forloop.last %},{% endif %} {% endfor %} ]