-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathteam_shift_list.html
More file actions
99 lines (93 loc) · 3.28 KB
/
team_shift_list.html
File metadata and controls
99 lines (93 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{% extends 'team_base.html' %}
{% load commonmark %}
{% load django_bootstrap5 %}
{% block title %}
Shifts | {{ block.super }}
{% endblock %}
{% block team_content %}
{% if request.user in team.leads.all %}
<a class="btn btn-success"
href="{% url 'teams:shift_create' camp_slug=camp.slug team_slug=team.slug %}">
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
</a>
{% endif %}
<table id="main_table" class="table table-condensed">
<tbody>
{% for shift in shifts %}
{% ifchanged shift.shift_range.lower|date:'d' %}
<thead>
<tr>
<td colspan=5>
<h4>
{{ shift.shift_range.lower|date:'Y-m-d l' }}
</h4>
</td>
</tr>
<tr>
<th>
From</th>
<th>
To</th>
<th>
People required</th>
<th>
People</th>
<th>
Actions</th>
</tr>
</thead>
{% endifchanged %}
<tr>
<td>
{{ shift.shift_range.lower|date:'H:i' }}
</td>
<td>
{{ shift.shift_range.upper|date:'H:i' }}
</td>
<td>
{{ shift.team_members.count }} of {{ shift.people_required }} assigned
</td>
<td>
{% for member in shift.teamshiftassignment_set.all %}
{{ member.team_member.user.profile.get_public_credit_name }}{% if member.for_sale %} <em>(for sale!)</em>{% endif %}{% if not forloop.last %},{% endif %}
{% empty %}
None!
{% endfor %}
</td>
<td>
{% if request.user in team.leads.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>
<a class="btn btn-danger"
href="{% url 'teams:shift_delete' camp_slug=camp.slug team_slug=team.slug pk=shift.pk %}">
<i class="fas fa-trash"></i> Delete
</a>
{% endif %}
{% 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 %}">
<i class="fas fa-thumbs-down"></i> Unassign me
</a>
{% if user not in shift.for_sale_users %}
<a class="btn btn-warning"
href="{% url 'teams:shift_member_sell' camp_slug=camp.slug team_slug=team.slug pk=shift.pk %}">
<i class="fas fa-thumbs-down"></i> Make available
</a>
{% endif %}
{% elif shift.people_required > shift.shifts_available %}
<a class="btn btn-success"
href="{% url 'teams:shift_member_take' camp_slug=camp.slug team_slug=team.slug pk=shift.pk %}">
<i class="fas fa-thumbs-up"></i> Assign me
</a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% endblock %}