{% load training_tags %} [ {% for x in events %} { {% if personal_schedule and x.tool %} "title": "{{x.reservation_item.name|escapejs}} ({{x.user.username|escapejs}})\n{{ x.title|escapejs }}", "color": "#33ad33", {% elif personal_schedule and x.area %} "title": "{{x.reservation_item.name|escapejs}} ({{x.user.username|escapejs}})\n{{ x.title|escapejs }}", "color": "#84CD84", {% elif all_tools or all_areastools and x.tool %} "title": "{{x.reservation_item.name|escapejs}} ({{x.user.username|escapejs}})\n{{ x.title|escapejs }}", "color": "{{ x.reservation_item.tool_calendar_color|default:'#33ad33'|escapejs }}", {% elif all_areas or all_areastools and x.area %} "title": "{{x.reservation_item.name|escapejs}} ({{x.user.username|escapejs}})\n{{ x.title|escapejs }}", "color": "{{ x.reservation_item.area_calendar_color|default:'#84CD84'|escapejs }}", {% else %} {% if display_name %} "title": "{{x.reservation_item.name|escapejs}} ({{x.user.username|escapejs}})\n{{ x.title|escapejs }}", {% else %} "title": "{{ x.title|default:x.user|escapejs }}", {% endif %} "color": {% if x.user.id == user.id %}"#3a87ad"{% else %}"#88B7CD"{% endif %}, {% endif %} {% if x.creator.id == x.user.id %} "tooltip": "{{ x.reservation_item.name }} reservation for {{ x.user }}", {% else %} "tooltip": "{{ x.reservation_item.name }} reservation for {{ x.user }}, created by {{ x.creator }}", {% endif %} "id": "Reservation {{ x.id }}", {# The reservation creator or staff may edit the event: #} {% if user.id == x.user.id or user.is_staff %}"editable": true,{% endif %} "start": "{{ x.start|date:"c" }}", "end": "{{ x.get_visual_end|date:"c" }}", "details_url": "{% url 'reservation_details' x.id %}" }{% if not forloop.last %},{% elif outages or trainings %},{% endif %} {% endfor %} {% for x in outages %} { "title": "{{ x.title|escapejs }}", "id": "Outage {{ x.id }}", {% if user.is_staff %}"editable": true,{% endif %} "color": "#ff0000", "start": "{{ x.start|date:"c" }}", "end": "{{ x.end|date:"c" }}", "details_url": "{% url 'outage_details' x.id %}" }{% if not forloop.last %},{% elif trainings %},{% endif %} {% endfor %} {% for training in trainings %} { {% if personal_schedule or all_tools or all_areastools %} "title": "{{ training.tool.name }} training by {{ training.trainer.get_name }}", {% else %} "title": "Training by {{ training.trainer.get_name }}", {% endif %} {% if training.invitation_only and user not in training.users.all and not training|training_event_invitations:user or training.current_capacity >= training.capacity %} "before": "", {% endif %} "id": "Training {{ training.id }}", "color": "#BF00FFFF", "start": "{{ training.start|date:"c" }}", "end": "{{ training.end|date:"c" }}", {% if user.is_staff or user|is_trainer:training.tool %}"editable": true,{% endif %} "details_url": "{% url 'training_event_details' training.id %}" }{% if not forloop.last %},{% endif %} {% endfor %} ]