From 4a7be6c221f2357d194bb3eb59648d609b61c1e6 Mon Sep 17 00:00:00 2001 From: georgievh Date: Tue, 30 Jun 2026 18:45:26 +0000 Subject: [PATCH 01/21] edited supervisorDepartment --- app/models/supervisorDepartment.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/supervisorDepartment.py b/app/models/supervisorDepartment.py index 3585e1eb2..059712cc0 100644 --- a/app/models/supervisorDepartment.py +++ b/app/models/supervisorDepartment.py @@ -5,3 +5,4 @@ class SupervisorDepartment(baseModel): supervisor = ForeignKeyField(Supervisor, null=True) department = ForeignKeyField(Department) + banStatus = From 12d8d41764fd03ddc59c8421d63a770ac17f235f Mon Sep 17 00:00:00 2001 From: georgievh Date: Tue, 30 Jun 2026 18:45:55 +0000 Subject: [PATCH 02/21] edited supervisorDepartment --- app/models/supervisorDepartment.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/models/supervisorDepartment.py b/app/models/supervisorDepartment.py index 059712cc0..72a80ea6d 100644 --- a/app/models/supervisorDepartment.py +++ b/app/models/supervisorDepartment.py @@ -5,4 +5,12 @@ class SupervisorDepartment(baseModel): supervisor = ForeignKeyField(Supervisor, null=True) department = ForeignKeyField(Department) - banStatus = + banStatus = BooleanField(default=False) + isActive = BooleanField(default=False) + isCoordinator = BooleanField(default=False) + + @property + def isBanned(self): + return self.banStatus + + From a8684550b6260b90bf55507dda69b96868847796 Mon Sep 17 00:00:00 2001 From: feitsopb Date: Tue, 30 Jun 2026 19:15:25 +0000 Subject: [PATCH 03/21] added the position history file --- app/models/positionHistory.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 app/models/positionHistory.py diff --git a/app/models/positionHistory.py b/app/models/positionHistory.py new file mode 100644 index 000000000..f255dfbcb --- /dev/null +++ b/app/models/positionHistory.py @@ -0,0 +1,10 @@ +from app.models import * +from app.models.department import Department + +class PositionHistory(baseModel): + positioncode = PrimaryKeyField() + status = CharField() + WLS = IntegerField() + revisiondate = DateField() + Description = TextField() + Department = ForeignKeyField(Department) From 83c8c92e2fa28e5be183c8f09da4f8cdca317170 Mon Sep 17 00:00:00 2001 From: lolongaj Date: Tue, 30 Jun 2026 19:33:08 +0000 Subject: [PATCH 04/21] added the allocation model --- app/models/allocation.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/models/allocation.py diff --git a/app/models/allocation.py b/app/models/allocation.py new file mode 100644 index 000000000..ddd2084d7 --- /dev/null +++ b/app/models/allocation.py @@ -0,0 +1,19 @@ +from app.models import * +from app.models.department import Department +from app.models.supervisor import Supervisor +from app.models.term import Term + +class Allocation(baseModel): + termCode = ForeignKeyField(Term) + department = ForeignKeyField(Department) + isApproved = BooleanField(default=False) + approvedOn = DateField() + approvedBy = ForeignKeyField(Supervisor) + justification = TextField() + primary_10 = IntegerField() + primary_12 = IntegerField() + primary_15 = IntegerField() + primary_20 = IntegerField() + secondary_5 = IntegerField() + secondary_10 = IntegerField() + breakHours = IntegerField() From 2978b55ea3d277fc3a75e1a2ea12d7d58968a95f Mon Sep 17 00:00:00 2001 From: lolongaj Date: Tue, 30 Jun 2026 21:29:46 +0000 Subject: [PATCH 05/21] allocation table added --- database/demo_data.py | 22 ++++++++++++++++++++++ database/migrate_db.sh | 1 + 2 files changed, 23 insertions(+) diff --git a/database/demo_data.py b/database/demo_data.py index 0557c9361..34c80a3f5 100644 --- a/database/demo_data.py +++ b/database/demo_data.py @@ -17,6 +17,8 @@ from app.models.laborStatusForm import LaborStatusForm from app.models.formHistory import FormHistory from app.models.notes import Notes +from app.models.allocation import Allocation + print("Inserting data for demo and testing purposes") @@ -609,3 +611,23 @@ ] Notes.insert_many(notes).on_conflict_replace().execute() print(" * laborOfficeNotes added") + +allocation =[ + { + "termCode":f"{current_year}00", + "department": 3, + "isApproved": True, + "approvedOn": f"{current_year}-06-30", + "approvedBy": "B12365892", + "justification": "We just want it for fun", + "primary_10": 2, + "primary_12": 3, + "primary_15": 1, + "primary_20": 6, + "secondary_5": 2, + "secondary_10": 0, + "breakHours": 500 + } + ] +Allocation.insert_many(allocation).on_conflict_replace().execute() +print(" * allocation added") \ No newline at end of file diff --git a/database/migrate_db.sh b/database/migrate_db.sh index f88c91f26..5788fbead 100755 --- a/database/migrate_db.sh +++ b/database/migrate_db.sh @@ -30,6 +30,7 @@ pem add app.models.supervisor.Supervisor pem add app.models.supervisorDepartment.SupervisorDepartment pem add app.models.studentLaborEvaluation.StudentLaborEvaluation pem add app.models.formSearchResult.FormSearchResult +pem add app.models.allocation.Allocation pem watch pem migrate From 912f50f9fff9bdeea403b32c7a6abb34863f1122 Mon Sep 17 00:00:00 2001 From: georgievh Date: Tue, 30 Jun 2026 21:30:09 +0000 Subject: [PATCH 06/21] dummy allocations added --- database/demo_data.py | 123 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/database/demo_data.py b/database/demo_data.py index 0557c9361..d5eef179a 100644 --- a/database/demo_data.py +++ b/database/demo_data.py @@ -17,6 +17,10 @@ from app.models.laborStatusForm import LaborStatusForm from app.models.formHistory import FormHistory from app.models.notes import Notes +from app.models.allocation import Allocation +from app.models.positionHistory import PositionHistory +from app.models.supervisorDepartment import SupervisorDepartment + print("Inserting data for demo and testing purposes") @@ -515,6 +519,42 @@ "primaryCutOff": f"{current_year}-09-01", "adjustmentCutOff": f"{current_year}-09-01", }, + { + "termCode": f"{current_year-1}00", + "termName": f"AY {current_year-1}-{current_year}", + "termStart": f"{current_year-1}-08-01", + "termEnd": f"{current_year}-05-01", + "termState": 1, + "primaryCutOff": f"{current_year-1}-09-01", + "adjustmentCutOff": f"{current_year-1}-09-01", + }, + { + "termCode": f"{current_year-2}00", + "termName": f"AY {current_year-2}-{current_year-1}", + "termStart": f"{current_year-2}-08-01", + "termEnd": f"{current_year-1}-05-01", + "termState": 1, + "primaryCutOff": f"{current_year-2}-09-01", + "adjustmentCutOff": f"{current_year-2}-09-01", + }, + { + "termCode": f"{current_year-3}00", + "termName": f"AY {current_year-3}-{current_year-2}", + "termStart": f"{current_year-3}-08-01", + "termEnd": f"{current_year-2}-05-01", + "termState": 1, + "primaryCutOff": f"{current_year-3}-09-01", + "adjustmentCutOff": f"{current_year-3}-09-01", + }, + { + "termCode": f"{current_year-4}00", + "termName": f"AY {current_year-4}-{current_year-3}", + "termStart": f"{current_year-4}-08-01", + "termEnd": f"{current_year-3}-05-01", + "termState": 1, + "primaryCutOff": f"{current_year-4}-09-01", + "adjustmentCutOff": f"{current_year-4}-09-01", + }, { "termCode": f"{current_year}01", "termName": f"Thanksgiving Break {current_year}", @@ -609,3 +649,86 @@ ] Notes.insert_many(notes).on_conflict_replace().execute() print(" * laborOfficeNotes added") + +############################ +# Allocation Dummy Data: +########################### +allocations = [ + { + "termCode": 202200, + "department": "Computer Science", + "isApproved": True, + "approvedOn": None, + "approvedBy": None, + "justification": "Downscaling due to decrease in student enrollment caused by current economic conditions", + "primary_10": 2, + "primary_12": 2, + "primary_15": 1, + "primary_20": 0, + "secondary_5": 1, + "secondary_10": 0, + "breakHours": 260, + }, + { + "termCode": 202300, + "department": "ETAD", + "isApproved": True, + "approvedOn": None, + "approvedBy": None, + "justification": "Increase in student enrollment due to exodous from CS department", + "primary_10": 4, + "primary_15": 7, + "primary_20": 4, + "secondary_5": 2, + "secondary_10": 0, + "breakHours": 750, + }, + { + "termCode": 202400, + "department": "Mathematics", + "isApproved": True, + "approvedOn": None, + "approvedBy": None, + "justification": "We are hiring more students to help with the increased workload in the department", + "primary_10": 5, + "primary_12": 6, + "primary_15": 4, + "primary_20": 1, + "secondary_5": 7, + "secondary_10": 0, + "breakHours": 550, + }, + { + "termCode": 202500, + "department": "Physics", + "isApproved": True, + "approvedOn": None, + "approvedBy": None, + "justification": "Downscaling the number of students in the department due to budget cuts", + "primary_10": 4, + "primary_12": 5, + "primary_15": 0, + "primary_20": 0, + "secondary_5": 1, + "secondary_10": 0, + "breakHours": 300, + }, + { + "termCode": 202600, + "department": "Engineering Physics", + "isApproved": False, + "approvedOn": None, + "approvedBy": None, + "justification": "Due to rapid department growth, we need to hire more students to help with the increased workload", + "primary_10": 8, + "primary_12": 10, + "primary_15": 7, + "primary_20": 4, + "secondary_5": 5, + "secondary_10": 1, + "breakHours": 900, + }, + + ] + +print("Data insertion complete. Check phpmyadmin to see if your changes are reflected") \ No newline at end of file From a61ff1d4cd6a8462dcf36b7743d3ceddeee0d46b Mon Sep 17 00:00:00 2001 From: ArtemKurasov Date: Tue, 30 Jun 2026 21:34:25 +0000 Subject: [PATCH 07/21] Successfully added dummy data for the SupervisorDepartment class --- database/demo_data.py | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/database/demo_data.py b/database/demo_data.py index 0557c9361..ed5c07c82 100644 --- a/database/demo_data.py +++ b/database/demo_data.py @@ -17,6 +17,7 @@ from app.models.laborStatusForm import LaborStatusForm from app.models.formHistory import FormHistory from app.models.notes import Notes +from app.models.supervisorDepartment import SupervisorDepartment print("Inserting data for demo and testing purposes") @@ -609,3 +610,54 @@ ] Notes.insert_many(notes).on_conflict_replace().execute() print(" * laborOfficeNotes added") + + + +############################## +# Departement Members +############################## + +department_members = [ + { + "supervisor": "B12361006", + "department": 1, + "banStatus": False, + "isActive": True, + "isCoordinator": True + }, + + { + "supervisor": "B12365892", + "department": 1, + "banStatus": True, + "isActive": True, + "isCoordinator": False + }, + + { + "supervisor": "B12365893", + "department": 1, + "banStatus": False, + "isActive": False, + "isCoordinator": False + }, + + { + "supervisor": "B00763721", + "department": 1, + "banStatus": False, + "isActive": True, + "isCoordinator": False + }, + + { + "supervisor": "B00841417", + "department": 1, + "banStatus": False, + "isActive": True, + "isCoordinator": True + } +] + +SupervisorDepartment.insert_many(department_members).on_conflict_replace().execute() +print(" * Department members added") \ No newline at end of file From cebf62e554b0563ec48d64b3ec824a8e4b0d49e8 Mon Sep 17 00:00:00 2001 From: BhushanSah Date: Wed, 1 Jul 2026 13:24:38 +0000 Subject: [PATCH 08/21] Inserted the demo data --- database/demo_data.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/database/demo_data.py b/database/demo_data.py index d5eef179a..a4296412e 100644 --- a/database/demo_data.py +++ b/database/demo_data.py @@ -658,8 +658,8 @@ "termCode": 202200, "department": "Computer Science", "isApproved": True, - "approvedOn": None, - "approvedBy": None, + "approvedOn": 2021-10-19, + "approvedBy": "Dr heggen", "justification": "Downscaling due to decrease in student enrollment caused by current economic conditions", "primary_10": 2, "primary_12": 2, @@ -673,8 +673,8 @@ "termCode": 202300, "department": "ETAD", "isApproved": True, - "approvedOn": None, - "approvedBy": None, + "approvedOn": 2022-11-12, + "approvedBy": "Dr Jan", "justification": "Increase in student enrollment due to exodous from CS department", "primary_10": 4, "primary_15": 7, @@ -687,8 +687,8 @@ "termCode": 202400, "department": "Mathematics", "isApproved": True, - "approvedOn": None, - "approvedBy": None, + "approvedOn": 2023-12-19, + "approvedBy": "Dr Barnard", "justification": "We are hiring more students to help with the increased workload in the department", "primary_10": 5, "primary_12": 6, @@ -702,8 +702,8 @@ "termCode": 202500, "department": "Physics", "isApproved": True, - "approvedOn": None, - "approvedBy": None, + "approvedOn": 2025-1-10, + "approvedBy": "Dr Hodge", "justification": "Downscaling the number of students in the department due to budget cuts", "primary_10": 4, "primary_12": 5, @@ -717,8 +717,8 @@ "termCode": 202600, "department": "Engineering Physics", "isApproved": False, - "approvedOn": None, - "approvedBy": None, + "approvedOn": 2025-10-19, + "approvedBy": "Dr wu", "justification": "Due to rapid department growth, we need to hire more students to help with the increased workload", "primary_10": 8, "primary_12": 10, @@ -730,5 +730,6 @@ }, ] +Allocation.insert_many(allocations).on_conflict_replace().execute() -print("Data insertion complete. Check phpmyadmin to see if your changes are reflected") \ No newline at end of file +print("Data insertion complete :)") \ No newline at end of file From 539efdee27ba153c9e1ab5d09a62fbe60a1b9af0 Mon Sep 17 00:00:00 2001 From: fritzj2 Date: Wed, 1 Jul 2026 13:54:36 +0000 Subject: [PATCH 09/21] added a second round of demo data to the allocation --- database/demo_data.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/database/demo_data.py b/database/demo_data.py index 34c80a3f5..e3efef141 100644 --- a/database/demo_data.py +++ b/database/demo_data.py @@ -627,6 +627,21 @@ "secondary_5": 2, "secondary_10": 0, "breakHours": 500 + }, + { + "termCode":f"{current_year}00", + "department": 2, + "isApproved": False, + "approvedOn": f"{current_year}-06-20", + "approvedBy": "B00763721", + "justification": "We need it to lower the amount of allocations we have", + "primary_10": 1, + "primary_12": 2, + "primary_15": 5, + "primary_20": 2, + "secondary_5": 10, + "secondary_10": 0, + "breakHours": 1500 } ] Allocation.insert_many(allocation).on_conflict_replace().execute() From 49b5eac7080607a956abab4e65419da045cbc964 Mon Sep 17 00:00:00 2001 From: BhushanSah Date: Wed, 1 Jul 2026 14:55:29 +0000 Subject: [PATCH 10/21] Modified allocation --- app/models/allocation.py | 4 ++-- database/demo_data.py | 45 ++++++++++++++++++++-------------------- database/migrate_db.sh | 1 + 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/app/models/allocation.py b/app/models/allocation.py index ddd2084d7..75f9c828f 100644 --- a/app/models/allocation.py +++ b/app/models/allocation.py @@ -7,8 +7,8 @@ class Allocation(baseModel): termCode = ForeignKeyField(Term) department = ForeignKeyField(Department) isApproved = BooleanField(default=False) - approvedOn = DateField() - approvedBy = ForeignKeyField(Supervisor) + approvedOn = DateField(null =True) + approvedBy = ForeignKeyField(Supervisor, null =True) justification = TextField() primary_10 = IntegerField() primary_12 = IntegerField() diff --git a/database/demo_data.py b/database/demo_data.py index a4296412e..92d18557f 100644 --- a/database/demo_data.py +++ b/database/demo_data.py @@ -656,10 +656,10 @@ allocations = [ { "termCode": 202200, - "department": "Computer Science", - "isApproved": True, - "approvedOn": 2021-10-19, - "approvedBy": "Dr heggen", + "department": 3, + "isApproved": False, + "approvedOn": None, + "approvedBy": None, "justification": "Downscaling due to decrease in student enrollment caused by current economic conditions", "primary_10": 2, "primary_12": 2, @@ -670,13 +670,14 @@ "breakHours": 260, }, { - "termCode": 202300, - "department": "ETAD", - "isApproved": True, - "approvedOn": 2022-11-12, - "approvedBy": "Dr Jan", + "termCode": 202300, + "department": 2, + "isApproved": False, + "approvedOn": None, + "approvedBy": None, "justification": "Increase in student enrollment due to exodous from CS department", "primary_10": 4, + "primary_12": 2, "primary_15": 7, "primary_20": 4, "secondary_5": 2, @@ -685,10 +686,10 @@ }, { "termCode": 202400, - "department": "Mathematics", - "isApproved": True, - "approvedOn": 2023-12-19, - "approvedBy": "Dr Barnard", + "department": 1, + "isApproved": False, + "approvedOn": None, + "approvedBy": None, "justification": "We are hiring more students to help with the increased workload in the department", "primary_10": 5, "primary_12": 6, @@ -700,10 +701,10 @@ }, { "termCode": 202500, - "department": "Physics", - "isApproved": True, - "approvedOn": 2025-1-10, - "approvedBy": "Dr Hodge", + "department": 4, + "isApproved": False, + "approvedOn": None, + "approvedBy": None, "justification": "Downscaling the number of students in the department due to budget cuts", "primary_10": 4, "primary_12": 5, @@ -714,11 +715,11 @@ "breakHours": 300, }, { - "termCode": 202600, - "department": "Engineering Physics", - "isApproved": False, - "approvedOn": 2025-10-19, - "approvedBy": "Dr wu", + "termCode": 202500, + "department": 5, + "isApproved": False, + "approvedOn": None, + "approvedBy": None, "justification": "Due to rapid department growth, we need to hire more students to help with the increased workload", "primary_10": 8, "primary_12": 10, diff --git a/database/migrate_db.sh b/database/migrate_db.sh index f88c91f26..5788fbead 100755 --- a/database/migrate_db.sh +++ b/database/migrate_db.sh @@ -30,6 +30,7 @@ pem add app.models.supervisor.Supervisor pem add app.models.supervisorDepartment.SupervisorDepartment pem add app.models.studentLaborEvaluation.StudentLaborEvaluation pem add app.models.formSearchResult.FormSearchResult +pem add app.models.allocation.Allocation pem watch pem migrate From a52eeca52cd0be83ba5faddc7629f77b3717bab5 Mon Sep 17 00:00:00 2001 From: Brian Ramsay Date: Thu, 2 Jul 2026 11:56:23 -0400 Subject: [PATCH 11/21] Add base for department portal --- app/controllers/main_routes/main_routes.py | 24 ++++++- app/static/css/base.css | 73 ++++++++++++++++++++++ app/static/js/departmentPortal.js | 6 ++ app/templates/main/departmentPortal.html | 27 ++++++++ app/templates/sidebar.html | 15 +++-- 5 files changed, 139 insertions(+), 6 deletions(-) create mode 100644 app/static/js/departmentPortal.js create mode 100644 app/templates/main/departmentPortal.html diff --git a/app/controllers/main_routes/main_routes.py b/app/controllers/main_routes/main_routes.py index b3af06c9e..0a2f21e4b 100755 --- a/app/controllers/main_routes/main_routes.py +++ b/app/controllers/main_routes/main_routes.py @@ -1,5 +1,5 @@ from flask import render_template, request, json, redirect, url_for, send_file, g, flash, jsonify -from peewee import JOIN +from peewee import JOIN, DoesNotExist from functools import reduce import operator from app.models.department import Department @@ -47,6 +47,26 @@ def supervisorPortal(): currentUser = currentUser ) +@main_bp.route('/department', methods=['GET']) +@main_bp.route('/department/', methods=['GET']) +@main_bp.route('/department//', methods=['GET']) +def departmentPortal(org=None,account=None): + try: + dept = Department.get(Department.ORG == org, Department.ACCOUNT == account) + except (NameError, DoesNotExist): + dept = None + + + + if g.currentUser.isLaborAdmin: + departments = list(Department.select().order_by(Department.isActive.desc(), Department.DEPT_NAME.asc())) + else: + departments = list(getDepartmentsForSupervisor(g.currentUser).order_by(Department.isActive.desc(), Department.DEPT_NAME.asc())) + + return render_template('main/departmentPortal.html', + departments = departments, + department = dept) + @main_bp.route('/supervisorPortal/addUserToDept', methods=['GET', 'POST']) def addUserToDept(): userDeptData = request.form @@ -113,4 +133,4 @@ def submitToBanner(formHistoryId): if save_form_status: return "Form successfully submitted to Banner.", 200 else: - return "Submitting to Banner failed.", 500 \ No newline at end of file + return "Submitting to Banner failed.", 500 diff --git a/app/static/css/base.css b/app/static/css/base.css index 916fb4db9..940f8d6e5 100755 --- a/app/static/css/base.css +++ b/app/static/css/base.css @@ -191,3 +191,76 @@ a { font-size:1.2em; z-index:999; } + +.card { + position: relative; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + min-width: 0; + word-wrap: break-word; + background-color: #fff; + background-clip: border-box; + border: 1px solid rgba(0, 0, 0, 0.125); + border-radius: 0.25rem; +} + +.card-body { + -webkit-box-flex: 1; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + padding: 1rem 1rem; +} + +.card-title { + margin-bottom: 0.5rem; + font-size: 1.25rem; + font-weight: 500; +} + +.card-subtitle { + margin-top: -0.25rem; + margin-bottom: 0; +} + +.card-text:last-child { + margin-bottom: 0; +} + +.card-link + .card-link { + margin-left: 1rem; +} + +.card-header { + padding: 0.5rem 1rem; + margin-bottom: 0; + background-color: rgba(0, 0, 0, 0.03); + border-bottom: 1px solid rgba(0, 0, 0, 0.125); +} + +.card-header:first-child { + border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0; +} + +.card-footer { + padding: 0.5rem 1rem; + background-color: rgba(0, 0, 0, 0.03); + border-top: 1px solid rgba(0, 0, 0, 0.125); +} + +.card-footer:last-child { + border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px); +} + +.card-img, .card-img-top { + width: 100%; +} + +.card-img-top { + border-top-left-radius: calc(0.25rem - 1px); + border-top-right-radius: calc(0.25rem - 1px); +} diff --git a/app/static/js/departmentPortal.js b/app/static/js/departmentPortal.js new file mode 100644 index 000000000..cb2023a3a --- /dev/null +++ b/app/static/js/departmentPortal.js @@ -0,0 +1,6 @@ +$(document).ready(function() { + $("#selectedDepartment").on("change",function() { + deptData = $(this).find('option:selected').data(); + window.location = `/department/${deptData.org}/${deptData.account}`; + }); +}); diff --git a/app/templates/main/departmentPortal.html b/app/templates/main/departmentPortal.html new file mode 100644 index 000000000..8ee01838b --- /dev/null +++ b/app/templates/main/departmentPortal.html @@ -0,0 +1,27 @@ +{% extends "base.html" %} + +{% block scripts %} +{{super()}} + +{% endblock %} + +{% block app_content %} +

{% if department %} {{department.DEPT_NAME}} Portal {% else %} Choose a Department: {% endif %}

+ + +
+ + +
+{% endblock %} diff --git a/app/templates/sidebar.html b/app/templates/sidebar.html index 323b6b03b..1486f7de2 100644 --- a/app/templates/sidebar.html +++ b/app/templates/sidebar.html @@ -49,17 +49,24 @@

Labor History

{% if currentUser.supervisor %}
+ {% endif %} {% if currentUser.supervisor or (currentUser.student and currentUser.isLaborAdmin) %}
- -
+ +

New Labor Status Form

@@ -67,7 +74,7 @@

New Labor Status Form

{% endif %} {% if currentUser.supervisor or (currentUser.student and currentUser.isLaborAdmin) %}
-
+

Department Portal

From ba5a40b6175ba98a71bf487ab54b06dd349d620f Mon Sep 17 00:00:00 2001 From: Brian Ramsay Date: Thu, 2 Jul 2026 16:01:35 -0400 Subject: [PATCH 13/21] Add empty file for common routes --- app/controllers/main_routes/departmentPortal.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 app/controllers/main_routes/departmentPortal.py diff --git a/app/controllers/main_routes/departmentPortal.py b/app/controllers/main_routes/departmentPortal.py new file mode 100644 index 000000000..351757701 --- /dev/null +++ b/app/controllers/main_routes/departmentPortal.py @@ -0,0 +1 @@ +from flask import render_template From 9d4acbfc556df1ff9eb45d879467e0fc630aef5b Mon Sep 17 00:00:00 2001 From: zhytkovd Date: Thu, 2 Jul 2026 20:56:48 +0000 Subject: [PATCH 14/21] Started working on HTML design --- app/templates/admin/manageDepartments.html | 215 ++++++++++++--------- 1 file changed, 121 insertions(+), 94 deletions(-) diff --git a/app/templates/admin/manageDepartments.html b/app/templates/admin/manageDepartments.html index ddb1b0431..95ed236e7 100755 --- a/app/templates/admin/manageDepartments.html +++ b/app/templates/admin/manageDepartments.html @@ -2,15 +2,17 @@ {% block styles %} {{super()}} - - + + {% endblock %} {% block scripts %} {{super()}} - - - + + + {% endblock %} {% block app_content %} @@ -19,118 +21,143 @@
-
- Click to Skip -
-
-

Manage Departments

+
+ Click to Skip +
+
+

Manage Departments

-

Position descriptions are up to date.

-

Position descriptions are not up to date

+

Monitor allocation usage, compliance, and department position needs across + campus.

-
-
-
+

+ Position descriptions are up to date.

+

Position descriptions are not up to date

+ +
-
- +
+
+
+ +
-
-
- - -
-
- - - - - - - - - {% for department in activeDepartments %} - - - - - {% endfor %} - -
DepartmentStatus
{{department.DEPT_NAME}}({{department.ORG}}, {{department.ACCOUNT}}) - -
-
- -
- - - - - - - - {% for department in inactiveDepartments %} - - - - {% endfor %} - -
Department
{{department.DEPT_NAME}}({{department.ORG}}, {{department.ACCOUNT}})
-
+
+ + +
+ +
+ + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + + {% for department in activeDepartments %} + + + + + {% endfor %} + +
DepartmentStatus
{{department.DEPT_NAME}}({{department.ORG}}, + {{department.ACCOUNT}}) + +
+
+ + + +
+ + + + + + + + {% for department in inactiveDepartments %} + + + + {% endfor %} + +
Department
{{department.DEPT_NAME}}({{department.ORG}}, + {{department.ACCOUNT}})
+
-
-
+
+
- -{% endblock %} +{% endblock %} \ No newline at end of file From 8deecb550f554f47fa1d5a2a8cda8fc9d2c76cb4 Mon Sep 17 00:00:00 2001 From: zhytkovd Date: Sat, 4 Jul 2026 21:26:22 +0000 Subject: [PATCH 15/21] Finished initial design of the department page --- app/templates/admin/manageDepartments.html | 59 +++++++++++++++++----- 1 file changed, 45 insertions(+), 14 deletions(-) diff --git a/app/templates/admin/manageDepartments.html b/app/templates/admin/manageDepartments.html index 95ed236e7..4b726e798 100755 --- a/app/templates/admin/manageDepartments.html +++ b/app/templates/admin/manageDepartments.html @@ -41,22 +41,19 @@

Manage Departments


-
-
-
- - -
+
-
- - -
-
+
+ +
+
+ + +
+
- - +
@@ -67,8 +64,9 @@

Manage Departments

  • Inactive Departments
  • + - +
    @@ -76,6 +74,10 @@

    Manage Departments

    + + + + @@ -92,8 +94,37 @@

    Manage Departments

    value="{{department.departmentID}}">{% if department.departmentCompliance == True %}In Compliance{% else %}Not in Compliance{% endif %} + + + + + {% endfor %} +
    Department StatusPositionsAllocation approval statusBreak Hours Used/GivenActions
    +

    Prim: 6 of 16

    +

    Sec: 12 of 16

    +
    + + +

    271 hrs / 500 hrs

    +
    +
    + + + +
    From 9a14e6df3fbf33416a8f20a7b13db18129296537 Mon Sep 17 00:00:00 2001 From: zhytkovd Date: Mon, 6 Jul 2026 13:15:03 +0000 Subject: [PATCH 16/21] Fixed current year button position --- app/templates/admin/manageDepartments.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/templates/admin/manageDepartments.html b/app/templates/admin/manageDepartments.html index 4b726e798..9359ab032 100755 --- a/app/templates/admin/manageDepartments.html +++ b/app/templates/admin/manageDepartments.html @@ -64,7 +64,10 @@

    Manage Departments

  • Inactive Departments
  • - +
  • + +
  • +
    From 6a5fec70fce2775c3c866d2394d55d2010e1905d Mon Sep 17 00:00:00 2001 From: zhytkovd Date: Mon, 6 Jul 2026 14:51:40 +0000 Subject: [PATCH 17/21] centered data in the table and div container --- app/static/css/manageDepartments.css | 6 + app/templates/admin/manageDepartments.html | 288 +++++++++++++-------- 2 files changed, 192 insertions(+), 102 deletions(-) diff --git a/app/static/css/manageDepartments.css b/app/static/css/manageDepartments.css index 81fcfb05a..df77648f9 100755 --- a/app/static/css/manageDepartments.css +++ b/app/static/css/manageDepartments.css @@ -34,4 +34,10 @@ h1 { #flasher{ z-index: 999999; +} + +#activeDepartmentsTable th, +#activeDepartmentsTable td { + vertical-align: middle; + text-align: center; } \ No newline at end of file diff --git a/app/templates/admin/manageDepartments.html b/app/templates/admin/manageDepartments.html index 9359ab032..8626bf687 100755 --- a/app/templates/admin/manageDepartments.html +++ b/app/templates/admin/manageDepartments.html @@ -1,78 +1,108 @@ -{% extends "base.html" %} - -{% block styles %} -{{super()}} - - -{% endblock %} - -{% block scripts %} -{{super()}} +{% extends "base.html" %} {% block styles %} {{super()}} + + +{% endblock %} {% block scripts %} {{super()}} - - -{% endblock %} - -{% block app_content %} + + +{% endblock %} {% block app_content %}
    - Click to Skip -
    -
    + Click to Skip +
    +

    Manage Departments

    -

    Monitor allocation usage, compliance, and department position needs across - campus.

    +

    + Monitor allocation usage, compliance, and department position needs + across campus. +

    -

    - Position descriptions are up to date.

    -

    Position descriptions are not up to date

    +

    + + Position descriptions are up to date. +

    +

    + + Position descriptions are not up to date +


    -
    +

    -
    - -
    - - -
    -
    - - +
    +
    + + +
    +
    + + +
    -
    -
    +
    -
    - -{% endblock %} \ No newline at end of file +{% endblock %} From 7341b74d6582741d6235f8fca09c824c2acc9893 Mon Sep 17 00:00:00 2001 From: zhytkovd Date: Tue, 7 Jul 2026 15:19:40 +0000 Subject: [PATCH 18/21] Fixed actions button: made it similar to the other dropdown menus --- app/templates/admin/manageDepartments.html | 33 ++++++++-------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/app/templates/admin/manageDepartments.html b/app/templates/admin/manageDepartments.html index 8626bf687..bf4d0ffd6 100755 --- a/app/templates/admin/manageDepartments.html +++ b/app/templates/admin/manageDepartments.html @@ -155,27 +155,18 @@

    Manage Departments

    271 hrs / 500 hrs

    -
    - - - +
    From 25b6251363e1f5940b7087b718778d28bcfb269c Mon Sep 17 00:00:00 2001 From: zhytkovd Date: Tue, 7 Jul 2026 15:29:07 +0000 Subject: [PATCH 19/21] Finished requested UI changes: renaming some elements --- app/templates/admin/manageDepartments.html | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/templates/admin/manageDepartments.html b/app/templates/admin/manageDepartments.html index bf4d0ffd6..b7614f0ba 100755 --- a/app/templates/admin/manageDepartments.html +++ b/app/templates/admin/manageDepartments.html @@ -70,7 +70,7 @@

    Manage Departments

    -
    @@ -108,7 +103,7 @@

    Manage Departments

    Department Status Positions - Allocation approval status + Allocation Approval Status AY 26-27 Break Hours Used/Given Actions From c6c7293d728d3c2a037720c3f392efb292800d11 Mon Sep 17 00:00:00 2001 From: zhytkovd Date: Tue, 7 Jul 2026 20:56:49 +0000 Subject: [PATCH 20/21] Added brake hours from the database to the UI --- .../admin_routes/manage_departments.py | 10 +++++++++- app/templates/admin/manageDepartments.html | 16 +++++++++++++--- database/demo_data.py | 15 ++++++++------- database/reset_database.sh | 10 +++++----- 4 files changed, 35 insertions(+), 16 deletions(-) diff --git a/app/controllers/admin_routes/manage_departments.py b/app/controllers/admin_routes/manage_departments.py index 6b16877cb..44ef9d938 100644 --- a/app/controllers/admin_routes/manage_departments.py +++ b/app/controllers/admin_routes/manage_departments.py @@ -9,11 +9,13 @@ from app.models.term import * from flask_bootstrap import bootstrap_find_resource from app.models.department import * +from app.models.allocation import * from flask import request, redirect from flask import jsonify from playhouse.shortcuts import model_to_dict from app.logic.tracy import Tracy + @admin.route('/admin/manageDepartments', methods=['GET']) # @login_required def manage_departments(): @@ -34,17 +36,23 @@ def manage_departments(): activeDepartments = Department.select().where(Department.isActive == True) inactiveDepartments = Department.select().where(Department.isActive == False) + allAllocations = Allocation.select() + print("Something",allAllocations, "\n\n\n\n\n","Something") + allSupervisors= Supervisor.select().order_by(Supervisor.LAST_NAME) return render_template( 'admin/manageDepartments.html', title = ("Manage Departments"), activeDepartments = activeDepartments, inactiveDepartments = inactiveDepartments, - allSupervisors = allSupervisors + allSupervisors = allSupervisors, + allAllocations = allAllocations ) except Exception as e: print("Error Loading all Departments", e) return render_template('errors/500.html'), 500 + + @admin.route("/admin/manageDepartments/", methods=['GET']) def getSupervisorsInDepartment(departmentID): currentUser = require_login() diff --git a/app/templates/admin/manageDepartments.html b/app/templates/admin/manageDepartments.html index b7614f0ba..86d42a6ac 100755 --- a/app/templates/admin/manageDepartments.html +++ b/app/templates/admin/manageDepartments.html @@ -110,6 +110,7 @@

    Manage Departments

    {% for department in activeDepartments %} + Manage Departments Approved - -

    271 hrs / 500 hrs

    - + + + + {% for allocation in allAllocations %} + {% if allocation.department == department %} + {{ allocation.breakHours }} + {% endif %} + {% endfor %} + + + diff --git a/database/demo_data.py b/database/demo_data.py index ade1c6379..8ef27c266 100644 --- a/database/demo_data.py +++ b/database/demo_data.py @@ -17,15 +17,12 @@ from app.models.laborStatusForm import LaborStatusForm from app.models.formHistory import FormHistory from app.models.notes import Notes -<<<<<<< HEAD from app.models.supervisorDepartment import SupervisorDepartment -======= from app.models.allocation import Allocation from app.models.positionHistory import PositionHistory from app.models.supervisorDepartment import SupervisorDepartment from app.models.allocation import Allocation ->>>>>>> PeeWeeAttribute print("Inserting data for demo and testing purposes") @@ -472,28 +469,32 @@ "DEPT_NAME": "Computer Science", "ACCOUNT": "6740", "ORG": "2114", - "departmentCompliance": 1 + "departmentCompliance": 1, + "isActive": 1 }, { "departmentID":2, "DEPT_NAME": "Technology and Applied Design", "ACCOUNT": "6740", "ORG": "2147", - "departmentCompliance": 1 + "departmentCompliance": 1, + "isActive": 1 }, { "departmentID":3, "DEPT_NAME": "Mathematics", "ACCOUNT": "6740", "ORG": "2150", - "departmentCompliance": 1 + "departmentCompliance": 1, + "isActive": 1 }, { "departmentID":4, "DEPT_NAME": "Biology", "ACCOUNT": "6740", "ORG": "2107", - "departmentCompliance": 1 + "departmentCompliance": 1, + "isActive": 1 }, { "departmentID":5, diff --git a/database/reset_database.sh b/database/reset_database.sh index 82f6cff53..33283062d 100755 --- a/database/reset_database.sh +++ b/database/reset_database.sh @@ -22,12 +22,12 @@ if [ "$1" == "from-backup" ]; then fi echo "Dropping databases" -mysql -u root -proot --execute="DROP DATABASE \`lsf\`; DROP USER 'lsf_user';" -mysql -u root -proot --execute="DROP DATABASE \`UTE\`; DROP USER 'tracy_user';" +mysql -u root -proot --skip-ssl --execute="DROP DATABASE \`lsf\`; DROP USER 'lsf_user';" +mysql -u root -proot --skip-ssl --execute="DROP DATABASE \`UTE\`; DROP USER 'tracy_user';" echo "Recreating databases and users" -mysql -u root -proot --execute="CREATE DATABASE IF NOT EXISTS \`lsf\`; CREATE USER IF NOT EXISTS 'lsf_user'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'lsf_user'@'%';" -mysql -u root -proot --execute="CREATE DATABASE IF NOT EXISTS \`UTE\`; CREATE USER IF NOT EXISTS 'tracy_user'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'tracy_user'@'%';" +mysql -u root -proot --skip-ssl --execute="CREATE DATABASE IF NOT EXISTS \`lsf\`; CREATE USER IF NOT EXISTS 'lsf_user'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'lsf_user'@'%';" +mysql -u root -proot --skip-ssl --execute="CREATE DATABASE IF NOT EXISTS \`UTE\`; CREATE USER IF NOT EXISTS 'tracy_user'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'tracy_user'@'%';" cd database @@ -38,7 +38,7 @@ rm -rf migrations.json echo "Creating database objects" if [ $BACKUP -eq 1 ]; then echo " from backup" - mysql -u root -proot lsf < prod-backup.sql + mysql -u root -proot --skip-ssl lsf < prod-backup.sql else echo " empty" ./migrate_db.sh From 636dd71ddf6a39584c9dc93e237cc99d244622ce Mon Sep 17 00:00:00 2001 From: zhytkovd Date: Wed, 8 Jul 2026 18:08:21 +0000 Subject: [PATCH 21/21] Fixed brake hours given: removed double loop and filtered by AY --- .../admin_routes/manage_departments.py | 26 ++++++++++++++++--- app/templates/admin/manageDepartments.html | 8 ++---- database/demo_data.py | 5 +++- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/app/controllers/admin_routes/manage_departments.py b/app/controllers/admin_routes/manage_departments.py index 44ef9d938..1031b8fc0 100644 --- a/app/controllers/admin_routes/manage_departments.py +++ b/app/controllers/admin_routes/manage_departments.py @@ -10,6 +10,7 @@ from flask_bootstrap import bootstrap_find_resource from app.models.department import * from app.models.allocation import * +from app.models.laborStatusForm import * #Do we need to import all? from flask import request, redirect from flask import jsonify from playhouse.shortcuts import model_to_dict @@ -33,11 +34,28 @@ def manage_departments(): elif currentUser.supervisor: return render_template('errors/403.html'), 403 + #FIXME: hardcoded term year for the testing purposes + currentTerm = "202500" - activeDepartments = Department.select().where(Department.isActive == True) + print("Current term: ", currentTerm) + + + # activeDepartments = Department.select().where(Department.isActive == True) + # allAllocations = Allocation.select().where(Allocation.termCode == currentTerm) inactiveDepartments = Department.select().where(Department.isActive == False) - allAllocations = Allocation.select() - print("Something",allAllocations, "\n\n\n\n\n","Something") + + + activeDepartments = ( + Department + .select(Department, Allocation) + .join(Allocation) + .where( + Department.isActive == True, + Allocation.termCode == currentTerm + ) + + +) allSupervisors= Supervisor.select().order_by(Supervisor.LAST_NAME) return render_template( 'admin/manageDepartments.html', @@ -45,7 +63,7 @@ def manage_departments(): activeDepartments = activeDepartments, inactiveDepartments = inactiveDepartments, allSupervisors = allSupervisors, - allAllocations = allAllocations + currentTerm = currentTerm ) except Exception as e: print("Error Loading all Departments", e) diff --git a/app/templates/admin/manageDepartments.html b/app/templates/admin/manageDepartments.html index 86d42a6ac..1b7ec91c1 100755 --- a/app/templates/admin/manageDepartments.html +++ b/app/templates/admin/manageDepartments.html @@ -69,7 +69,7 @@

    Manage Departments

    -