From e786b710f8a604783c4d3cec6509f55048b094b0 Mon Sep 17 00:00:00 2001 From: Piotr Banaszkiewicz Date: Sun, 15 Sep 2024 17:51:26 +0100 Subject: [PATCH] [#2696] Display additional links to recruitment-related scheduled emails --- amy/templates/includes/event_details_table.html | 14 +++++++++++++- amy/templates/workshops/person.html | 14 +++++++++++++- amy/workshops/views.py | 5 +++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/amy/templates/includes/event_details_table.html b/amy/templates/includes/event_details_table.html index 7752c6306..44b98872d 100644 --- a/amy/templates/includes/event_details_table.html +++ b/amy/templates/includes/event_details_table.html @@ -91,8 +91,20 @@ Related scheduled emails: - + {% include "includes/related_scheduled_emails.html" with object=event %} + + Related scheduled emails for recruitments: + + {% with signups=related_instructor_recruitment_signups %} + {% for signup in signups %} + {% include "includes/related_scheduled_emails_no_empty_msg.html" with object=signup %} + {% empty %} + — + {% endfor %} + {% endwith %} + + diff --git a/amy/templates/workshops/person.html b/amy/templates/workshops/person.html index d6fb65eea..930efab8c 100644 --- a/amy/templates/workshops/person.html +++ b/amy/templates/workshops/person.html @@ -268,7 +268,19 @@ {% with awards=person.award_set.all %} {% for award in awards %} {% include "includes/related_scheduled_emails_no_empty_msg.html" with object=award %} - {% empty%} + {% empty %} + — + {% endfor %} + {% endwith %} + + + + Related scheduled emails for recruitments: + + {% with signups=person.instructorrecruitmentsignup_set.all %} + {% for signup in signups %} + {% include "includes/related_scheduled_emails_no_empty_msg.html" with object=signup %} + {% empty %} — {% endfor %} {% endwith %} diff --git a/amy/workshops/views.py b/amy/workshops/views.py index 94ee19f02..71e8e5cf7 100644 --- a/amy/workshops/views.py +++ b/amy/workshops/views.py @@ -81,6 +81,7 @@ ) from emails.signals import persons_merged_signal from fiscal.models import MembershipTask +from recruitment.models import InstructorRecruitmentSignup from workshops.base_views import ( AMYCreateView, AMYDeleteView, @@ -1087,6 +1088,9 @@ def event_details(request, slug): admin_lookup_form.helper = BootstrapHelper( form_action=reverse("event_assign", args=[slug]), add_cancel_button=False ) + instructor_recruitment_signups = InstructorRecruitmentSignup.objects.filter( + recruitment=event.instructorrecruitment + ) context = { "title": "Event {0}".format(event), @@ -1109,6 +1113,7 @@ def event_details(request, slug): "longitude": event.longitude, }, "recruitment_stats": recruitment_stats, + "related_instructor_recruitment_signups": instructor_recruitment_signups, } return render(request, "workshops/event.html", context)