2018-08-05 10:18:10 +00:00
|
|
|
{% extends 'team_base.html' %}
|
2018-07-02 21:52:52 +00:00
|
|
|
{% load commonmark %}
|
|
|
|
{% load bootstrap3 %}
|
|
|
|
|
2020-06-03 19:30:10 +00:00
|
|
|
{% block title %}
|
|
|
|
Shifts | {{ block.super }}
|
|
|
|
{% endblock %}
|
2018-07-02 21:52:52 +00:00
|
|
|
|
2018-08-05 10:18:10 +00:00
|
|
|
{% block team_content %}
|
2018-07-02 21:52:52 +00:00
|
|
|
|
|
|
|
{% if request.user in team.responsible_members.all %}
|
|
|
|
<a class="btn btn-success"
|
|
|
|
href="{% url 'teams:shift_create' camp_slug=camp.slug team_slug=team.slug %}">
|
2018-07-17 17:28:16 +00:00
|
|
|
Create a single shift
|
|
|
|
</a>
|
|
|
|
<a class="btn btn-success"
|
|
|
|
href="{% url 'teams:shift_create_multiple' camp_slug=camp.slug team_slug=team.slug %}">
|
|
|
|
Create multiple shifts
|
2018-07-02 21:52:52 +00:00
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<table class="table table-condensed">
|
|
|
|
<tbody>
|
|
|
|
{% for shift in shifts %}
|
|
|
|
{% ifchanged shift.shift_range.lower|date:'d' %}
|
|
|
|
<tr>
|
|
|
|
<td colspan=4>
|
|
|
|
<h4>
|
|
|
|
{{ shift.shift_range.lower|date:'Y-m-d l' }}
|
|
|
|
</h4>
|
|
|
|
<tr>
|
|
|
|
<th>
|
|
|
|
From
|
|
|
|
<th>
|
|
|
|
To
|
|
|
|
<th>
|
|
|
|
People required
|
|
|
|
<th>
|
|
|
|
People
|
2018-07-03 05:15:42 +00:00
|
|
|
<th>
|
|
|
|
Actions
|
2018-07-02 21:52:52 +00:00
|
|
|
{% endifchanged %}
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
{{ shift.shift_range.lower|date:'H:i' }}
|
|
|
|
<td>
|
|
|
|
{{ shift.shift_range.upper|date:'H:i' }}
|
|
|
|
<td>
|
|
|
|
{{ shift.people_required }}
|
|
|
|
<td>
|
2018-07-19 20:46:26 +00:00
|
|
|
{% for member in shift.team_members.all %}
|
2019-08-11 15:47:54 +00:00
|
|
|
{{ member.user.profile.get_public_credit_name }}{% if not forloop.last %},{% endif %}
|
2018-07-19 20:46:26 +00:00
|
|
|
{% empty %}
|
|
|
|
None!
|
|
|
|
{% endfor %}
|
|
|
|
|
2018-07-03 05:15:42 +00:00
|
|
|
<td>
|
|
|
|
{% if request.user in team.responsible_members.all %}
|
|
|
|
<a class="btn btn-info"
|
|
|
|
href="{% url 'teams:shift_update' camp_slug=camp.slug team_slug=team.slug pk=shift.pk %}">
|
|
|
|
<i class="fas fa-edit"></i> Edit
|
|
|
|
</a>
|
2018-07-19 20:46:26 +00:00
|
|
|
<a class="btn btn-danger"
|
|
|
|
href="{% url 'teams:shift_delete' camp_slug=camp.slug team_slug=team.slug pk=shift.pk %}">
|
2018-07-03 05:15:42 +00:00
|
|
|
<i class="fas fa-trash"></i> Delete
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
2018-08-08 12:36:31 +00:00
|
|
|
{% if user in shift.users %}
|
|
|
|
<a class="btn btn-danger"
|
|
|
|
href="{% url 'teams:shift_member_drop' camp_slug=camp.slug team_slug=team.slug pk=shift.pk %}">
|
2018-08-08 12:37:41 +00:00
|
|
|
<i class="fas fa-thumbs-down"></i> Unassign me
|
2018-08-08 12:36:31 +00:00
|
|
|
</a>
|
|
|
|
{% elif shift.people_required > shift.team_members.count %}
|
2018-07-19 20:46:26 +00:00
|
|
|
<a class="btn btn-success"
|
|
|
|
href="{% url 'teams:shift_member_take' camp_slug=camp.slug team_slug=team.slug pk=shift.pk %}">
|
2018-08-08 12:37:41 +00:00
|
|
|
<i class="fas fa-thumbs-up"></i> Assign me
|
2018-07-19 20:46:26 +00:00
|
|
|
</a>
|
|
|
|
{% endif %}
|
2018-07-02 21:52:52 +00:00
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% endblock %}
|