From 0b6e0bc8e6cbc53f6512d90f0782a7c418c81aaa Mon Sep 17 00:00:00 2001 From: julio jijon Date: Tue, 10 Jun 2025 16:58:22 -0400 Subject: [PATCH 001/103] changed accordions updated accordion displays --- app/templates/main/userProfile.html | 96 +++++++++++++++++++++-------- 1 file changed, 71 insertions(+), 25 deletions(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 91831a07f..7977a61cb 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -35,10 +35,10 @@

{{volunteer.firstName}} {{volunteer.lastName}}

{{volunteer.bnumber}}
{{volunteer.email}}
-
+
{% if volunteer.major -%} @@ -54,29 +54,48 @@

{{volunteer.firstName}} {{volunteer.lastName}}

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

+ {% set focus = "open" if visibleAccordion == "userInfo" else "collapsed" %} + +

+ {% set show = "show" if visibleAccordion == "action" else ""%} +
+
+
+ + Edit +
+ {% if volunteer == g.current_user or g.current_user.isCeltsAdmin %} + + + {% endif %} + {% if g.current_user.isAdmin %} + + {% endif %}   + +
+
+
+ + +
+
+ +
+
+ +
-
-
@@ -431,7 +450,7 @@

-
+ @@ -524,6 +543,33 @@
Requirement Progress
{% endif %} + + + + + +

From 038c1cd9d68088ce832c6ec698d14e62761af765 Mon Sep 17 00:00:00 2001 From: julio jijon Date: Wed, 11 Jun 2025 11:10:17 -0400 Subject: [PATCH 002/103] changed design --- app/templates/main/userProfile.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 7977a61cb..0c90001f0 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -94,7 +94,7 @@

{% endif %} -->

-
+ From b45cdec1a52607fca2972c2b1d4ec79a2cfffe27 Mon Sep 17 00:00:00 2001 From: julio jijon Date: Wed, 11 Jun 2025 14:56:58 -0400 Subject: [PATCH 003/103] added user information accordion and changed the design --- app/templates/main/userProfile.html | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 0c90001f0..027e08ce4 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -62,25 +62,26 @@

{{volunteer.firstName}} {{volunteer.lastName}}

{% set focus = "open" if visibleAccordion == "userInfo" else "collapsed" %} - +

{% set show = "show" if visibleAccordion == "action" else ""%}
-
- - Edit -
+
+ + Edit +
{% if volunteer == g.current_user or g.current_user.isCeltsAdmin %} - - +

{{'Edit' if volunteer == g.current_user else 'View'}} Emergency Contact

+

{{'Edit' if volunteer == g.current_user else 'View'}} Insurance Information

{% endif %} {% if g.current_user.isAdmin %} - - {% endif %}   - +

Manage CCE Minor

+ {% endif %} +
+

Dietary Restrictions

From 832596ff5575c1a268aab979a12b64f40243ce1e Mon Sep 17 00:00:00 2001 From: julio jijon Date: Wed, 11 Jun 2025 15:50:24 -0400 Subject: [PATCH 004/103] changed where print travel form manage cce minor links are at --- app/templates/main/userProfile.html | 74 ++++------------------------- 1 file changed, 10 insertions(+), 64 deletions(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 027e08ce4..ededad889 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -35,10 +35,6 @@

{{volunteer.firstName}} {{volunteer.lastName}}

{{volunteer.bnumber}}
{{volunteer.email}}
-
{% if volunteer.major -%} @@ -75,13 +71,10 @@

{{'Edit' if volunteer == g.current_user else 'View'}} Emergency Contact

{{'Edit' if volunteer == g.current_user else 'View'}} Insurance Information

{% endif %} - {% if g.current_user.isAdmin %} -

Manage CCE Minor

- {% endif %}
-

Dietary Restrictions

+

Dietary Restrictions

@@ -90,10 +83,6 @@

-

@@ -109,6 +98,10 @@

+ {% if volunteer == g.current_user or g.current_user.isCeltsAdmin %} +

Print Travel Form

+
+ {% endif %} {% if upcomingEvents|length > 0 %} @@ -168,6 +161,11 @@

Program
+

View Service Transcript

+ {% if g.current_user.isAdmin %} +

Manage CCE Minor

+ {% endif %} +
{% if participatedEvents|length > 0 %} @@ -450,32 +448,6 @@

- - - - {% set canViewBonner = (g.current_user.isCeltsAdmin or g.current_user == volunteer) %} {% if volunteer.isBonnerScholar and canViewBonner %} @@ -545,32 +517,6 @@

Requirement Progress
{% endif %} - - - - - From 8975b7a21b35deaf887670cd7c6559ee9ebddece Mon Sep 17 00:00:00 2001 From: julio jijon Date: Thu, 12 Jun 2025 11:02:58 -0400 Subject: [PATCH 005/103] changed p tags to buttons and put them into columns --- app/templates/main/userProfile.html | 48 +++++++++++++++++++---------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index ededad889..bacb1e9c4 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -10,7 +10,7 @@ {% block styles %} {{super()}} - + {% endblock %} {% block app_content %} @@ -58,21 +58,29 @@

{{volunteer.firstName}} {{volunteer.lastName}}

{% set focus = "open" if visibleAccordion == "userInfo" else "collapsed" %} - +

{% set show = "show" if visibleAccordion == "action" else ""%}
-
- - Edit -
- {% if volunteer == g.current_user or g.current_user.isCeltsAdmin %} -

{{'Edit' if volunteer == g.current_user else 'View'}} Emergency Contact

-

{{'Edit' if volunteer == g.current_user else 'View'}} Insurance Information

- {% endif %} -
-
+
+
+
+ + Edit +
+
+ {% if volunteer == g.current_user or g.current_user.isCeltsAdmin %} + + + {% endif %} +
+
+

Dietary Restrictions

@@ -99,7 +107,7 @@

Program
{% if volunteer == g.current_user or g.current_user.isCeltsAdmin %} -

Print Travel Form

+
{% endif %} {% if upcomingEvents|length > 0 %} @@ -159,12 +167,18 @@

{% set show = "show" if visibleAccordion == "history" else "" %}
+
+ +
+ {% if g.current_user.isAdmin %} + + {% endif %} +
+

-

View Service Transcript

- {% if g.current_user.isAdmin %} -

Manage CCE Minor

- {% endif %}
{% if participatedEvents|length > 0 %} From 1c59444d248d5643bc80ff24b3c33f67e23f4bd3 Mon Sep 17 00:00:00 2001 From: julio jijon Date: Thu, 12 Jun 2025 11:17:38 -0400 Subject: [PATCH 006/103] changed button sizing --- app/templates/main/userProfile.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index bacb1e9c4..4d9b0f091 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -74,7 +74,7 @@

-

{% if volunteer == g.current_user or g.current_user.isCeltsAdmin %} - +
{% endif %} {% if upcomingEvents|length > 0 %} @@ -169,11 +169,11 @@

{% if g.current_user.isAdmin %} - + {% endif %}
From 40b50496c07ee6cecb2062de97db4b7e8a125bc4 Mon Sep 17 00:00:00 2001 From: julio jijon Date: Thu, 12 Jun 2025 13:58:34 -0400 Subject: [PATCH 007/103] changed edit phone number element to icon and save phone number to icon --- app/static/js/base.js | 8 ++++---- app/templates/main/userProfile.html | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/static/js/base.js b/app/static/js/base.js index 23091fdb4..077589330 100644 --- a/app/static/js/base.js +++ b/app/static/js/base.js @@ -47,7 +47,7 @@ function msgToast(head, body){ function setupPhoneNumber(editButtonId, phoneInput){ $(editButtonId).on('click', function() { var username = $(this).data("username") - if ($(editButtonId).html() === 'Edit'){ + if ($(editButtonId).html() === ''){ $(phoneInput).focus(); } else{ @@ -70,7 +70,7 @@ function setupPhoneNumber(editButtonId, phoneInput){ function processPhoneSetup (editButtonId, phoneInputId, username, action) { if (action == "edit" ) { - $(editButtonId).html("Save"); + $(editButtonId).html(''); } else if (action == "save" ) { validatePhoneNumber(editButtonId, phoneInputId, username) @@ -78,7 +78,7 @@ function processPhoneSetup (editButtonId, phoneInputId, username, action) { else if (action == "restore"){ var phoneInput = $(phoneInputId); $(phoneInputId).val(phoneInput.attr("data-value")) - $(editButtonId).html('Edit'); + $(editButtonId).html(''); } } @@ -121,7 +121,7 @@ function validatePhoneNumber(editButtonId, phoneInputId, username) { }, }) - $(editButtonId).html('Edit'); + $(editButtonId).html(''); } function reloadWithAccordion(accordionName) { diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 4d9b0f091..5224b036b 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -64,10 +64,10 @@

-
+
- - Edit + +
{% if volunteer == g.current_user or g.current_user.isCeltsAdmin %} @@ -81,16 +81,16 @@


- -

Dietary Restrictions

-
- - -
-
- - -
+
+

Dietary Restrictions

+
+ + +
+
+ + +

From 8bfec02050d867e526bb610d703525c861822c43 Mon Sep 17 00:00:00 2001 From: julio jijon Date: Thu, 12 Jun 2025 14:00:58 -0400 Subject: [PATCH 008/103] more changes to html icons --- app/templates/main/userProfile.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 5224b036b..9fcdbb63c 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -64,9 +64,9 @@

-
+
- +
From 4ee76335ac56b172ecac420b02f7012721db4ce8 Mon Sep 17 00:00:00 2001 From: julio jijon Date: Thu, 12 Jun 2025 14:06:39 -0400 Subject: [PATCH 009/103] changed tag from volunteer information to edit volunteer information --- app/templates/main/userProfile.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 9fcdbb63c..5726d1bbf 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -58,7 +58,7 @@

{{volunteer.firstName}} {{volunteer.lastName}}

{% set focus = "open" if visibleAccordion == "userInfo" else "collapsed" %} - +

{% set show = "show" if visibleAccordion == "action" else ""%}
From d5f767d6550e4ff888dd726c4e94b1c952d49397 Mon Sep 17 00:00:00 2001 From: julio jijon Date: Thu, 12 Jun 2025 14:40:16 -0400 Subject: [PATCH 010/103] added accessibility to icons --- app/static/js/base.js | 8 ++++---- app/templates/main/userProfile.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/static/js/base.js b/app/static/js/base.js index 077589330..a767b616f 100644 --- a/app/static/js/base.js +++ b/app/static/js/base.js @@ -47,7 +47,7 @@ function msgToast(head, body){ function setupPhoneNumber(editButtonId, phoneInput){ $(editButtonId).on('click', function() { var username = $(this).data("username") - if ($(editButtonId).html() === ''){ + if ($(editButtonId).html() === 'Edit'){ $(phoneInput).focus(); } else{ @@ -70,7 +70,7 @@ function setupPhoneNumber(editButtonId, phoneInput){ function processPhoneSetup (editButtonId, phoneInputId, username, action) { if (action == "edit" ) { - $(editButtonId).html(''); + $(editButtonId).html('Save'); } else if (action == "save" ) { validatePhoneNumber(editButtonId, phoneInputId, username) @@ -78,7 +78,7 @@ function processPhoneSetup (editButtonId, phoneInputId, username, action) { else if (action == "restore"){ var phoneInput = $(phoneInputId); $(phoneInputId).val(phoneInput.attr("data-value")) - $(editButtonId).html(''); + $(editButtonId).html('Edit'); } } @@ -121,7 +121,7 @@ function validatePhoneNumber(editButtonId, phoneInputId, username) { }, }) - $(editButtonId).html(''); + $(editButtonId).html('Edit'); } function reloadWithAccordion(accordionName) { diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 5726d1bbf..a17d2adf7 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -67,7 +67,7 @@

- + Edit
{% if volunteer == g.current_user or g.current_user.isCeltsAdmin %} From b0e314aa09c3eaab3414e0f2fc29b2bb19b890b4 Mon Sep 17 00:00:00 2001 From: julio jijon Date: Thu, 12 Jun 2025 15:31:48 -0400 Subject: [PATCH 011/103] removed some whitespace --- app/templates/main/userProfile.html | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index a17d2adf7..455397cac 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -55,9 +55,10 @@

{{volunteer.firstName}} {{volunteer.lastName}}

+

- {% set focus = "open" if visibleAccordion == "userInfo" else "collapsed" %} + {% set focus = "open" if visibleAccordion == "userInfo" else "collapsed" %}

{% set show = "show" if visibleAccordion == "action" else ""%} @@ -94,6 +95,7 @@

+
@@ -107,9 +109,9 @@

{% if volunteer == g.current_user or g.current_user.isCeltsAdmin %} - -
- {% endif %} + +
+ {% endif %} {% if upcomingEvents|length > 0 %} @@ -129,7 +131,6 @@

{% if event.isPastEnd %} {% set eventStatus = 'past-event' %} {% endif %} -

@@ -193,7 +194,7 @@

{% endfor %} - {% else %} + {% else %}
You have not participated in any events.
{% endif %}
Program
{{event.program.programName if event.program else '--'}} {{event.name}}{{event.startDate.strftime('%m/%d/%Y')}}
@@ -266,8 +267,6 @@

{% endif %} - - {% endif %} {% endfor %} @@ -492,7 +491,6 @@

{{address}} Upcoming Bonner Events

No RSVPs for any upcoming Bonner events.

{% endif %}
- {# Bonner Notes #}
Notes
{% set bonnerNotes = profileNotes|selectattr("isBonnerNote")|list %} @@ -508,7 +506,6 @@
Notes
{% endif %}
- {# Bonner Requirements #}
Requirement Progress
From 70f6e86f3588bce7e5f98855887a36f5919f4c16 Mon Sep 17 00:00:00 2001 From: julio jijon Date: Thu, 12 Jun 2025 15:35:09 -0400 Subject: [PATCH 012/103] cleaned up code --- app/templates/main/userProfile.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 455397cac..c2ae28d8a 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -10,7 +10,6 @@ {% block styles %} {{super()}} - {% endblock %} {% block app_content %} @@ -52,7 +51,6 @@

{{volunteer.firstName}} {{volunteer.lastName}}

  -
@@ -529,7 +527,6 @@
Requirement Progress
- {%endif%}

+
 
@@ -536,7 +539,7 @@
Requirement Progress
- -
 
- - - -

@@ -642,7 +599,6 @@

- {% if volunteer == g.current_user or g.current_user.isCeltsAdmin %}
@@ -653,9 +609,7 @@
{% endif %} -
-

Dietary Restrictions

From 3bd31b220e13e3f9ec0e63139abe51680ac0489d Mon Sep 17 00:00:00 2001 From: shenderaz Date: Fri, 13 Jun 2025 11:28:38 -0400 Subject: [PATCH 016/103] Change some HTML and JS --- app/static/js/userProfile.js | 4 ++-- app/templates/main/userProfile.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/static/js/userProfile.js b/app/static/js/userProfile.js index e5c459caa..e412cadd6 100644 --- a/app/static/js/userProfile.js +++ b/app/static/js/userProfile.js @@ -312,7 +312,7 @@ $(document).ready(function(){ setupPhoneNumber("#updatePhone", "#phoneInput") - $(".saveDiet").on('click', function() { + $("#diet").on('change', function() { let data = { dietInfo: $("#diet").val(), user: $(this).data("user") @@ -322,7 +322,7 @@ $(document).ready(function(){ url: "/updateDietInformation", data: data, success: function(s){ - reloadWithAccordion("dietaryInformation"); + reloadWithAccordion("dietaryInformation"); //fixme }, }) }); diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 40917c4b5..a777eafe3 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -615,11 +615,11 @@
- +

- +
From 59b86fc2e83a981c49f5fa45d1aa34ea098cb27e Mon Sep 17 00:00:00 2001 From: julio jijon Date: Fri, 13 Jun 2025 13:08:26 -0400 Subject: [PATCH 017/103] removed save dietary information button and set autosave instead --- app/static/js/userProfile.js | 14 +++++++++++++- app/templates/main/userProfile.html | 5 +---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/static/js/userProfile.js b/app/static/js/userProfile.js index e412cadd6..88d8aff5e 100644 --- a/app/static/js/userProfile.js +++ b/app/static/js/userProfile.js @@ -322,7 +322,19 @@ $(document).ready(function(){ url: "/updateDietInformation", data: data, success: function(s){ - reloadWithAccordion("dietaryInformation"); //fixme + const para = document.createElement('i'); + para.className = 'bi bi-check'; + para.id = 'check_icon'; + const node = document.createTextNode('Saved!'); + para.appendChild(node); + + const element = document.getElementById("diet-form"); + element.appendChild(para); + setTimeout(function() { + $(".bi.bi-check").fadeOut(500, function() { + $(this).remove(); + }); + }, 1000); }, }) }); diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index a777eafe3..99c8af2a1 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -610,7 +610,7 @@
{% endif %}
-
+

Dietary Restrictions

@@ -618,9 +618,6 @@

-
- -
From 2890364b4b84c727f5140db5a8fe3a326fdcc257 Mon Sep 17 00:00:00 2001 From: shenderaz Date: Fri, 13 Jun 2025 14:18:33 -0400 Subject: [PATCH 018/103] fixed cce minor accordion design --- app/templates/main/userProfile.html | 44 ++++++++++++++--------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index c76afe5b7..546535df3 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -67,25 +67,31 @@

-
-
-
- - - - -

Did you know we have a Community and Civic Engagement Minor? Click - here - for more information. -

- - - +
+
+
+ {% if g.current_user.isAdmin %} + + {% endif %} +
+
+
+ +
+ + +
+
+

Did you know we have a Community and Civic Engagement Minor? Click + here + for more information. +

-
+
+
- +
@@ -162,11 +168,6 @@

-
- {% if g.current_user.isAdmin %} - - {% endif %} -

@@ -189,7 +190,6 @@
You have not participated in any events.
{% endif %}
-
From dd655ac29acfa3a84134c1e2954040aa97ece989 Mon Sep 17 00:00:00 2001 From: shenderaz Date: Fri, 13 Jun 2025 14:34:28 -0400 Subject: [PATCH 019/103] fixed focus on the accordions --- app/templates/main/userProfile.html | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 546535df3..a38990394 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -37,36 +37,18 @@

{{volunteer.firstName}} {{volunteer.lastName}}

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

+ {% set focus = "open" if visibleAccordion == "cce_minor" else "collapsed" %}

+ {% set show = "show" if visibleAccordion == "cce_minor" else "" %}
From 4e741abb1f6bbe4b71768a85a35440daaed6e34a Mon Sep 17 00:00:00 2001 From: shenderaz Date: Fri, 13 Jun 2025 14:40:07 -0400 Subject: [PATCH 020/103] Fixed the hr tag in the cce accordion. --- app/templates/main/userProfile.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index a38990394..6f992d40d 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -54,9 +54,9 @@

{% if g.current_user.isAdmin %} +
{% endif %}
-
From f1563536d15bb5bd6c73a792cc547362ef871b91 Mon Sep 17 00:00:00 2001 From: julio jijon Date: Wed, 18 Jun 2025 09:41:39 -0400 Subject: [PATCH 021/103] changed code based on the pr messages --- app/static/js/base.js | 8 ++++---- app/static/js/userProfile.js | 13 +++++-------- app/templates/main/userProfile.html | 12 ++++++------ 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/app/static/js/base.js b/app/static/js/base.js index a767b616f..8f3662ac5 100644 --- a/app/static/js/base.js +++ b/app/static/js/base.js @@ -47,7 +47,7 @@ function msgToast(head, body){ function setupPhoneNumber(editButtonId, phoneInput){ $(editButtonId).on('click', function() { var username = $(this).data("username") - if ($(editButtonId).html() === 'Edit'){ + if ($(editButtonId).html() === 'Edit'){ $(phoneInput).focus(); } else{ @@ -70,7 +70,7 @@ function setupPhoneNumber(editButtonId, phoneInput){ function processPhoneSetup (editButtonId, phoneInputId, username, action) { if (action == "edit" ) { - $(editButtonId).html('Save'); + $(editButtonId).html('Save'); } else if (action == "save" ) { validatePhoneNumber(editButtonId, phoneInputId, username) @@ -78,7 +78,7 @@ function processPhoneSetup (editButtonId, phoneInputId, username, action) { else if (action == "restore"){ var phoneInput = $(phoneInputId); $(phoneInputId).val(phoneInput.attr("data-value")) - $(editButtonId).html('Edit'); + $(editButtonId).text('Edit'); } } @@ -121,7 +121,7 @@ function validatePhoneNumber(editButtonId, phoneInputId, username) { }, }) - $(editButtonId).html('Edit'); + $(editButtonId).html('Edit'); } function reloadWithAccordion(accordionName) { diff --git a/app/static/js/userProfile.js b/app/static/js/userProfile.js index 734adf2a3..a0c16de62 100644 --- a/app/static/js/userProfile.js +++ b/app/static/js/userProfile.js @@ -330,14 +330,11 @@ $(document).ready(function(){ url: "/updateDietInformation", data: data, success: function(s){ - const para = document.createElement('i'); - para.className = 'bi bi-check'; - para.id = 'check_icon'; - const node = document.createTextNode('Saved!'); - para.appendChild(node); - - const element = document.getElementById("diet-form"); - element.appendChild(para); + $('', { + class: 'bi bi-check', + id: 'check-icon', + text: 'Saved!' + }).appendTo('#diet-form'); setTimeout(function() { $(".bi.bi-check").fadeOut(500, function() { $(this).remove(); diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 6f992d40d..d0ae66112 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -21,7 +21,7 @@

{{volunteer.firstName}} {{volunteer.lastName}}

{{volunteer.bnumber}}
{{volunteer.email}}
- Edit Volunteer Information + Edit Volunteer Information
{% if volunteer.major -%} @@ -87,7 +87,7 @@

{% if volunteer == g.current_user or g.current_user.isCeltsAdmin %} - +
{% endif %} {% if upcomingEvents|length > 0 %} @@ -148,7 +148,7 @@

@@ -611,17 +611,17 @@
- Edit + Edit
{% if volunteer == g.current_user or g.current_user.isCeltsAdmin %} {% endif %} From 2874c2b2fadf172aa049ee6c52817f1535023149 Mon Sep 17 00:00:00 2001 From: julio jijon Date: Wed, 18 Jun 2025 10:52:13 -0400 Subject: [PATCH 022/103] fixed the saved! text in the js file --- app/static/js/userProfile.js | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/app/static/js/userProfile.js b/app/static/js/userProfile.js index a0c16de62..0014bf6ea 100644 --- a/app/static/js/userProfile.js +++ b/app/static/js/userProfile.js @@ -320,30 +320,42 @@ $(document).ready(function(){ setupPhoneNumber("#updatePhone", "#phoneInput") - $("#diet").on('change', function() { + var typingTimer; + var doneTypingInterval = 750; + var $dietInput = $('#diet'); + +$dietInput.on('input', function() { + clearTimeout(typingTimer); + $('#check-icon').remove(); + + typingTimer = setTimeout(function() { let data = { - dietInfo: $("#diet").val(), - user: $(this).data("user") - } + dietInfo: $dietInput.val(), + user: $dietInput.data("user") + }; + $.ajax({ type: "POST", url: "/updateDietInformation", data: data, - success: function(s){ + success: function(s) { + $('#check-icon').remove(); $('', { class: 'bi bi-check', id: 'check-icon', text: 'Saved!' }).appendTo('#diet-form'); + setTimeout(function() { - $(".bi.bi-check").fadeOut(500, function() { + $('#check-icon').fadeOut('slow', function() { $(this).remove(); }); - }, 1000); - }, - }) - }); - + }, 2000); + } + }); + }, doneTypingInterval); +}); + }); function updateManagers(el, volunteerUsername ){// retrieve the data of the student staff and program id if the boxes are checked or not From 71d3c648b4a8fd777fc3a3d353b422aed20a054c Mon Sep 17 00:00:00 2001 From: mathew2005 Date: Thu, 3 Jul 2025 16:55:29 -0400 Subject: [PATCH 023/103] Added the danger message to the event template for students staff who are not program managers. Note: Create Event option in the sidebar needs to be hidden when the user is a student staff but doesn't have any program to manage --- app/templates/events/templateSelector.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/templates/events/templateSelector.html b/app/templates/events/templateSelector.html index 7f74185b2..5baeb9a67 100644 --- a/app/templates/events/templateSelector.html +++ b/app/templates/events/templateSelector.html @@ -14,16 +14,22 @@

Shortcuts

+{% if programs %}

Programs

-
+
{% for program in programs %} - {{ program.programName }} + {{ program.programName }} {% endfor %}
-{% endblock %} \ No newline at end of file +{% else %} + +{% endif %} +{% endblock %} \ No newline at end of file From ec9e811bda6508a6e0fd8abf071152ab6aa49e60 Mon Sep 17 00:00:00 2001 From: julio jijon Date: Tue, 8 Jul 2025 13:39:50 -0400 Subject: [PATCH 024/103] fixed some issues --- app/static/js/userProfile.js | 5 ++--- app/templates/main/userProfile.html | 34 ----------------------------- 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/app/static/js/userProfile.js b/app/static/js/userProfile.js index 6bc37c7ee..63bb5a569 100644 --- a/app/static/js/userProfile.js +++ b/app/static/js/userProfile.js @@ -322,7 +322,7 @@ $(document).ready(function(){ $("#dietContainer").hide(); $("#diet").val("No dietary restrictions"); - + } var typingTimer; var doneTypingInterval = 750; var $dietInput = $('#diet'); @@ -391,5 +391,4 @@ function updateManagers(el, volunteerUsername ){// retrieve the data of the stud } - - +}); \ No newline at end of file diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 7fa166519..f76ea9254 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -41,40 +41,6 @@

{{volunteer.firstName}} {{volunteer.lastName}}

- -
-

- {% set focus = "open" if visibleAccordion == "cce_minor" else "collapsed" %} - -

- {% set show = "show" if visibleAccordion == "cce_minor" else "" %} -
-
-
- {% if g.current_user.isAdmin %} - -
- {% endif %} -
-
- -
- - -
-
-

Did you know we have a Community and Civic Engagement Minor? Click - here - for more information. -

-
-
-
-
-
- - {% if g.current_user.isStudent %}
From 09d69bb81917b6676a2e81ec393b2674820f497b Mon Sep 17 00:00:00 2001 From: julio jijon Date: Tue, 8 Jul 2025 14:26:43 -0400 Subject: [PATCH 025/103] fixed everything --- app/static/js/userProfile.js | 15 +++++++++++++-- app/templates/main/userProfile.html | 11 ++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/app/static/js/userProfile.js b/app/static/js/userProfile.js index 63bb5a569..0df68306c 100644 --- a/app/static/js/userProfile.js +++ b/app/static/js/userProfile.js @@ -1,4 +1,15 @@ $(document).ready(function(){ + $("#checkDietRestriction").on("change", function() { + let norestrict = $(this).is(':checked'); + if (norestrict) { + $("#dietContainer").hide(); + $("#diet").val("No dietary restrictions"); + + } else { + $("#dietContainer").show(); + } + }); + $("#checkIsInterest").on("change", function() { let username = $(this).data('username') let isAdding = $(this).is(':checked'); @@ -321,8 +332,8 @@ $(document).ready(function(){ if (norestrict) { $("#dietContainer").hide(); $("#diet").val("No dietary restrictions"); - } + var typingTimer; var doneTypingInterval = 750; var $dietInput = $('#diet'); @@ -347,7 +358,7 @@ $dietInput.on('input', function() { class: 'bi bi-check', id: 'check-icon', text: 'Saved!' - }).appendTo('#diet-form'); + }).appendTo('#dietContainer'); setTimeout(function() { $('#check-icon').fadeOut('slow', function() { diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index f76ea9254..409dc1463 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -626,11 +626,16 @@
{% endif %}
-
-

Dietary Restrictions

+

Dietary Restrictions

+
+ + +
+
+
- +

From 8efb32374b2b8b8a2e054089a38018c24ce0762b Mon Sep 17 00:00:00 2001 From: mathew2005 Date: Fri, 11 Jul 2025 16:26:03 -0400 Subject: [PATCH 026/103] Added global data so sidebar can acess Program Manager data. Still needs to be turned into meaningful data to serve as a check for the Create Event List in the sidebar --- app/controllers/__init__.py | 22 ++++++++++++++++++++-- app/templates/sidebar.html | 4 ++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/controllers/__init__.py b/app/controllers/__init__.py index f55b95fb2..bd28849e1 100644 --- a/app/controllers/__init__.py +++ b/app/controllers/__init__.py @@ -1,8 +1,9 @@ from app import app import os #from app.login_manager import require_login - - +from app.models.programManager import ProgramManager +from app.models.user import User +from flask import g #@app.context_processor #def injectGlobalData(): #currentUser = require_login() @@ -11,3 +12,20 @@ # for f in files)) #return {'currentUser': currentUser, # 'lastStaticUpdate': lastStaticUpdate} + +@app.context_processor +def injectGlobalData(): + return { + "programManager" : ProgramManager + .select(ProgramManager, User) + .join(User) + .where(User.username == g.current_user) + .execute(), + "currentUser": g.current_user + } + + +# user = (User.select(User, EmergencyContact, InsuranceInfo) +# .join(EmergencyContact, JOIN.LEFT_OUTER).switch() +# .join(InsuranceInfo, JOIN.LEFT_OUTER) +# .where(User.username == username).limit(1)) \ No newline at end of file diff --git a/app/templates/sidebar.html b/app/templates/sidebar.html index ba2185483..587ed99cd 100644 --- a/app/templates/sidebar.html +++ b/app/templates/sidebar.html @@ -48,6 +48,10 @@ {% endif %} +
  • + {{programManager}} + {{currentUser}} +
  • {% if g.current_user.isCeltsAdmin %}
  • {% endif %} - - {% if g.current_user.isAdmin %} + {% if g.current_user.isCeltsAdmin or (g.current_user.isCeltsStudentStaff and isprogramManager)%}
  • Create Event
  • + {% endif %} + {% if g.current_user.isAdmin %}
  • Student Search @@ -49,8 +50,6 @@ {% endif %}
  • - {{programManager}} - {{currentUser}}
  • {% if g.current_user.isCeltsAdmin %} From d842c2ea99cf1988f6fa671badff4221afa105de Mon Sep 17 00:00:00 2001 From: mathew2005 Date: Tue, 15 Jul 2025 09:46:46 -0400 Subject: [PATCH 028/103] Cleaned up commented out and unnecessary code written from earlier commits --- app/controllers/__init__.py | 8 +------- app/templates/sidebar.html | 4 +--- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/app/controllers/__init__.py b/app/controllers/__init__.py index f97c69a70..767577c04 100644 --- a/app/controllers/__init__.py +++ b/app/controllers/__init__.py @@ -16,10 +16,4 @@ @app.context_processor def injectGlobalData(): isprogramManager = True if list(ProgramManager.select(ProgramManager, User).join(User).where(User.username == g.current_user).execute()) else False - return {"isprogramManager" : isprogramManager} - - -# user = (User.select(User, EmergencyContact, InsuranceInfo) -# .join(EmergencyContact, JOIN.LEFT_OUTER).switch() -# .join(InsuranceInfo, JOIN.LEFT_OUTER) -# .where(User.username == username).limit(1)) \ No newline at end of file + return {"isprogramManager" : isprogramManager} \ No newline at end of file diff --git a/app/templates/sidebar.html b/app/templates/sidebar.html index f512d7f1e..c957cfd45 100644 --- a/app/templates/sidebar.html +++ b/app/templates/sidebar.html @@ -29,7 +29,7 @@
  • {% endif %} - {% if g.current_user.isCeltsAdmin or (g.current_user.isCeltsStudentStaff and isprogramManager)%} + {% if g.current_user.isCeltsAdmin or (g.current_user.isCeltsStudentStaff and isprogramManager) %}
  • Create Event @@ -49,8 +49,6 @@ {% endif %}
  • -
  • -
  • {% if g.current_user.isCeltsAdmin %}
  • {% endif %} - {% if g.current_user.isCeltsAdmin or (g.current_user.isCeltsStudentStaff and isprogramManager) %} + {% if g.current_user.isCeltsAdmin or (g.current_user.isCeltsStudentStaff and isProgramManager) %}
  • Create Event From b218067aba0d44a284d29d732a85e1a101e2d779 Mon Sep 17 00:00:00 2001 From: mathew2005 Date: Tue, 15 Jul 2025 14:26:43 -0400 Subject: [PATCH 030/103] Used another method of checking if a student staff is program manager by reusing code that was written earlier in the User model --- app/templates/sidebar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/sidebar.html b/app/templates/sidebar.html index 2c1583021..8092de6e5 100644 --- a/app/templates/sidebar.html +++ b/app/templates/sidebar.html @@ -29,7 +29,7 @@
  • {% endif %} - {% if g.current_user.isCeltsAdmin or (g.current_user.isCeltsStudentStaff and isProgramManager) %} + {% if g.current_user.isCeltsAdmin or (g.current_user.isCeltsStudentStaff and g.current_user.isProgramManager) %}
  • Create Event From 18c1967871188859629c96669d479b8ea7d20f91 Mon Sep 17 00:00:00 2001 From: mathew2005 Date: Tue, 15 Jul 2025 14:29:22 -0400 Subject: [PATCH 031/103] removed no longer used code to inject global data --- app/controllers/__init__.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app/controllers/__init__.py b/app/controllers/__init__.py index 4631fbb78..ed2f8d89f 100644 --- a/app/controllers/__init__.py +++ b/app/controllers/__init__.py @@ -1,9 +1,7 @@ from app import app import os #from app.login_manager import require_login -from app.models.programManager import ProgramManager -from app.models.user import User -from flask import g + #@app.context_processor #def injectGlobalData(): #currentUser = require_login() @@ -11,9 +9,4 @@ # for root_path, dirs, files in os.walk('app/static') # for f in files)) #return {'currentUser': currentUser, - # 'lastStaticUpdate': lastStaticUpdate} - -@app.context_processor -def injectGlobalData(): - isProgramManager = True if list(ProgramManager.select(ProgramManager, User).join(User).where(User.username == g.current_user).execute()) else False - return {"isProgramManager" : isProgramManager} \ No newline at end of file + # 'lastStaticUpdate': lastStaticUpdate} \ No newline at end of file From b34ffd9fb3e101e98bd79b9f10b0e0b780810075 Mon Sep 17 00:00:00 2001 From: chapagainp Date: Fri, 18 Jul 2025 14:29:23 -0400 Subject: [PATCH 032/103] Changes other Events to Celts Labor with the events that are marked Labor Only --- app/controllers/main/routes.py | 14 +++++++------- app/logic/events.py | 8 ++++---- app/logic/landingPage.py | 2 +- app/static/js/eventList.js | 4 ++-- app/templates/events/eventList.html | 14 ++++++++------ tests/code/test_event_list.py | 12 ++++++------ 6 files changed, 28 insertions(+), 26 deletions(-) diff --git a/app/controllers/main/routes.py b/app/controllers/main/routes.py index 997840c38..d4c1ffa59 100644 --- a/app/controllers/main/routes.py +++ b/app/controllers/main/routes.py @@ -26,7 +26,7 @@ from app.models.courseInstructor import CourseInstructor from app.models.backgroundCheckType import BackgroundCheckType -from app.logic.events import getUpcomingEventsForUser, getParticipatedEventsForUser, getTrainingEvents, getEventRsvpCountsForTerm, getUpcomingStudentLedCount, getStudentLedEvents, getBonnerEvents, getOtherEvents, getEngagementEvents +from app.logic.events import getUpcomingEventsForUser, getParticipatedEventsForUser, getTrainingEvents, getEventRsvpCountsForTerm, getUpcomingStudentLedCount, getStudentLedEvents, getBonnerEvents, getCeltsLabor, getEngagementEvents from app.logic.transcript import * from app.logic.loginManager import logout from app.logic.searchUsers import searchUsers @@ -90,7 +90,7 @@ def events(selectedTerm, activeTab, programID): trainingEvents = getTrainingEvents(term, g.current_user) engagementEvents = getEngagementEvents(term) bonnerEvents = getBonnerEvents(term) - otherEvents = getOtherEvents(term) + celtsLabor = getCeltsLabor(term) managersProgramDict = getManagerProgramDict(g.current_user) @@ -107,7 +107,7 @@ def events(selectedTerm, activeTab, programID): trainingEventsCount: int = len(trainingEvents) engagementEventsCount: int = len(engagementEvents) bonnerEventsCount: int = len(bonnerEvents) - otherEventsCount: int = len(otherEvents) + celtsLaborCount: int = len(celtsLabor) # gets only upcoming events to display in indicators if (toggleState == 'unchecked'): @@ -121,9 +121,9 @@ def events(selectedTerm, activeTab, programID): for event in bonnerEvents: if event.isPastEnd: bonnerEventsCount -= 1 - for event in otherEvents: + for event in celtsLabor: if event.isPastEnd: - otherEventsCount -= 1 + celtsLaborCount -= 1 # Handle ajax request for Event category header number notifiers and toggle if request.headers.get('X-Requested-With') == 'XMLHttpRequest': @@ -132,7 +132,7 @@ def events(selectedTerm, activeTab, programID): "trainingEventsCount": trainingEventsCount, "engagementEventsCount": engagementEventsCount, "bonnerEventsCount": bonnerEventsCount, - "otherEventsCount": otherEventsCount, + "celtsLaborCount": celtsLaborCount, "toggleStatus": toggleState }) @@ -142,7 +142,7 @@ def events(selectedTerm, activeTab, programID): trainingEvents = trainingEvents, engagementEvents = engagementEvents, bonnerEvents = bonnerEvents, - otherEvents = otherEvents, + celtsLabor = celtsLabor, listOfTerms = listOfTerms, rsvpedEventsID = rsvpedEventsID, currentEventRsvpAmount = currentEventRsvpAmount, diff --git a/app/logic/events.py b/app/logic/events.py index f7e63cfac..4f0ffc050 100644 --- a/app/logic/events.py +++ b/app/logic/events.py @@ -298,17 +298,17 @@ def getBonnerEvents(term): .execute()) return bonnerScholarsEvents -def getOtherEvents(term): +def getCeltsLabor(term): """ Get the list of the events not caught by other functions to be displayed in - the Other Events section of the Events List page. + the Celts Labor section of the Events List page. :return: A list of Other Event objects """ # Gets all events that are not associated with a program and are not trainings # Gets all events that have a program but don't fit anywhere - otherEvents = list(Event.select(Event, Program) + celtsLabor = list(Event.select(Event, Program) .join(Program, JOIN.LEFT_OUTER) .where(Event.term == term, Event.deletionDate == None, Event.isTraining == False, @@ -319,7 +319,7 @@ def getOtherEvents(term): .order_by(Event.startDate, Event.timeStart, Event.id) .execute()) - return otherEvents + return celtsLabor def getUpcomingEventsForUser(user, asOf=datetime.now(), program=None): """ diff --git a/app/logic/landingPage.py b/app/logic/landingPage.py index 2def7672a..fc1973bc6 100644 --- a/app/logic/landingPage.py +++ b/app/logic/landingPage.py @@ -38,4 +38,4 @@ def getActiveEventTab(programID): elif program.isStudentLed: return "studentLedEvents" else: - return "otherEvents" + return "celtsLabor" diff --git a/app/static/js/eventList.js b/app/static/js/eventList.js index a1dbd3f8b..4758916fb 100644 --- a/app/static/js/eventList.js +++ b/app/static/js/eventList.js @@ -88,7 +88,7 @@ function updateIndicatorCounts(isChecked){ const trainingEventsCount = Number(eventsCount.trainingEventsCount); const engagementEventsCount = Number(eventsCount.engagementEventsCount); const bonnerEventsCount = Number(eventsCount.bonnerEventsCount); - const otherEventsCount = Number(eventsCount.otherEventsCount); + const celtsLaborCount = Number(eventsCount.celtsLaborCount); const toggleStatus = eventsCount.toggleStatus; $("#viewPastEventsToggle").prop(toggleStatus, true); @@ -98,7 +98,7 @@ function updateIndicatorCounts(isChecked){ trainingEventsCount > 0 ? $("#trainingEvents").html(`Trainings (${trainingEventsCount})`) : $("#trainingEvents").html(`Trainings`) engagementEventsCount > 0 ? $("#engagementEvents").html(`Education and Engagement (${engagementEventsCount})`) : $("#engagementEvents").html('Education and Engagement') bonnerEventsCount > 0 ? $("#bonnerScholarsEvents").html(`Bonner Scholars (${bonnerEventsCount})`) : $("#bonnerScholarsEvents").html(`Bonner Scholars`) - otherEventsCount > 0 ? $("#otherEvents").html(`Other Events (${otherEventsCount})`) : $("#otherEvents").html(`Other Events`) + celtsLaborCount > 0 ? $("#celtsLabor").html(`Celts Labor (${celtsLaborCount})`) : $("#celtsLabor").html(`Celts Labor`) }, error: function(request, status, error) { console.log(status,error); diff --git a/app/templates/events/eventList.html b/app/templates/events/eventList.html index cdb5586e2..44f0217b3 100644 --- a/app/templates/events/eventList.html +++ b/app/templates/events/eventList.html @@ -67,10 +67,12 @@

    Events List for {{selectedTerm.description}}

    data-bs-toggle="pill" data-bs-target="#pills-bonner-scholars" type="button" role="tab" aria-controls="pills-bonner-scholars" aria-selected="false">Bonner Scholars
  • {% endif %} - + {% if user.isCeltsAdmin or user.isCeltsStudentStaff or user.isLaborOnly %} + + {% endif %}
    @@ -205,8 +207,8 @@

    Events List for {{selectedTerm.description}}

    {{createTable(bonnerEvents, "bonner")}}
    -
    - {{createTable(otherEvents, "other")}} +
    + {{createTable(celtsLabor, "other")}}
    {% include 'events/emailModal.html' %} diff --git a/tests/code/test_event_list.py b/tests/code/test_event_list.py index 8acb9e482..3cfe64bc4 100644 --- a/tests/code/test_event_list.py +++ b/tests/code/test_event_list.py @@ -9,7 +9,7 @@ from app.models.term import Term from app.models.user import User from app.models.eventViews import EventView -from app.logic.events import getStudentLedEvents, getEngagementEvents, getTrainingEvents, getBonnerEvents, getOtherEvents, addEventView, getUpcomingStudentLedCount +from app.logic.events import getStudentLedEvents, getEngagementEvents, getTrainingEvents, getBonnerEvents, getCeltsLabor, addEventView, getUpcomingStudentLedCount @pytest.mark.integration @pytest.fixture @@ -47,7 +47,7 @@ def special_bonner(): @pytest.mark.integration @pytest.fixture -def special_otherEvents(): +def special_celtsLabor(): nonProgramEvent = Event.create(name = "Test for nonProgram", term = 4, description = "Special event test for nonProgram", @@ -292,10 +292,10 @@ def test_getEngagementEvents(): transaction.rollback() @pytest.mark.integration -def test_getOtherEvents(special_otherEvents): - otherEvent = special_otherEvents - otherEvents = [Event.get_by_id(11), Event.get_by_id(7), otherEvent] - assert otherEvents == getOtherEvents(4) +def test_getCeltsLabor(special_celtsLabor): + celtsLabor = special_celtsLabor + celtsLabor = [Event.get_by_id(11), Event.get_by_id(7), celtsLabor] + assert celtsLabor == getCeltsLabor(4) @pytest.mark.integration def test_eventViewCount(): From 155d374373240c478b14c1b15e064637fd63877c Mon Sep 17 00:00:00 2001 From: chapagainp Date: Fri, 18 Jul 2025 14:32:05 -0400 Subject: [PATCH 033/103] 'Student-Led Services' renamed to 'Volunteer Opportunities' --- app/static/js/eventList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/static/js/eventList.js b/app/static/js/eventList.js index 4758916fb..f277fa8ca 100644 --- a/app/static/js/eventList.js +++ b/app/static/js/eventList.js @@ -94,7 +94,7 @@ function updateIndicatorCounts(isChecked){ $("#viewPastEventsToggle").prop(toggleStatus, true); // use ternary operators to populate the tab with a number if there are events, and clear the count if there are none - studentLedEventsCount > 0 ? $("#studentLedEvents").html(`Student-Led Services (${studentLedEventsCount})`) : $("#studentLedEvents").html(`Student-Led Services`) + studentLedEventsCount > 0 ? $("#studentLedEvents").html(`Volunteer Opportunities (${studentLedEventsCount})`) : $("#studentLedEvents").html(`Volunteer Opportunities`) trainingEventsCount > 0 ? $("#trainingEvents").html(`Trainings (${trainingEventsCount})`) : $("#trainingEvents").html(`Trainings`) engagementEventsCount > 0 ? $("#engagementEvents").html(`Education and Engagement (${engagementEventsCount})`) : $("#engagementEvents").html('Education and Engagement') bonnerEventsCount > 0 ? $("#bonnerScholarsEvents").html(`Bonner Scholars (${bonnerEventsCount})`) : $("#bonnerScholarsEvents").html(`Bonner Scholars`) From 2c8b9e0d5a949e3923575257572206d5a3a00445 Mon Sep 17 00:00:00 2001 From: chapagainp Date: Fri, 18 Jul 2025 14:59:09 -0400 Subject: [PATCH 034/103] Changed Student led service and its all occurence to Volunteer Opportunities --- app/controllers/main/routes.py | 22 +++++------ app/logic/events.py | 16 ++++---- app/logic/landingPage.py | 4 +- app/models/program.py | 2 +- app/static/js/eventList.js | 4 +- app/static/js/landingPage.js | 2 +- app/templates/events/eventList.html | 26 ++++++------- app/templates/sidebar.html | 2 +- database/prod-backup.sql | 2 +- database/test_data.py | 20 +++++----- tests/code/test_bonner.py | 2 +- tests/code/test_event_list.py | 58 ++++++++++++++--------------- tests/code/test_events.py | 14 +++---- tests/code/test_landingPage.py | 14 +++---- tests/code/test_users.py | 2 +- 15 files changed, 95 insertions(+), 95 deletions(-) diff --git a/app/controllers/main/routes.py b/app/controllers/main/routes.py index d4c1ffa59..dc72729ef 100644 --- a/app/controllers/main/routes.py +++ b/app/controllers/main/routes.py @@ -26,7 +26,7 @@ from app.models.courseInstructor import CourseInstructor from app.models.backgroundCheckType import BackgroundCheckType -from app.logic.events import getUpcomingEventsForUser, getParticipatedEventsForUser, getTrainingEvents, getEventRsvpCountsForTerm, getUpcomingStudentLedCount, getStudentLedEvents, getBonnerEvents, getCeltsLabor, getEngagementEvents +from app.logic.events import getUpcomingEventsForUser, getParticipatedEventsForUser, getTrainingEvents, getEventRsvpCountsForTerm, getUpcomingVolunteerOpportunitiesCount, getVolunteerOpportunities, getBonnerEvents, getCeltsLabor, getEngagementEvents from app.logic.transcript import * from app.logic.loginManager import logout from app.logic.searchUsers import searchUsers @@ -69,7 +69,7 @@ def landingPage(): def goToEventsList(programID): return {"activeTab": getActiveEventTab(programID)} -@main_bp.route('/eventsList/', methods=['GET'], defaults={'activeTab': "studentLedEvents", 'programID': 0}) +@main_bp.route('/eventsList/', methods=['GET'], defaults={'activeTab': "volunteerOpportunities", 'programID': 0}) @main_bp.route('/eventsList//', methods=['GET'], defaults={'programID': 0}) @main_bp.route('/eventsList///', methods=['GET']) def events(selectedTerm, activeTab, programID): @@ -85,8 +85,8 @@ def events(selectedTerm, activeTab, programID): term: Term = Term.get_by_id(currentTerm) currentEventRsvpAmount = getEventRsvpCountsForTerm(term) - studentLedEvents = getStudentLedEvents(term) - countUpcomingStudentLedEvents = getUpcomingStudentLedCount(term, currentTime) + volunteerOpportunities = getVolunteerOpportunities(term) + countUpcomingVolunteerOpportunities = getUpcomingVolunteerOpportunitiesCount(term, currentTime) trainingEvents = getTrainingEvents(term, g.current_user) engagementEvents = getEngagementEvents(term) bonnerEvents = getBonnerEvents(term) @@ -97,13 +97,13 @@ def events(selectedTerm, activeTab, programID): # Fetch toggle state from session toggleState = request.args.get('toggleState', 'unchecked') - # compile all student led events into one list + # compile all volunteer opportunitiesevents into one list studentEvents = [] - for studentEvent in studentLedEvents.values(): + for studentEvent in volunteerOpportunities.values(): studentEvents += studentEvent # add all contents of studentEvent to the studentEvents list # Get the count of all term events for each category to display in the event list page. - studentLedEventsCount: int = len(studentEvents) + volunteerOpportunitiesCount: int = len(studentEvents) trainingEventsCount: int = len(trainingEvents) engagementEventsCount: int = len(engagementEvents) bonnerEventsCount: int = len(bonnerEvents) @@ -111,7 +111,7 @@ def events(selectedTerm, activeTab, programID): # gets only upcoming events to display in indicators if (toggleState == 'unchecked'): - studentLedEventsCount: int = sum(list(countUpcomingStudentLedEvents.values())) + volunteerOpportunitiesCount: int = sum(list(countUpcomingVolunteerOpportunities.values())) for event in trainingEvents: if event.isPastEnd: trainingEventsCount -= 1 @@ -128,7 +128,7 @@ def events(selectedTerm, activeTab, programID): # Handle ajax request for Event category header number notifiers and toggle if request.headers.get('X-Requested-With') == 'XMLHttpRequest': return jsonify({ - "studentLedEventsCount": studentLedEventsCount, + "volunteerOpportunitiesCount": volunteerOpportunitiesCount, "trainingEventsCount": trainingEventsCount, "engagementEventsCount": engagementEventsCount, "bonnerEventsCount": bonnerEventsCount, @@ -138,7 +138,7 @@ def events(selectedTerm, activeTab, programID): return render_template("/events/eventList.html", selectedTerm = term, - studentLedEvents = studentLedEvents, + volunteerOpportunities = volunteerOpportunities, trainingEvents = trainingEvents, engagementEvents = engagementEvents, bonnerEvents = bonnerEvents, @@ -151,7 +151,7 @@ def events(selectedTerm, activeTab, programID): activeTab = activeTab, programID = int(programID), managersProgramDict = managersProgramDict, - countUpcomingStudentLedEvents = countUpcomingStudentLedEvents, + countUpcomingVolunteerOpportunities = countUpcomingVolunteerOpportunities, toggleState = toggleState, ) diff --git a/app/logic/events.py b/app/logic/events.py index 4f0ffc050..a0ad869f9 100644 --- a/app/logic/events.py +++ b/app/logic/events.py @@ -224,17 +224,17 @@ def saveEventToDb(newEventData, renewedEvent = False): eventRecords.append(eventRecord) return eventRecords -def getStudentLedEvents(term): - studentLedEvents = list(Event.select(Event, Program) +def getVolunteerOpportunities(term): + volunteerOpportunities = list(Event.select(Event, Program) .join(Program) - .where(Program.isStudentLed, + .where(Program.isVolunteerOpportunities, Event.term == term, Event.deletionDate == None) .order_by(Event.startDate, Event.timeStart) .execute()) programs = {} - for event in studentLedEvents: + for event in volunteerOpportunities: programs.setdefault(event.program, []).append(event) return programs @@ -248,14 +248,14 @@ def getEngagementEvents(term): .execute()) return engagementEvents -def getUpcomingStudentLedCount(term, currentTime): +def getUpcomingVolunteerOpportunitiesCount(term, currentTime): """ - Return a count of all upcoming events for each student led program. + Return a count of all upcoming events for each volunteer opportunitiesprogram. """ upcomingCount = (Program.select(Program.id, fn.COUNT(Event.id).alias("eventCount")) .join(Event, on=(Program.id == Event.program_id)) - .where(Program.isStudentLed, + .where(Program.isVolunteerOpportunities, Event.term == term, Event.deletionDate == None, (Event.startDate > currentTime) | ((Event.startDate == currentTime) & (Event.timeEnd >= currentTime)), Event.isCanceled == False) @@ -314,7 +314,7 @@ def getCeltsLabor(term): Event.isTraining == False, Event.isAllVolunteerTraining == False, ((Program.isOtherCeltsSponsored) | - ((Program.isStudentLed == False) & + ((Program.isVolunteerOpportunities == False) & (Program.isBonnerScholars == False)))) .order_by(Event.startDate, Event.timeStart, Event.id) .execute()) diff --git a/app/logic/landingPage.py b/app/logic/landingPage.py index fc1973bc6..068818f3f 100644 --- a/app/logic/landingPage.py +++ b/app/logic/landingPage.py @@ -35,7 +35,7 @@ def getActiveEventTab(programID): program = Program.get_by_id(programID) if program.isBonnerScholars: return "bonnerScholarsEvents" - elif program.isStudentLed: - return "studentLedEvents" + elif program.isVolunteerOpportunities: + return "volunteerOpportunities" else: return "celtsLabor" diff --git a/app/models/program.py b/app/models/program.py index 0a2f33b11..31adcb02e 100644 --- a/app/models/program.py +++ b/app/models/program.py @@ -9,7 +9,7 @@ class Program(baseModel): bereaUrl = TextField(null=True) programDescription = TextField() partner = CharField(null=True) - isStudentLed = BooleanField(default=False) + isVolunteerOpportunities = BooleanField(default=False) isBonnerScholars = BooleanField(default=False) isOtherCeltsSponsored = BooleanField(default=False) contactName = CharField(null=True,default='') diff --git a/app/static/js/eventList.js b/app/static/js/eventList.js index f277fa8ca..235349abf 100644 --- a/app/static/js/eventList.js +++ b/app/static/js/eventList.js @@ -84,7 +84,7 @@ function updateIndicatorCounts(isChecked){ toggleState: isChecked ? "checked" : "unchecked", }, success: function(eventsCount) { - const studentLedEventsCount = Number(eventsCount.studentLedEventsCount); + const volunteerOpportunitiesCount = Number(eventsCount.volunteerOpportunitiesCount); const trainingEventsCount = Number(eventsCount.trainingEventsCount); const engagementEventsCount = Number(eventsCount.engagementEventsCount); const bonnerEventsCount = Number(eventsCount.bonnerEventsCount); @@ -94,7 +94,7 @@ function updateIndicatorCounts(isChecked){ $("#viewPastEventsToggle").prop(toggleStatus, true); // use ternary operators to populate the tab with a number if there are events, and clear the count if there are none - studentLedEventsCount > 0 ? $("#studentLedEvents").html(`Volunteer Opportunities (${studentLedEventsCount})`) : $("#studentLedEvents").html(`Volunteer Opportunities`) + volunteerOpportunitiesCount > 0 ? $("#volunteerOpportunities").html(`Volunteer Opportunities (${volunteerOpportunitiesCount})`) : $("#volunteerOpportunities").html(`Volunteer Opportunities`) trainingEventsCount > 0 ? $("#trainingEvents").html(`Trainings (${trainingEventsCount})`) : $("#trainingEvents").html(`Trainings`) engagementEventsCount > 0 ? $("#engagementEvents").html(`Education and Engagement (${engagementEventsCount})`) : $("#engagementEvents").html('Education and Engagement') bonnerEventsCount > 0 ? $("#bonnerScholarsEvents").html(`Bonner Scholars (${bonnerEventsCount})`) : $("#bonnerScholarsEvents").html(`Bonner Scholars`) diff --git a/app/static/js/landingPage.js b/app/static/js/landingPage.js index 539c82def..000f18766 100644 --- a/app/static/js/landingPage.js +++ b/app/static/js/landingPage.js @@ -21,7 +21,7 @@ $(document).ready(function(){ url: "/goToEventsList/"+programID, type: "GET", success: function(response) { - if (response.activeTab === "studentLedEvents"){ + if (response.activeTab === "volunteerOpportunities"){ window.location.href += "eventsList/"+term+"/"+response.activeTab+"/"+programID } else { window.location.href += "eventsList/"+term+"/"+response.activeTab diff --git a/app/templates/events/eventList.html b/app/templates/events/eventList.html index 44f0217b3..a30d36006 100644 --- a/app/templates/events/eventList.html +++ b/app/templates/events/eventList.html @@ -50,8 +50,8 @@

    Events List for {{selectedTerm.description}}

    - {% if type != "bonner" and type != "studentLed" %} + {% if type != "bonner" and type != "volunteerOpportunities" %} {% endif %} @@ -100,7 +100,7 @@

    Events List for {{selectedTerm.description}}

    {% else %}
    {% endif %} - {% if type != "bonner" and type != "studentLed" %} + {% if type != "bonner" and type != "volunteerOpportunities" %} {% endif %} {% if user.isCeltsAdmin or user.isProgramManagerFor(event.program)%} @@ -149,25 +149,25 @@

    Events List for {{selectedTerm.description}}

    {% endfor %} {% if selectedTerm == g.current_term and events[-1].isPastStart %}
    - {% set colspan_value = 5 if type == 'bonner' or type == 'studentLed' else 6 %} + {% set colspan_value = 5 if type == 'bonner' or type == 'volunteerOpportunities' else 6 %} {% endif %}
    ProgramEvent Name
    {{event.program.programName}}
    There are no upcoming events for this program
    -{% elif type != "studentLed" %} +{% elif type != "volunteerOpportunities" %}

    There are no events for this program

    {% endif %} {% endmacro %} - +
    -
    - {% if studentLedEvents %} +
    + {% if volunteerOpportunities %}
    - {% for program,events in studentLedEvents.items() %} + {% for program,events in volunteerOpportunities.items() %}

    aria-expanded="true" aria-controls="accordion__body_{{program}}"> {{program.programName}} - {% if program.id not in countUpcomingStudentLedEvents%} + {% if program.id not in countUpcomingVolunteerOpportunities%} 0 upcoming events {% else %} - {{countUpcomingStudentLedEvents[program.id]}} upcoming event{% if countUpcomingStudentLedEvents[program.id] > 1 %}s{% endif %} + {{countUpcomingVolunteerOpportunities[program.id]}} upcoming event{% if countUpcomingVolunteerOpportunities[program.id] > 1 %}s{% endif %} {% endif %} @@ -189,7 +189,7 @@

    Events List for {{selectedTerm.description}}

    class="accordion-collapse collapse {{'show' if programID == program.id else ''}}" aria-labelledby="accordion__header_{{program}}" data-bs-parent="#categoryAccordion"> - {{createTable(events, "studentLed")}} + {{createTable(events, "volunteerOpportunities")}}
    {% endfor %} diff --git a/app/templates/sidebar.html b/app/templates/sidebar.html index fc2f9fefa..f167496c5 100644 --- a/app/templates/sidebar.html +++ b/app/templates/sidebar.html @@ -12,7 +12,7 @@

    -{% if programs %} +{% if userHasPermissions %}
    From 6feb62d794a361179ab1dbbd415a5c79ce2d1fb4 Mon Sep 17 00:00:00 2001 From: Oluwagbayi James Makinde <122561188+ojmakinde@users.noreply.github.com> Date: Thu, 11 Sep 2025 14:00:55 -0400 Subject: [PATCH 052/103] Program Managers can now create events in their programs --- app/controllers/admin/routes.py | 18 +++++++----------- app/templates/events/templateSelector.html | 10 ++++------ app/templates/sidebar.html | 2 +- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/app/controllers/admin/routes.py b/app/controllers/admin/routes.py index 85350f74b..4d1e8285f 100644 --- a/app/controllers/admin/routes.py +++ b/app/controllers/admin/routes.py @@ -71,18 +71,14 @@ def switchUser(): @admin_bp.route('/eventTemplates') def templateSelect(): - if g.current_user.isCeltsAdmin or g.current_user.isCeltsStudentStaff: - allprograms = getAllowedPrograms(g.current_user) - userHasPermissions = bool(len(allprograms)) - visibleTemplates = getAllowedTemplates(g.current_user) - return render_template("/events/templateSelector.html", - programs=allprograms, - userHasPermissions=userHasPermissions, - celtsSponsoredProgram = Program.get(Program.isOtherCeltsSponsored), - templates=visibleTemplates) - else: + programs = getAllowedPrograms(g.current_user) + if not programs: abort(403) - + visibleTemplates = getAllowedTemplates(g.current_user) + return render_template("/events/templateSelector.html", + programs=programs, + celtsSponsoredProgram = Program.get(Program.isOtherCeltsSponsored), + templates=visibleTemplates) @admin_bp.route('/eventTemplates///create', methods=['GET','POST']) def createEvent(templateid, programid): diff --git a/app/templates/events/templateSelector.html b/app/templates/events/templateSelector.html index 04b557384..ec2a2825e 100644 --- a/app/templates/events/templateSelector.html +++ b/app/templates/events/templateSelector.html @@ -2,6 +2,7 @@ {% extends "base.html"%} {% block app_content %}

    Create an Event

    +{% if templates %}
    @@ -14,11 +15,13 @@

    Shortcuts

    -{% if userHasPermissions %} +{% endif %}
    + {% if templates %}

    Programs

    + {% endif %}
    {% for program in programs %} {{ program.programName }} @@ -26,10 +29,5 @@

    Programs

    -
    -{% else %} - -{% endif %} {% endblock %} \ No newline at end of file diff --git a/app/templates/sidebar.html b/app/templates/sidebar.html index 8092de6e5..c261d65e1 100644 --- a/app/templates/sidebar.html +++ b/app/templates/sidebar.html @@ -29,7 +29,7 @@ {% endif %} - {% if g.current_user.isCeltsAdmin or (g.current_user.isCeltsStudentStaff and g.current_user.isProgramManager) %} + {% if g.current_user.isCeltsAdmin or g.current_user.isProgramManager %}
  • Create Event From 5f49372dc9863378098af2ea2159205d4053a1f6 Mon Sep 17 00:00:00 2001 From: Oluwagbayi James Makinde <122561188+ojmakinde@users.noreply.github.com> Date: Thu, 11 Sep 2025 14:20:16 -0400 Subject: [PATCH 053/103] Removed the ability for student staff to create events in all programs --- app/controllers/admin/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/routes.py b/app/controllers/admin/routes.py index 4d1e8285f..b15f63155 100644 --- a/app/controllers/admin/routes.py +++ b/app/controllers/admin/routes.py @@ -82,7 +82,7 @@ def templateSelect(): @admin_bp.route('/eventTemplates///create', methods=['GET','POST']) def createEvent(templateid, programid): - if not (g.current_user.isAdmin or g.current_user.isProgramManagerFor(programid)): + if not (g.current_user.isCeltsAdmin or g.current_user.isProgramManagerFor(programid)): abort(403) # Validate given URL From b6fa570ca6f9ba6d014485e056562fd16b542860 Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Fri, 12 Sep 2025 15:19:31 -0400 Subject: [PATCH 054/103] added validity tag requirement for name field --- app/static/js/bonnerManagement.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/static/js/bonnerManagement.js b/app/static/js/bonnerManagement.js index 1af4f7059..41ebc0f9a 100644 --- a/app/static/js/bonnerManagement.js +++ b/app/static/js/bonnerManagement.js @@ -225,6 +225,22 @@ function addRequirementsRowHandlers() { $(".required-select").change(function(e) { enableSave(); }); + $("#requirements input").on("input blur",function(e) { + if($(this).val() == "") { + this.setCustomValidity('Please enter a name.'); + this.reportValidity(); + $(".saveBtn").attr("disabled", "disabled"); + $("#reqAdd").attr("disabled", "disabled"); + } else { + $(".saveBtn").removeAttr("disabled"); + $("#reqAdd").removeAttr("disabled"); + this.setCustomValidity(''); + this.reportValidity(); + enableSave(); + } + }); + + // handle invalid and valid entries $("#requirements input").keyup(function(e) { From 7793a817631f32e5ead305ebd3d7f5f74383da08 Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Tue, 16 Sep 2025 12:06:03 -0400 Subject: [PATCH 055/103] Done --- app/static/js/bonnerManagement.js | 2 +- app/templates/admin/bonnerManagement.html | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/static/js/bonnerManagement.js b/app/static/js/bonnerManagement.js index 41ebc0f9a..7e7d169eb 100644 --- a/app/static/js/bonnerManagement.js +++ b/app/static/js/bonnerManagement.js @@ -225,7 +225,7 @@ function addRequirementsRowHandlers() { $(".required-select").change(function(e) { enableSave(); }); - $("#requirements input").on("input blur",function(e) { + $("#requirements input").on("input blur", function(e) { if($(this).val() == "") { this.setCustomValidity('Please enter a name.'); this.reportValidity(); diff --git a/app/templates/admin/bonnerManagement.html b/app/templates/admin/bonnerManagement.html index d497980a0..ebe02bf95 100644 --- a/app/templates/admin/bonnerManagement.html +++ b/app/templates/admin/bonnerManagement.html @@ -147,7 +147,6 @@

    From 1f7ab4228f5aa857b398526cccec5525fb55563a Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Thu, 13 Nov 2025 15:33:20 -0500 Subject: [PATCH 065/103] now they connot modify, only view --- app/templates/main/userProfile.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 37892bfbd..d31cc3a6e 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -322,7 +322,7 @@

    Description - {% if g.current_user.isCeltsAdmin or g.current_user.isCeltsStudentStaff%} + {% if g.current_user.isCeltsAdmin %} Status Date @@ -343,7 +343,7 @@

    {{bgType.description}}
    {% endfor %} - {% if g.current_user.isCeltsAdmin or g.current_user.isCeltsStudentStaff %} + {% if g.current_user.isCeltsAdmin %} - - - - - + - - {% endif %} + + + + {% endif %} - {%endfor%} - - -

  • + {% endif %} + {% endfor %} + +
    - {% endif %} +
    +{% endif %} From dfddb036008f4d5e9b716080d610735457615949 Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Tue, 18 Nov 2025 12:26:26 -0500 Subject: [PATCH 068/103] removed re-annotation --- app/controllers/main/routes.py | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/main/routes.py b/app/controllers/main/routes.py index 7cab82ff7..51a14677b 100644 --- a/app/controllers/main/routes.py +++ b/app/controllers/main/routes.py @@ -111,7 +111,6 @@ def events(selectedTerm, activeTab, programID): # gets only upcoming events to display in indicators if (toggleState == 'unchecked'): - volunteerOpportunitiesCount: int = sum(list(countUpcomingVolunteerOpportunities.values())) for event in trainingEvents: if event.isPastEnd: trainingEventsCount -= 1 From 9b49f216f44c4ebbe82464ff3697a861b63abb1e Mon Sep 17 00:00:00 2001 From: Eun Sung Wang <156254694+esw0624@users.noreply.github.com> Date: Tue, 18 Nov 2025 13:35:27 -0500 Subject: [PATCH 069/103] Added No Background Check Description --- app/templates/main/userProfile.html | 112 +++++++++++++++++----------- 1 file changed, 70 insertions(+), 42 deletions(-) diff --git a/app/templates/main/userProfile.html b/app/templates/main/userProfile.html index 38bfeca19..a5337254e 100644 --- a/app/templates/main/userProfile.html +++ b/app/templates/main/userProfile.html @@ -308,53 +308,41 @@
    {{volunteer.firstName}} {{volunteer.lastName}} is the manager of:
    - {% if g.current_user.isCeltsAdmin or g.current_user.isCeltsStudentStaff %} -
    -

    - {% set focus = "open" if visibleAccordion == "background" else "collapsed" %} - -

    - {% set show = "show" if visibleAccordion == "background" else "" %} -
    -
    -
    - - - - - {% if g.current_user.isCeltsAdmin %} - - - - {% endif %} - - - - {% for bgType in backgroundTypes %} - {% set showRow = namespace(value=True) %} - {% if g.current_user.isCeltsStudentStaff and not g.current_user.isCeltsAdmin %} - {% set showRow.value = False %} - {% for bgStatus in allBackgroundHistory[bgType.id] %} - {% if bgStatus.backgroundCheckStatus in ['Submitted', 'Passed', 'Failed'] %} - {% set showRow.value = True %} - {% endif %} - {% endfor %} +{% if g.current_user.isCeltsAdmin or g.current_user.isCeltsStudentStaff %} +
    +

    + {% set focus = "open" if visibleAccordion == "background" else "collapsed" %} + +

    + {% set show = "show" if visibleAccordion == "background" else "" %} +
    +
    +
    +
    DescriptionStatusDate
    + + + + {% if g.current_user.isCeltsAdmin %} + + + {% endif %} - {% if showRow.value %} + + + + {% if g.current_user.isCeltsAdmin %} + {% for bgType in backgroundTypes %} @@ -373,8 +361,48 @@
    {{bgType.description}}
    {% endif %} + {% endfor %} + {% else %} + {% set anyAllowed = namespace(value=False) %} + {% for bgType in backgroundTypes %} + {% for bgStatus in allBackgroundHistory[bgType.id] %} + {% if bgStatus.backgroundCheckStatus in ['Submitted', 'Passed', 'Failed'] %} + {% set anyAllowed.value = True %} + {% endif %} + {% endfor %} + {% endfor %} + + {% if anyAllowed.value %} + {% for bgType in backgroundTypes %} + {% set typeAllowed = namespace(value=False) %} + {% for bgStatus in allBackgroundHistory[bgType.id] %} + {% if bgStatus.backgroundCheckStatus in ['Submitted', 'Passed', 'Failed'] %} + {% set typeAllowed.value = True %} + {% endif %} + {% endfor %} + {% if typeAllowed.value %} + + + + {% endif %} + {% endfor %} + {% else %} + + + {% endif %} - {% endfor %} + {% endif %}
    DescriptionStatusDate
    {{bgType.description}}
      {% for bgStatus in allBackgroundHistory[bgType.id] %} - {% if g.current_user.isCeltsAdmin - or (bgStatus.backgroundCheckStatus in ['Submitted', 'Passed', 'Failed']) %} -
    • - {{bgStatus.backgroundCheckStatus}}: {{bgStatus.dateCompleted.strftime("%m/%d/%Y")}} - {% if g.current_user.isCeltsAdmin %} - - {% endif %} -
    • - {% endif %} +
    • + {{bgStatus.backgroundCheckStatus}}: {{bgStatus.dateCompleted.strftime("%m/%d/%Y")}} + {% if g.current_user.isCeltsAdmin %} + + {% endif %} +
    • {% endfor %}
    +
    {{bgType.description}}
    +
      + {% for bgStatus in allBackgroundHistory[bgType.id] %} + {% if bgStatus.backgroundCheckStatus in ['Submitted', 'Passed', 'Failed'] %} +
    • + {{bgStatus.backgroundCheckStatus}}: {{bgStatus.dateCompleted.strftime("%m/%d/%Y")}} +
    • + {% endif %} + {% endfor %} +
    +
    There are no background checks
    From 1cfc46ba90e5a6695e78331458db7848f0101155 Mon Sep 17 00:00:00 2001 From: Eun Sung Wang <156254694+esw0624@users.noreply.github.com> Date: Tue, 18 Nov 2025 14:26:02 -0500 Subject: [PATCH 070/103] Pushing Test Code --- app/templates/events/eventList.html | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/app/templates/events/eventList.html b/app/templates/events/eventList.html index 08772b743..bc90b0a73 100644 --- a/app/templates/events/eventList.html +++ b/app/templates/events/eventList.html @@ -27,9 +27,9 @@

    Events List for {{selectedTerm.description}}

    + + {% endfor %} +
    {% if user.isAdmin %} @@ -53,25 +53,29 @@

    Events List for {{selectedTerm.description}}

    - {% if not user.isLaborOnly %} + + {% if trainingEvents and trainingEvents|length %} - {% endif %} - {% if not user.isLaborOnly %} + {% endif %} + + {% if engagementEvents and engagementEvents|length %} {% endif %} + {% if user.isCeltsAdmin or user.isCeltsStudentStaff or user.isBonnerScholar %} {% endif %} - {% if user.isCeltsAdmin or user.isCeltsStudentStaff or user.isLaborOnly %} + + {% if user.isCeltsAdmin or user.isCeltsStudentStaff or (celtsLabor and celtsLabor|length) %} {% endfor %} - {% if g.current_user.isCeltsAdmin %} - - - - - - - - {% endif %} + + + + + + + {% endfor %} {% else %} {% set anyAllowed = namespace(value=False) %} {% for bgType in backgroundTypes %} - {% set allowed = namespace(items=[]) %} + {% set allowedHtml = namespace(value='') %} {% for bgStatus in allBackgroundHistory[bgType.id] %} {% if bgStatus.backgroundCheckStatus in ['Submitted', 'Passed', 'Failed'] %} - {% set _ = allowed.items.append(bgStatus) %} {% set anyAllowed.value = True %} + {% set allowedHtml.value = allowedHtml.value ~ '
  • ' ~ bgStatus.backgroundCheckStatus ~ ': ' ~ bgStatus.dateCompleted.strftime("%m/%d/%Y") ~ '
  • ' %} {% endif %} {% endfor %} - {% if allowed.items %} + {% if allowedHtml.value %}
    {{bgType.description}}
      - {% for bgStatus in allowed.items %} -
    • - {{bgStatus.backgroundCheckStatus}}: {{bgStatus.dateCompleted.strftime("%m/%d/%Y")}} -
    • - {% endfor %} + {{ allowedHtml.value | safe }}
    From f22fa65e8d46e11a29ecf515f4f122dd96e95211 Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Thu, 20 Nov 2025 10:31:04 -0500 Subject: [PATCH 075/103] Vol. Opp. and landing page thing --- app/logic/landingPage.py | 4 ---- database/prod-backup.sql | 1 - database/test_data.py | 10 ---------- tests/code/test_bonner.py | 1 - tests/code/test_event_list.py | 3 --- tests/code/test_events.py | 10 +++------- tests/code/test_landingPage.py | 5 ----- tests/code/test_users.py | 1 - 8 files changed, 3 insertions(+), 32 deletions(-) diff --git a/app/logic/landingPage.py b/app/logic/landingPage.py index 643729119..99072e670 100644 --- a/app/logic/landingPage.py +++ b/app/logic/landingPage.py @@ -34,10 +34,8 @@ def getManagerProgramDict(user): def getActiveEventTab(programID=None, explicit_tab=None): if explicit_tab: return explicit_tab - if programID is None: return "celtsLabor" - try: program = Program.get_by_id(programID) except Program.DoesNotExist: @@ -45,7 +43,5 @@ def getActiveEventTab(programID=None, explicit_tab=None): if getattr(program, "isBonnerScholars", False): return "bonnerScholarsEvents" - elif getattr(program, "isVolunteerOpportunities", False): - return "volunteerOpportunities" else: return "celtsLabor" diff --git a/database/prod-backup.sql b/database/prod-backup.sql index c9001ffcf..bb85aea92 100644 --- a/database/prod-backup.sql +++ b/database/prod-backup.sql @@ -1043,7 +1043,6 @@ DROP TABLE IF EXISTS `program`; CREATE TABLE `program` ( `id` int NOT NULL AUTO_INCREMENT, `programName` varchar(255) NOT NULL, - `isVolunteerOpportunities` tinyint(1) NOT NULL, `isBonnerScholars` tinyint(1) NOT NULL, `contactName` varchar(255) DEFAULT NULL, `contactEmail` varchar(255) DEFAULT NULL, diff --git a/database/test_data.py b/database/test_data.py index e7d81da17..f5ecd28da 100644 --- a/database/test_data.py +++ b/database/test_data.py @@ -495,7 +495,6 @@ "bereaUrl": None, "programDescription": "Each year 200 people stand in line to get into Woods-Penniman for the Annual Empty Bowls Event sponsored by the Berea College ceramics students and CELTS. Students, faculty, staff and community members each pay $10 for a beautiful bowl, soup and the privilege of helping those in need in our community.", "partner": None, - "isVolunteerOpportunities": False, "isBonnerScholars": False, "isOtherCeltsSponsored": False, "contactEmail": "", @@ -509,7 +508,6 @@ "bereaUrl": "https://www.berea.edu/centers/center-for-excellence-in-learning-through-service/programs/berea-buddies", "programDescription": "The Berea Buddies program is dedicated to establishing long-term mentorships between Berea youth (Little Buddies) and Berea College students (Big Buddies). Volunteers serve children by offering them friendship and quality time. Big and Little Buddies meet each other every Monday or Tuesday during the academic year, except on school and national holidays, to enjoy structured activities around campus.", "partner": None, - "isVolunteerOpportunities": True, "isBonnerScholars": False, "isOtherCeltsSponsored": False, "contactEmail": "bereabuddies@berea.edu", @@ -524,7 +522,6 @@ "bereaUrl": "https://www.berea.edu/centers/center-for-excellence-in-learning-through-service/programs/adopt-a-grandparent", "programDescription": "Adopt-a-Grandparent (AGP) is an outreach program for Berea elders. The program matches college student volunteers with residents of local long-term care centers. Volunteers visit with residents for at least an hour per week, and participate in special monthly programs.", "partner": None, - "isVolunteerOpportunities": True, "isBonnerScholars": False, "isOtherCeltsSponsored": False, "contactEmail": "", @@ -538,7 +535,6 @@ "bereaUrl": "https://www.berea.edu/centers/center-for-excellence-in-learning-through-service/programs/people-who-care-program", "programDescription":"People Who Care (PWC) helps to connect Berea College students with organizations and opportunities that promote change through advocacy, education, action, and direct community service. Volunteers may serve at local shelters, work with the Fair Trade University Campaign, or help to raise awareness about local issues like domestic violence, homelessness, fair trade, and AIDS awareness education. Students are welcome to participate as volunteers in PWC’s projects.", "partner": None, - "isVolunteerOpportunities": True, "isBonnerScholars": False, "isOtherCeltsSponsored": False, "contactEmail": "", @@ -552,7 +548,6 @@ "bereaUrl": "https://www.berea.edu/centers/center-for-excellence-in-learning-through-service/bonner-scholars-program", "programDescription": "The Bonner Scholars Program is a unique opportunity for students who want to combine a strong commitment to service with personal growth, teamwork, leadership development, and scholarship. Students who have completed an application for the Berea College class of 2026 may apply to be a Bonner Scholar.", "partner": None, - "isVolunteerOpportunities": False, "isBonnerScholars": True, "isOtherCeltsSponsored": False, "contactEmail": "", @@ -566,7 +561,6 @@ "bereaUrl": "https://www.berea.edu/centers/center-for-excellence-in-learning-through-service/programs/habitat-for-humanity", "programDescription": "Through the work of Habitat for Humanity International, thousands of low-income families have found hope through affordable housing. Hard work and volunteering have resulted in the organization sheltering more than two million people worldwide.", "partner": None, - "isVolunteerOpportunities": True, "isBonnerScholars": False, "isOtherCeltsSponsored": False, "contactEmail": "", @@ -580,7 +574,6 @@ "bereaUrl": "https://www.berea.edu/centers/center-for-excellence-in-learning-through-service/programs/berea-teen-mentoring", "programDescription": "Berea Teen Mentoring (BTM) brings Berea community youth, from ages 13-18, into a group setting for mentorship and enrichment programs. Staff members are assisted during the weekly program by Berea College student volunteers, who act as mentors for these program participants. The mission of the program is to stimulate and cultivate personal growth for young adults in the Berea community.", "partner": None, - "isVolunteerOpportunities": True, "isBonnerScholars": False, "isOtherCeltsSponsored": False, "contactEmail": "", @@ -594,7 +587,6 @@ "bereaUrl": "https://www.berea.edu/centers/center-for-excellence-in-learning-through-service/programs/hispanic-outreach-program", "programDescription": "The Hispanic Outreach Program (HOP) is a service-learning effort which brings together CELTS, several community organizations, and the Department of Foreign Languages at Berea College. HOP aims to build bridges among the Spanish-speaking and English-speaking residents of Madison County.", "partner": None, - "isVolunteerOpportunities": True, "isBonnerScholars": False, "isOtherCeltsSponsored": False, "contactEmail": "", @@ -608,7 +600,6 @@ "bereaUrl": "https://www.berea.edu/centers/center-for-excellence-in-learning-through-service", "programDescription": "This program hosts a myriad of different celts sponsored events that are not owned by any other program.", "partner": None, - "isVolunteerOpportunities": False, "isBonnerScholars": False, "isOtherCeltsSponsored": True, "contactEmail": "", @@ -622,7 +613,6 @@ "bereaUrl": "https://www.berea.edu/centers/center-for-excellence-in-learning-through-service/programs/berea-tutoring", "programDescription": "Berea Tutoring provides an encouraging atmosphere for local students who need help in achieving academic success, and for college volunteers who want to learn more about teaching or volunteering. Our mission is to increase conceptual understanding in academic subject areas, enrich educational experiences, and build self-confidence by providing college-aged tutors to local school children.", "partner": None, - "isVolunteerOpportunities": True, "isBonnerScholars": False, "isOtherCeltsSponsored": False, "contactEmail": "", diff --git a/tests/code/test_bonner.py b/tests/code/test_bonner.py index f30e9414a..bd84806fd 100644 --- a/tests/code/test_bonner.py +++ b/tests/code/test_bonner.py @@ -118,7 +118,6 @@ def test_addBonnerCohortToRsvpLog(): # Create a test event associated with a Bonner Scholars program programEvent = Program.create(id = 15, programName = "Bonner Scholars", - isVolunteerOpportunities = False, isBonnerScholars = True, contactEmail = "test@email", contactName = "testName") diff --git a/tests/code/test_event_list.py b/tests/code/test_event_list.py index bc3a434a8..c58a4c942 100644 --- a/tests/code/test_event_list.py +++ b/tests/code/test_event_list.py @@ -67,7 +67,6 @@ def test_getVolunteerOpportunities(training_events): training_events.term = 2 training_events.isService = True training_events.deletionDate = None - training_events.program.isVolunteerOpportunities = True training_events.save() training_events.program.save() @@ -166,14 +165,12 @@ def test_getTrainingEvents(training_events): testBonnerProgram = Program.create(programName = "Test Bonner", partner = None, - isVolunteerOpportunities = False, isBonnerScholars = True, contactName = "Jesus Christ", contactEmail = "christj@test.com",) testNotBonnerProgram = Program.create(programName = "Test Not Bonner", partner = None, - isVolunteerOpportunities = False, isBonnerScholars = False, contactName = "Jesus Christ", contactEmail = "christj@test.com") diff --git a/tests/code/test_events.py b/tests/code/test_events.py index 483a01ad5..ee0c262cd 100644 --- a/tests/code/test_events.py +++ b/tests/code/test_events.py @@ -784,26 +784,24 @@ def test_upcomingEvents(): # user can mark interest for it programForInterest = Program.create(id = 13, programName = "BOO", - isVolunteerOpportunities = False, + = False, isBonnerScholars = False, contactEmail = "test@email", contactName = "testName") programForInterest2 = Program.create(id = 14, programName = "BOO2", - isVolunteerOpportunities = False, isBonnerScholars = False, contactEmail = "test@email", contactName = "testName") programForBanning = Program.create(id = 15, programName = "BANNED", - isVolunteerOpportunities = False, + isBonnerScholars = False, isBonnerScholars = False, contactEmail = "test@email", contactName = "testName") programForMultiple = Program.create(id = 16, programName = "TestMultiple", - isVolunteerOpportunities = False, isBonnerScholars = False, contactEmail = "test@email", contactName = "testName") @@ -937,7 +935,6 @@ def test_volunteerHistory(): # Create a program that will have the program event created off of it participatedProgram = Program.create(id = 13, programName = "BOO", - isVolunteerOpportunities = False, isBonnerScholars = False, contactEmail = "test@email", contactName = "testName",) @@ -1326,7 +1323,7 @@ def test_inviteCohortsToEvent(): testDate = datetime.strptime("2025-08-01 05:00","%Y-%m-%d %H:%M") programEvent = Program.create(id = 13, programName = "Bonner Scholars", - isVolunteerOpportunities = False, + = False, isBonnerScholars = True, contactEmail = "test@email", contactName = "testName") @@ -1360,7 +1357,6 @@ def test_updateEventCohorts(): testDate = datetime.strptime("2025-10-01 05:00","%Y-%m-%d %H:%M") programEvent = Program.create(id = 13, programName = "Bonner Scholars", - isVolunteerOpportunities = False, isBonnerScholars = True, contactEmail = "test@email", contactName = "testName") diff --git a/tests/code/test_landingPage.py b/tests/code/test_landingPage.py index 55eaf1cc1..51fd823af 100644 --- a/tests/code/test_landingPage.py +++ b/tests/code/test_landingPage.py @@ -16,28 +16,24 @@ def test_activeEventTab(): with mainDB.atomic() as transaction: volunteerOpportunities = Program.create(programName = "SL", - isVolunteerOpportunities = True, isBonnerScholars = False, contactEmail = "test@email", contactName = "testName") assert getActiveEventTab(volunteerOpportunities.id) == "volunteerOpportunities" bonnerScholars1 = Program.create(programName = "BS1", - isVolunteerOpportunities = False, isBonnerScholars = True, contactEmail = "test@email", contactName = "testName") assert getActiveEventTab(bonnerScholars1.id) == "bonnerScholarsEvents" bonnerScholars2 = Program.create(programName = "BS2", - isVolunteerOpportunities = True, isBonnerScholars = True, contactEmail = "test@email", contactName = "testName") assert getActiveEventTab(bonnerScholars2.id) == "bonnerScholarsEvents" other = Program.create(programName = "OP", - isVolunteerOpportunities = False, isBonnerScholars = False, contactEmail = "test@email", contactName = "testName") @@ -53,7 +49,6 @@ def test_managerProgramDict(): assert os.path.join('static', 'files/programattachments/1.jpg') in dict[Program.get(Program.programName == "Hunger Initiatives")]["image"] noImageProgram = Program.create(programName = "Program with No Image", - isVolunteerOpportunities = False, isBonnerScholars = False, contactEmail = "", contactName = "") diff --git a/tests/code/test_users.py b/tests/code/test_users.py index aabcd3bd0..298ed0afd 100644 --- a/tests/code/test_users.py +++ b/tests/code/test_users.py @@ -275,7 +275,6 @@ def test_getStudentManagerForEvent(): { "id":13, "programName":"testProgram", - "isVolunteerOpportunities": False, "isBonnerScholars":False, } ] From 77db936e38f3c8c8d3a76f204abaf271cd8ecfb6 Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Thu, 20 Nov 2025 11:01:49 -0500 Subject: [PATCH 076/103] Fixed the issue with the engagement tab --- app/templates/events/eventList.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/events/eventList.html b/app/templates/events/eventList.html index bc90b0a73..6e1bac43b 100644 --- a/app/templates/events/eventList.html +++ b/app/templates/events/eventList.html @@ -61,7 +61,7 @@

    Events List for {{selectedTerm.description}}

    {% endif %} - {% if engagementEvents and engagementEvents|length %} + {% if user.username or engagementEvents and engagementEvents|length %}
  • ' ~ bgStatus.backgroundCheckStatus ~ ': ' ~ bgStatus.dateCompleted.strftime("%m/%d/%Y") ~ '
  • ' %} + {% set noBackground.value = False %} + {% set checkedBackground.value = checkedBackground.value ~ '
  • ' ~ bgStatus.backgroundCheckStatus ~ ': ' ~ bgStatus.dateCompleted.strftime("%m/%d/%Y") ~ '
  • ' %} {% endif %} {% endfor %} - {% if allowedHtml.value %} + {% if checkedBackground.value %}
    {{bgType.description}}
      - {{ allowedHtml.value | safe }} + {{ checkedBackground.value | safe }}
    {% endif %} {% endfor %} - {% if not anyAllowed.value %} + {% if noBackground.value %} There are no background checks From 4f5de800f646e3440c6b9c8674dadf1c9f998b9b Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Fri, 21 Nov 2025 13:04:28 -0500 Subject: [PATCH 078/103] Implemented logic for when a student has a labor position with celts. --- app/models/user.py | 8 ++++++++ app/templates/events/eventList.html | 2 +- app/templates/events/eventView.html | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/models/user.py b/app/models/user.py index 748568794..742deac41 100644 --- a/app/models/user.py +++ b/app/models/user.py @@ -15,6 +15,7 @@ class User(baseModel): isStaff = BooleanField(default=False) isCeltsAdmin = BooleanField(default=False) isCeltsStudentStaff = BooleanField(default=False) + hasCurrentCeltsLabor = BooleanField(default=False) dietRestriction = TextField(null=True) minorInterest = BooleanField(null=True) hasGraduated = BooleanField(default=False) @@ -46,6 +47,13 @@ def isBonnerScholar(self): self._bsCache = BonnerCohort.select().where(BonnerCohort.user == self).exists() return self._bsCache + + @property + def hasCurrentCeltsLabor(self): + if self._bsCache is None: + from app.models.celtsLabor import CeltsLabor + self.hasCurrentCeltsLabor = CeltsLabor.select().where(CeltsLabor.user == self, CeltsLabor.term.isCurrent == True).exists() + return self.hasCurrentCeltsLabor @property def fullName(self): diff --git a/app/templates/events/eventList.html b/app/templates/events/eventList.html index 6e1bac43b..e2ace2a1a 100644 --- a/app/templates/events/eventList.html +++ b/app/templates/events/eventList.html @@ -75,7 +75,7 @@

    Events List for {{selectedTerm.description}}

    {% endif %} - {% if user.isCeltsAdmin or user.isCeltsStudentStaff or (celtsLabor and celtsLabor|length) %} + {% if user.isCeltsAdmin or user.isCeltsStudentStaff or user.hasCurrentCeltsLabor %}
  • {{bgStatus.backgroundCheckStatus}}: {{bgStatus.dateCompleted.strftime("%m/%d/%Y")}} + {% if g.current_user.isCeltsAdmin %} + {% endif %}
  • {% endfor %} + {% if g.current_user.isCeltsAdmin %}