Skip to content

Commit fbf393f

Browse files
Actually use link between events and shifts
1 parent f9c09c5 commit fbf393f

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

website/events/templates/events/event.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,24 @@ <h1 class="section-title">
278278
</tr>
279279
{% endif %}
280280
{% endif %}
281+
282+
{% if shifts %}
283+
<tr>
284+
<th>
285+
Ordering
286+
</th>
287+
<td>
288+
You can self-order for the following:
289+
<ul>
290+
{% for shift in shifts %}
291+
<li>
292+
<a href="{% url "sales:shift-detail" pk=shift.pk %}">{{ shift.title }}</a>
293+
</li>
294+
{% endfor %}
295+
</ul>
296+
{% endif %}
297+
298+
281299
{% if event.album_set.all %}
282300
<tr>
283301
<th>{% trans "photos"|capfirst %}</th>

website/events/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def get_context_data(self, **kwargs):
8989
"member", "member__profile"
9090
)
9191

92+
context["shifts"] = event.shift_set.filter(selforder=True)
93+
9294
fetch_thumbnails(
9395
[p.member.profile.photo for p in context["participants"] if p.member]
9496
)

website/sales/admin/shift_admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ class ShiftAdmin(admin.ModelAdmin):
109109
"end",
110110
"selforder",
111111
"active",
112+
"event",
112113
"product_list",
113114
"managers",
114115
"product_sales",

0 commit comments

Comments
 (0)