From 4fdb3dc0f1bf53ecdefe0a6094574c4b3746c048 Mon Sep 17 00:00:00 2001 From: zawn Date: Mon, 14 Sep 2026 10:51:35 -0400 Subject: [PATCH 1/4] all Celts Training now appears in participation history and test case added. --- app/logic/events.py | 2 +- tests/code/test_events.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/logic/events.py b/app/logic/events.py index ae02cf477..57ef86832 100644 --- a/app/logic/events.py +++ b/app/logic/events.py @@ -428,7 +428,7 @@ def getParticipatedEventsForUser(user): .join(Program, JOIN.LEFT_OUTER).switch() .join(EventParticipant) .where(EventParticipant.user == user, - Event.isAllVolunteerTraining == False, Event.deletionDate == None, Event.isCeltsTraining == False) + Event.isAllVolunteerTraining == False, Event.deletionDate == None) .order_by(Event.startDate, Event.name)) allVolunteer = (Event.select(Event, "", Value("Volunteer").alias("participatedType"), Value(0).alias("hoursEarned")) diff --git a/tests/code/test_events.py b/tests/code/test_events.py index 852e84b1f..647e95516 100644 --- a/tests/code/test_events.py +++ b/tests/code/test_events.py @@ -948,6 +948,12 @@ def test_volunteerHistory(): contactEmail = "test@email", contactName = "testName",) + participatedACTProgram = Program.create(id = 14, + programName = "ACT", + isBonnerScholars = False, + contactEmail = "test@email", + contactName = "testName",) + # Create a program event in the past that the test user will have # participated in participatedProgramEvent = Event.create(name = "Attended program event", @@ -960,6 +966,17 @@ def test_volunteerHistory(): isAllVolunteerTraining = False, program = participatedProgram) + participatedProgramACTEvent = Event.create(name = "All CELTS Training (Labor)", + term = 2, + description = "Test attended ACT program event.", + timeStart = "18:00:00", + timeEnd = "21:00:00", + location = "The moon", + startDate = "2021-12-12", + isAllVolunteerTraining = False, + isCeltsTraining = True, + program = participatedACTProgram) + # Create a non-program event in the past that the test user will have # participated in participatedEvent = Event.create(name = "Attended event", @@ -980,6 +997,10 @@ def test_volunteerHistory(): EventParticipant.create(user = user, event = participatedEvent.id) assert participatedEvent in getParticipatedEventsForUser(user) + # Add the created user as a participant to the created ALL CELTS Training (Labor) program event + EventParticipant.create(user = user, event = participatedProgramACTEvent.id) + assert participatedProgramACTEvent in getParticipatedEventsForUser(user) + # Make sure an event that is not supposed to be returned isnt assert Event.get_by_id(1) not in getParticipatedEventsForUser(user) From ca796d8adca776964ae5ebf887bc97115b2c09d7 Mon Sep 17 00:00:00 2001 From: zawn Date: Tue, 15 Sep 2026 18:03:29 -0400 Subject: [PATCH 2/4] fixing who gets to see the handbook --- app/templates/main/userProfile.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 0b4653610..c6a9c52f1 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -820,7 +820,8 @@
Dietary Restrictions

AY {{g.current_term.academicYear}} Handbook
-
+
+ {{training.isCeltsTraining}} {{training.isAllVolunteerTraining}} {# All CELTS Training #} {% if training.isCeltsTraining %} {% if not g.current_term.laborHandbook %} @@ -829,6 +830,14 @@
AY {{g.current_term.academicYear}} Handbook

CELTS Labor Handbook

{% endif %} + {# Celts Labor #} + {% elif g.current_user.canManageProgram or g.current_user.isCeltsStudentStaff %} + {% if not g.current_term.laborHandbook %} +

No CELTS Labor Handbook available for {{g.current_term.description}} yet.

+ {% else %} +

hyyyyyyyyCELTS Labor Handbook {{g.current_user.canManageProgram}}

+ {% endif %} + {# All Volunteer Training #} {% else %} {% if not g.current_term.volunteerHandbook %} From b22f868600f4c8672444b5207e5e0e38346e5b5f Mon Sep 17 00:00:00 2001 From: zawn Date: Thu, 17 Sep 2026 11:41:58 -0400 Subject: [PATCH 3/4] signature pad visibility change --- app/controllers/main/routes.py | 2 +- app/templates/main/userProfile.html | 21 ++++++++------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/app/controllers/main/routes.py b/app/controllers/main/routes.py index 9c5d93b5c..1a1a2a559 100644 --- a/app/controllers/main/routes.py +++ b/app/controllers/main/routes.py @@ -235,7 +235,7 @@ def viewUsersProfile(username): totalSustainedEngagements = getEngagementTotal(getCommunityEngagementByTerm(volunteer)) handbookOverdue = getHandbookStatus(volunteer) - training = hasGoneToTraining(g.current_user, g.current_term) + training = hasGoneToTraining(volunteer, g.current_term) return render_template ("/main/userProfile.html", username=username, diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index c6a9c52f1..9905e6a16 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -821,22 +821,13 @@
Dietary Restrictions
AY {{g.current_term.academicYear}} Handbook
- {{training.isCeltsTraining}} {{training.isAllVolunteerTraining}} {# All CELTS Training #} - {% if training.isCeltsTraining %} + {% if training.isCeltsTraining or volunteer.isAdmin or volunteer.hasCurrentCeltsLabor %} {% if not g.current_term.laborHandbook %}

No CELTS Labor Handbook available for {{g.current_term.description}} yet.

{% else %}

CELTS Labor Handbook

{% endif %} - - {# Celts Labor #} - {% elif g.current_user.canManageProgram or g.current_user.isCeltsStudentStaff %} - {% if not g.current_term.laborHandbook %} -

No CELTS Labor Handbook available for {{g.current_term.description}} yet.

- {% else %} -

hyyyyyyyyCELTS Labor Handbook {{g.current_user.canManageProgram}}

- {% endif %} {# All Volunteer Training #} {% else %} @@ -848,10 +839,14 @@
AY {{g.current_term.academicYear}} Handbook
{% endif %}
- {% if g.current_user.signatureTerm.academicYear != g.current_term.academicYear and not training %} -

To volunteer, you must sign the CELTS handbook for {{g.current_term.academicYear}}, and you must do this at an All Volunteers Training.

+ {% if handbookOverdue and not training%} + {% if volunteer.bnumber == g.current_user.bnumber%} +

To volunteer, you must sign the CELTS handbook for {{g.current_term.academicYear}}, and you must do this at an All Volunteers Training or All CELTS Training (Labor).

+ {% elif (g.current_user.isAdmin or g.current_user.hasCurrentCeltsLabor) %} +

To volunteer, {{volunteer.fullName}} must sign the CELTS handbook for {{g.current_term.academicYear}}, and they must do this at an All Volunteers Training or All CELTS Training (Labor).

+ {% endif %} {% else %} - {% if volunteer.signatureTerm.academicYear != g.current_term.academicYear %} + {% if handbookOverdue %}
Sign the handbook
{% else %}

Your handbook signature is good for AY {{volunteer.signatureTerm.academicYear}}.

From c93f228c17af126cfe86222412a4b0603f4220b4 Mon Sep 17 00:00:00 2001 From: zawn Date: Thu, 17 Sep 2026 16:38:17 -0400 Subject: [PATCH 4/4] dispaly logic updated' ' --- app/templates/main/userProfile.html | 55 +++++++++++++++-------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 9905e6a16..9f70fc6da 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -818,42 +818,37 @@
Dietary Restrictions

- + + {% set isOwnProfile = volunteer.bnumber == g.current_user.bnumber %} + {% set isLaborViewer = g.current_user.isAdmin or g.current_user.hasCurrentCeltsLabor %} + {% set isLaborHandbook = training.isCeltsTraining or volunteer.isAdmin or volunteer.hasCurrentCeltsLabor %} + {% set handbookAvailable = g.current_term.laborHandbook if isLaborHandbook else g.current_term.volunteerHandbook %} +
AY {{g.current_term.academicYear}} Handbook
{# All CELTS Training #} - {% if training.isCeltsTraining or volunteer.isAdmin or volunteer.hasCurrentCeltsLabor %} - {% if not g.current_term.laborHandbook %} -

No CELTS Labor Handbook available for {{g.current_term.description}} yet.

- {% else %} -

CELTS Labor Handbook

- {% endif %} - - {# All Volunteer Training #} + {% if not handbookAvailable %} +

No {{ "CELTS Labor" if isLaborHandbook else "Volunteer" }} Handbook available for {{ g.current_term.description }} yet.

{% else %} - {% if not g.current_term.volunteerHandbook %} -

No Volunteer Handbook available for {{g.current_term.description}} yet.

- {% else %} -

CELTS Student Handbook

- {% endif %} - {% endif %} +

+ + {{ "CELTS Labor Handbook" if isLaborHandbook else "CELTS Student Handbook" }} + +

+ {% endif %}
{% if handbookOverdue and not training%} - {% if volunteer.bnumber == g.current_user.bnumber%} + {% if isOwnProfile %}

To volunteer, you must sign the CELTS handbook for {{g.current_term.academicYear}}, and you must do this at an All Volunteers Training or All CELTS Training (Labor).

- {% elif (g.current_user.isAdmin or g.current_user.hasCurrentCeltsLabor) %} + {% elif isLaborViewer %}

To volunteer, {{volunteer.fullName}} must sign the CELTS handbook for {{g.current_term.academicYear}}, and they must do this at an All Volunteers Training or All CELTS Training (Labor).

{% endif %} - {% else %} - {% if handbookOverdue %} -
Sign the handbook
- {% else %} -

Your handbook signature is good for AY {{volunteer.signatureTerm.academicYear}}.

- {% endif %} - - {% if g.current_term.volunteerHandbook %} - {% if handbookOverdue and g.current_user.username == volunteer.username %} + + {% elif handbookOverdue %} +
Sign the handbook
+ {% if handbookAvailable %} + {% if isOwnProfile %}
@@ -871,13 +866,19 @@
Sign the handbook

Handbook signed for AY {{g.current_term.academicYear}}!

+ {% else %} +

{{ volunteer.fullName }} has attended the training but they still need to sign the CELTS handbook for {{ g.current_term.academicYear }}.

{% endif %} {% endif %} + {% else %} +

+ {% if isOwnProfile %} Your handbook signature is good for AY {% else %} {{ volunteer.fullName }}'s handbook signature is good for AY {% endif %} {{ volunteer.signatureTerm.academicYear }}. +

+ {% endif %} - {% endif %}