From 047c0ef7c6576b41a1c4e9eee28c2f47460b8b8e Mon Sep 17 00:00:00 2001 From: Piotr Banaszkiewicz Date: Sun, 15 Sep 2024 17:50:55 +0100 Subject: [PATCH 1/2] [#2696] Simplify link to email template in the list ID is no longer visible, it was confusing. --- amy/templates/emails/email_template_list.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/amy/templates/emails/email_template_list.html b/amy/templates/emails/email_template_list.html index f5fb42839..639f2ec15 100644 --- a/amy/templates/emails/email_template_list.html +++ b/amy/templates/emails/email_template_list.html @@ -12,7 +12,6 @@ {% if email_templates %} - @@ -25,8 +24,7 @@ {% for template in email_templates %} - - + From eded8e03351f9c727d4aa80a9dd18aadaab4d1cf Mon Sep 17 00:00:00 2001 From: Piotr Banaszkiewicz Date: Sun, 15 Sep 2024 17:51:26 +0100 Subject: [PATCH 2/2] [#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 | 8 ++++++++ 3 files changed, 34 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 @@ - + + + +
ID Name Active Signal
{{ template.id }}{{ template.name }}{{ template.name }} {{ template.active|yesno }} {{ template.signal }} {{ template.from_header }}
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..a06c45766 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,12 @@ def event_details(request, slug): admin_lookup_form.helper = BootstrapHelper( form_action=reverse("event_assign", args=[slug]), add_cancel_button=False ) + if hasattr(event, "instructorrecruitment"): + instructor_recruitment_signups = InstructorRecruitmentSignup.objects.filter( + recruitment=event.instructorrecruitment + ) + else: + instructor_recruitment_signups = [] context = { "title": "Event {0}".format(event), @@ -1109,6 +1116,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)