Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
4a7be6c
edited supervisorDepartment
BetterRocket Jun 30, 2026
12d8d41
edited supervisorDepartment
BetterRocket Jun 30, 2026
a868455
added the position history file
Jun 30, 2026
83c8c92
added the allocation model
johnlolonga19 Jun 30, 2026
caad7d3
Added dummy data: weren't able to check if they work though
nahom70 Jun 30, 2026
bea1a8c
changed migrate_db.sh data to add PositionHistory, and added dummy da…
conwelld Jun 30, 2026
2978b55
allocation table added
johnlolonga19 Jun 30, 2026
912f50f
dummy allocations added
BetterRocket Jun 30, 2026
a61ff1d
Successfully added dummy data for the SupervisorDepartment class
ArtemKurasov Jun 30, 2026
cebf62e
Inserted the demo data
BhushanSah Jul 1, 2026
539efde
added a second round of demo data to the allocation
fritzj2 Jul 1, 2026
6d58afd
We added more data for position history
Jul 1, 2026
e670c2f
fixed the demo_data to make it easier to merge, and fixed the positio…
conwelld Jul 1, 2026
4c3f875
fixed demo data to fit pre existing format
conwelld Jul 1, 2026
6666512
fixed formating
Jul 1, 2026
0d517a9
fixed formating again
Jul 1, 2026
e5869bb
fixed merge conflict
Jul 1, 2026
ad3c194
Merge branch 'PeeWeeAttribute_PosHis' into Nahom_Dee_Alpha_peeweeAttr…
munsakad Jul 1, 2026
c953725
Merge pull request #597 from BCStudentSoftwareDevTeam/Nahom_Dee_Alpha…
munsakad Jul 1, 2026
49b5eac
Modified allocation
BhushanSah Jul 1, 2026
ea12fae
Merge branch 'allocation_demoData_JJ' into PeeWeeAttribute-CG-BS
BhushanSah Jul 1, 2026
5545996
Merge pull request #600 from BCStudentSoftwareDevTeam/PeeWeeAttribute…
BhushanSah Jul 1, 2026
30c5fe9
fixed the format issue on demo data and made the composite key on pos…
conwelld Jul 1, 2026
364a5e3
Merge pull request #601 from BCStudentSoftwareDevTeam/allocation_demo…
BhushanSah Jul 1, 2026
9b7e778
changed meta class in position history adn fixed identifiers in demo …
conwelld Jul 1, 2026
5c027e3
Resolved the merge conflict with the demo data
ArtemKurasov Jul 1, 2026
a52eeca
Add base for department portal
BrianRamsay Jul 2, 2026
0ebcfd7
Fix menu item highlighting for dept portal
BrianRamsay Jul 2, 2026
ba5a40b
Add empty file for common routes
BrianRamsay Jul 2, 2026
65c6b03
added an HTML file for manage people added the main routes to the page
Jul 2, 2026
7c1adec
Added member card
BhushanSah Jul 2, 2026
cc07c97
tried to add it
nahom70 Jul 2, 2026
6bb3e68
some change
conwelld Jul 2, 2026
c29f01f
added 3 sample buttons to learn HTML
johnlolonga19 Jul 2, 2026
f706242
Added the Manage Staff page
ArtemKurasov Jul 2, 2026
aa3a837
uniform sizing for cards that scale with the screen and no cards when…
fritzj2 Jul 3, 2026
d60b8e4
added an email symbol that opens in outlook
Jul 3, 2026
645e85a
added a 10 position cap to the amount of visible positons
fritzj2 Jul 3, 2026
d3c0b04
removed an unecessary print statement from the main_routes.py
fritzj2 Jul 3, 2026
5c6f767
Merge remote-tracking branch 'origin/dp-position-card' into manage_po…
NYABUTOA Jul 3, 2026
09022bd
Updated the Manage Staff table
ArtemKurasov Jul 3, 2026
426e2e7
Added a hover indicator for names on the Manage Staff table
ArtemKurasov Jul 3, 2026
dfa5971
we added some things and the table we hard coded
NYABUTOA Jul 3, 2026
213848c
Merge branch 'card1-alloc' into dp-position-card
fritzj2 Jul 3, 2026
693191b
got the first card added from Dayton's branch
fritzj2 Jul 3, 2026
f00b0fa
merged members card and removed unused css from base
fritzj2 Jul 3, 2026
1bb8c18
added real people into the members card, its wrong and gives us everyone
fritzj2 Jul 3, 2026
570293c
Updated the members card
BhushanSah Jul 6, 2026
3f6aa59
changed the button from members to blue
fritzj2 Jul 6, 2026
77e9714
added the bottom border and centered the button
fritzj2 Jul 6, 2026
0346556
Merge remote-tracking branch 'origin/members-card' into Bright_Artem_…
ArtemKurasov Jul 6, 2026
6c52ca9
fixedgit add app/controllers/main_routes/main_routes.py Now current d…
BhushanSah Jul 6, 2026
f26adc4
Merge branch 'dp-position-card' of https://github.com/BCStudentSoftwa…
BhushanSah Jul 6, 2026
ea79ff6
unordered list now bullets elements, icon is in the top right, and ro…
fritzj2 Jul 6, 2026
4cd48d8
Merge branch 'manage_positions_ADN' into dp-position-card
fritzj2 Jul 6, 2026
827becc
gitMerge branch 'dp-position-card' of https://github.com/BCStudentSof…
fritzj2 Jul 6, 2026
e975c48
Merge branch 'development' of https://github.com/BCStudentSoftwareDev…
fritzj2 Jul 6, 2026
c1ffd57
fixed supervisor for members card
BhushanSah Jul 6, 2026
3b800cf
merged new version of managepositions into our branch, fixed the main…
fritzj2 Jul 6, 2026
eb0b99f
Merge branch 'dp-position-card' of https://github.com/BCStudentSoftwa…
fritzj2 Jul 6, 2026
725ce6a
polished the UI
nahom70 Jul 6, 2026
5a585e3
Merge pull request #624 from BCStudentSoftwareDevTeam/dp-position-card
nahom70 Jul 6, 2026
be66a39
Turned the Manage Staff Table into a Data Table
ArtemKurasov Jul 6, 2026
aa70ade
fixed the ban button length
Jul 6, 2026
2e57799
added table borders
Jul 6, 2026
c343599
Merge pull request #632 from BCStudentSoftwareDevTeam/PeeWeeAttribute
nahom70 Jul 6, 2026
0445144
Merge branch 'PeeWeeAttribute' into Bright_Artem_manage_people
ArtemKurasov Jul 6, 2026
0f137c0
merge commit with PeeWeeAttribute, creates a nested meta class
conwelld Jul 6, 2026
05bd744
Merge pull request #596 from BCStudentSoftwareDevTeam/PeeWeeAttribute…
MImran2002 Jul 6, 2026
ae3189a
Dynamic data from Tracy
nahom70 Jul 6, 2026
2c720b0
Make the Manage Staff Table Pull From the Demo Data
ArtemKurasov Jul 7, 2026
ae3f15e
Renamed Manage Staff to Manage Members + Changed Routes to the Manage…
ArtemKurasov Jul 7, 2026
ab3bfb9
Merge branch 'manage_positions_ADN' into PeeWeeAttribute
nahom70 Jul 7, 2026
0f435f2
Moved the isBanned attribute from SupervisorDepartment to Supervisor
ArtemKurasov Jul 7, 2026
fb12640
created a toggle button and took out a button
Jul 7, 2026
63524f1
Fixed the switches + Moved all the styles to the managemembers.css file
ArtemKurasov Jul 7, 2026
489c9c8
Made the Supervisees column on the Manage Members page reflect data f…
ArtemKurasov Jul 8, 2026
a106738
Fixed how Secondaries Are Displayed
ArtemKurasov Jul 8, 2026
e6a6e77
Moved all the styles to managemembers.css + Removed sorting from the …
ArtemKurasov Jul 8, 2026
410cf43
No passwords in files
BrianRamsay Jul 8, 2026
3cd1205
Added new model requiremetns
BrianRamsay Jul 8, 2026
a57e055
Add new DDL to prod backup
BrianRamsay Jul 8, 2026
a6e09db
Fix failing admin management tests
BrianRamsay Jul 8, 2026
2de8e2b
Fix failing tests - missing Term, and new tracy setup reqs
BrianRamsay Jul 8, 2026
4203dc5
Fixed remaining failing tests
BrianRamsay Jul 8, 2026
cfd9ee9
Merge pull request #640 from BCStudentSoftwareDevTeam/add-models
BrianRamsay Jul 8, 2026
97f05f5
Add option to run just one file
BrianRamsay Jul 8, 2026
10ae9a2
Merge branch 'department-portal-base' of github.com:BCStudentSoftware…
BrianRamsay Jul 8, 2026
31be945
added a flash message on status
Jul 8, 2026
ce98927
Deleted the isActive attribute from SupervisorDepartment
ArtemKurasov Jul 8, 2026
0967002
merged peeweeattribute into Bright_Artem_manage_people
Jul 8, 2026
4849854
merged peeweeattribute into Bright_Artem_manage_people
Jul 8, 2026
7b378f3
resolved merge conflict
Jul 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/main_routes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def injectGlobalData():
'lastStaticUpdate': lastStaticUpdate}

from app.controllers.main_routes import main_routes
from app.controllers.main_routes import departmentPortal
from app.controllers.main_routes import laborStatusForm
from app.controllers.main_routes import laborHistory
from app.controllers.main_routes import alterLSF
Expand Down
69 changes: 69 additions & 0 deletions app/controllers/main_routes/departmentPortal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
from flask import render_template, request, json, redirect, url_for, send_file, g, flash, jsonify
from peewee import JOIN, DoesNotExist, fn, Case
from functools import reduce
import operator
from app.models.department import Department
from app.models.supervisor import Supervisor
from app.models.supervisorDepartment import SupervisorDepartment
from app.models.student import Student
from app.models.laborStatusForm import LaborStatusForm
from app.models.formHistory import FormHistory
from app.models.term import Term
from app.controllers.admin_routes.allPendingForms import checkAdjustment
from app.controllers.main_routes import main_bp
from app.logic.download import CSVMaker, saveFormSearchResult, retrieveFormSearchResult
from app.logic.search import getDepartmentsForSupervisor, searchPerson, searchSupervisorPortal
from app.login_manager import require_login, logout
from app.logic.getTableData import getDatatableData
from app.logic.banner import Banner
from flask import abort


@main_bp.route('/department/<org>/<account>/members', methods=['GET'])
def manageStaff(org=None,account=None):
try:
dept = Department.get(Department.ORG == org, Department.ACCOUNT == account)
except (NameError, DoesNotExist):
dept = None
abort(404)

members = list(
SupervisorDepartment.
select(
SupervisorDepartment,
Supervisor
).where(
SupervisorDepartment.department == dept
).join(
Supervisor
).dicts()
)

student_count = list(
LaborStatusForm.
select(
fn.SUM(Case(LaborStatusForm.jobType, (("Primary", 1),), 0)).alias("primary_positions"),
fn.SUM(Case(LaborStatusForm.jobType, (("Secondary", 1),), 0)).alias("secondary_positions"),
LaborStatusForm.department,
LaborStatusForm.supervisor
).group_by(
LaborStatusForm.department,
LaborStatusForm.supervisor
).dicts()
)


counts = {(row["department"], row["supervisor"]): row for row in student_count}

for member in members:

key = (member["department"], member["supervisor"])
row = counts.get(key, {})

member["primary_positions"] = row.get("primary_positions", 0)
member["secondary_positions"] = row.get("secondary_positions", 0)

return render_template('main/manageMembers.html',
members = members,
department = dept)

56 changes: 54 additions & 2 deletions app/controllers/main_routes/main_routes.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -16,6 +16,7 @@
from app.login_manager import require_login, logout
from app.logic.getTableData import getDatatableData
from app.logic.banner import Banner
from app.logic.tracy import Tracy

@main_bp.route('/logout', methods=['GET'])
def triggerLogout():
Expand Down Expand Up @@ -47,6 +48,57 @@ def supervisorPortal():
currentUser = currentUser
)

@main_bp.route('/department', methods=['GET'])
@main_bp.route('/department/<org>', methods=['GET'])
@main_bp.route('/department/<org>/<account>', methods=['GET'])
def departmentPortal(org=None,account=None):
if org and account:
try:
dept = Department.get(Department.ORG == org, Department.ACCOUNT == account)
except (NameError, DoesNotExist):
dept = None
else:
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()))

pos = Tracy().getPositionsFromDepartment(org, account)
positions = []
for i in pos:
positions.append(i.POSN_TITLE + "" + "(" + i.WLS + ")")

staff = Tracy().getSupervisors()
supervisors = []

for i in staff:
if i.ORG == org:
supervisors.append(i.FIRST_NAME + " " + i.LAST_NAME + " (" + i.EMAIL + ")")

return render_template('main/departmentPortal.html',
departments = departments,
department = dept,
positions = positions,
supervisors = supervisors
)

@main_bp.route('/department/<org>/<account>/managepositions', methods=['GET'])
def managePositions(org, account):
try:
dept = Department.get(Department.ORG == org, Department.ACCOUNT == account)
except DoesNotExist:
return render_template('errors/404.html'), 404

positions = Tracy().getPositionsFromDepartment(org, account)
print(positions)
return render_template('main/managepositions.html',
department = dept,
department_name = dept.DEPT_NAME,
positions = positions
)

@main_bp.route('/supervisorPortal/addUserToDept', methods=['GET', 'POST'])
def addUserToDept():
userDeptData = request.form
Expand Down Expand Up @@ -113,4 +165,4 @@ def submitToBanner(formHistoryId):
if save_form_status:
return "Form successfully submitted to Banner.", 200
else:
return "Submitting to Banner failed.", 500
return "Submitting to Banner failed.", 500
23 changes: 23 additions & 0 deletions app/models/allocation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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)
isFinal = BooleanField(default=False)
approvedOn = DateField(null=True)
approvedBy = ForeignKeyField(Supervisor, null=True)
justification = TextField()
primary_10 = IntegerField()
primary_12 = IntegerField()
primary_15 = IntegerField()
primary_20 = IntegerField()
secondary_5 = IntegerField()
secondary_10 = IntegerField()
breakHours = IntegerField()

class Meta:
indexes = ( (('termCode', 'department', 'isFinal'), True), )

14 changes: 14 additions & 0 deletions app/models/positionHistory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from app.models import *
from app.models.department import Department

class PositionHistory(baseModel):
positionCode = CharField()
department = ForeignKeyField(Department)
status = CharField()
wls = IntegerField()
revisionDate = DateField()
description = TextField(default=None)

class Meta:
indexes = ( (('positionCode', 'revisionDate', 'status'), True), )

8 changes: 5 additions & 3 deletions app/models/supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ class Supervisor(baseModel):
ORG = CharField(null=True)
DEPT_NAME = CharField(null=True)

legal_name = CharField(null=True)
preferred_name = CharField(null=True)
isActive = BooleanField(default=False)
legal_name = CharField(null=True)
preferred_name = CharField(null=True)
isActive = BooleanField(default=False)
isBanned = BooleanField(default=False)



@property
Expand Down
3 changes: 2 additions & 1 deletion app/models/supervisorDepartment.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
from app.models.department import Department

class SupervisorDepartment(baseModel):
supervisor = ForeignKeyField(Supervisor, null=True)
supervisor = ForeignKeyField(Supervisor)
department = ForeignKeyField(Department)
isCoordinator = BooleanField(default=False)
73 changes: 73 additions & 0 deletions app/static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Loading