Skip to content

Commit 7e7ddb7

Browse files
feat(#2939): Show account benefit links in task table in event page (#2941)
1 parent 8280794 commit 7e7ddb7

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/templates/workshops/event.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ <h3>Tasks</h3>
9797
title="Only Instructor or Trainer badges shown."></i></th>
9898
<th>Person</th>
9999
<th>Role</th>
100-
<th>Member site seat <i class="fas fa-question-circle" data-toggle="tooltip" title="Applies only to TTT events"></i></th>
100+
<th>Member site seat / Account benefit</th>
101101
<th>Open applicant <i class="fas fa-question-circle" data-toggle="tooltip" title="Applies only to TTT events with open applications"></i></th>
102102
<th class="additional-links"></th>
103103
</tr>
@@ -120,6 +120,11 @@ <h3>Tasks</h3>
120120
{% if t.seat_membership %}
121121
<a href="{{ t.seat_membership.get_absolute_url }}">{{ t.seat_membership }}</a><br>
122122
<small>{{ t.get_seat_public_display }}</small>
123+
{% elif t.allocated_benefit %}
124+
Account benefit <a href="{{ t.allocated_benefit.get_absolute_url }}">{{ t.allocated_benefit.benefit.name }}</a>
125+
{% if t.allocated_benefit.partnership %}
126+
for partnership <a href="{{ t.allocated_benefit.partnership.get_absolute_url }}">{{ t.allocated_benefit.partnership.name }}</a>
127+
{% endif %}
123128
{% else %}&mdash;{% endif %}
124129
</td>
125130
<td>{{ t.seat_open_training|yesno }}</td>

src/workshops/views.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,15 @@ def event_details(request: AuthenticatedHttpRequest, slug: str) -> HttpResponse:
969969

970970
tasks = (
971971
Task.objects.filter(event__id=event.id)
972-
.select_related("event", "person", "role")
972+
.select_related(
973+
"event",
974+
"person",
975+
"role",
976+
"seat_membership",
977+
"allocated_benefit",
978+
"allocated_benefit__partnership",
979+
"allocated_benefit__account",
980+
)
973981
.prefetch_related(
974982
person_important_badges,
975983
person_instructor_community_roles,
@@ -989,6 +997,7 @@ def event_details(request: AuthenticatedHttpRequest, slug: str) -> HttpResponse:
989997
admin_lookup_form.helper = BootstrapHelper(
990998
form_action=reverse("event_assign", args=[slug]), add_cancel_button=False
991999
)
1000+
9921001
if hasattr(event, "instructorrecruitment"):
9931002
instructor_recruitment_signups = list(
9941003
InstructorRecruitmentSignup.objects.filter(recruitment=event.instructorrecruitment)

0 commit comments

Comments
 (0)