Files
PyRIGS/RIGS/templates/event_table.html

92 lines
3.7 KiB
HTML

{% load namewithnotes from filters %}
<div class="table-responsive">
<table class="table mb-0">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Dates & Times</th>
<th scope="col">Event Details</th>
<th scope="col">MIC</th>
</tr>
</thead>
<tbody>
{% for event in events %}
<tr class="{{event.status_color}}" id="event_row">
<!---Number-->
<th scope="row" id="event_number">{{ event.display_id }}</th>
<!--Dates & Times-->
<td id="event_dates" class="text-nowrap">
<div>Start: <strong>{{ event.start_date|date:"D d/m/Y" }}</strong>
{% if event.has_start_time %}
{{ event.start_time|date:"H:i" }}</div>
{% else %}
</div>
{% endif %}
{% if event.end_date and event.end_date != event.start_date %}
<div>End: <strong>{{ event.end_date|date:"D d/m/Y" }}</strong>
{% if event.has_end_time %}
{{ event.end_time|date:"H:i" }}</div>
{% else %}
</div>
{% endif %}
{% endif %}
{% if not event.cancelled %}
{% if event.meet_at %}
<div>Crew meet: {{ event.meet_at|date:"H:i" }} {{ event.meet_at|date:"(d/m/Y)" }}</div>
{% endif %}
{% if event.access_at %}
<div>Access at: {{ event.access_at|date:"H:i" }} {{ event.access_at|date:"(d/m/Y)" }}</div>
{% endif %}
{% endif %}
</td>
<!---Details-->
<td id="event_details" class="w-100">
<h4>
<a href="{% url 'event_detail' event.pk %}">
{{ event.name }}
</a>
{% if event.venue %}
<small>at {{ event.venue|namewithnotes:'venue_detail' }}</small>
{% endif %}
{% if event.dry_hire %}
<span class="badge badge-secondary">Dry Hire</span>
{% endif %}
</h4>
{% if event.is_rig and not event.cancelled %}
<h5>
{{ event.person.name }}
{% if event.organisation %}
for {{ event.organisation.name }}
{% endif %}
</h5>
{% endif %}
{% if not event.cancelled and event.description %}
<p>{{ event.description|linebreaksbr }}</p>
{% endif %}
{% include 'partials/event_status.html' %}
</td>
<!---MIC-->
<td id="event_mic" class="text-nowrap">
{% if event.mic %}
{% if perms.RIGS.view_profile %}
<a href="{% url 'profile_detail' event.mic.pk %}" class="modal-href">
{% endif %}
<img src="{{ event.mic.profile_picture }}" class="event-mic-photo"/>
{{ event.mic }}
{% if perms.RIGS.view_profile %}
</a>
{% endif %}
{% elif event.is_rig %}
<span class="fas fa-exclamation"></span>
{% endif %}
</td>
</tr>
{% empty %}
<tr class="bg-warning">
<td colspan="4">No events found</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>