Files
PyRIGS/RIGS/templates/event_table.html
2020-09-12 10:07:58 +01:00

96 lines
3.8 KiB
HTML

{% load namewithnotes from filters %}
{% comment %}<div class="d-none d-md-block">{% endcomment %}
<div class="table-responsive" style="overflow: hidden;">
<table class="table mb-0">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Event Date</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">
<div><strong>{{ event.start_date|date:"D d/m/Y" }}</strong></div>
{% if event.has_start_time %}
<p>Start Time: {{ event.start_time|date:"H:i" }}</p>
{% endif %}
{% if event.end_date and event.end_date != event.start_date %}
<div><strong>{{ event.end_date|date:"D d/m/Y" }}</strong></div>
{% if event.has_end_time%}
<p>End Time: {{ event.end_time|date:"H:i" }}</p>
{% endif %}
{% endif %}
{% if not event.cancelled %}
{% if event.meet_at %}
<p>Crew meet: {{ event.meet_at|date:"H:i" }} {{ event.meet_at|date:"(Y-m-d)" }}</p>
{% endif %}
{% endif %}
</td>
<!---Details-->
<td id="event_details">
<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">
{% if event.mic %}
<div class="media">
{% 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 mr-3"/>
{% if perms.RIGS.view_profile %}
</a>
{% endif %}
<div class="media-body">
<p>{{ event.mic.initials }}</p>
</div>
</div>
{% 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>
{% comment %}
</div>
<div class="d-xs-block d-sm-block d-md-none">
{% include 'event_table_mobile.html' %}
</div>
{% endcomment %}