Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 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
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
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
364a5e3
Merge pull request #601 from BCStudentSoftwareDevTeam/allocation_demo…
BhushanSah 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
9d4acbf
Started working on HTML design
zhytkovd Jul 2, 2026
8deecb5
Finished initial design of the department page
zhytkovd Jul 4, 2026
9a14e6d
Fixed current year button position
zhytkovd Jul 6, 2026
6a5fec7
centered data in the table and div container
zhytkovd Jul 6, 2026
20e8718
Merge branch 'PeeWeeAttribute' into dep_portal_ad
ACBerea Jul 6, 2026
cde15a7
Merge branch 'development' into dep_portal_ad
zhytkovd Jul 6, 2026
7341b74
Fixed actions button: made it similar to the other dropdown menus
zhytkovd Jul 7, 2026
25b6251
Finished requested UI changes: renaming some elements
zhytkovd Jul 7, 2026
c6c7293
Added brake hours from the database to the UI
zhytkovd Jul 7, 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
10 changes: 9 additions & 1 deletion app/controllers/admin_routes/manage_departments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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/<departmentID>", methods=['GET'])
def getSupervisorsInDepartment(departmentID):
currentUser = require_login()
Expand Down
1 change: 1 addition & 0 deletions app/controllers/main_routes/departmentPortal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from flask import render_template
24 changes: 22 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 Down Expand Up @@ -47,6 +47,26 @@ 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):
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
Expand Down Expand Up @@ -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
return "Submitting to Banner failed.", 500
19 changes: 19 additions & 0 deletions app/models/allocation.py
Original file line number Diff line number Diff line change
@@ -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(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()
10 changes: 10 additions & 0 deletions app/models/positionHistory.py
Original file line number Diff line number Diff line change
@@ -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)
9 changes: 9 additions & 0 deletions app/models/supervisorDepartment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@
class SupervisorDepartment(baseModel):
supervisor = ForeignKeyField(Supervisor, null=True)
department = ForeignKeyField(Department)
banStatus = BooleanField(default=False)
isActive = BooleanField(default=False)
isCoordinator = BooleanField(default=False)

@property
def isBanned(self):
return self.banStatus


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);
}
6 changes: 6 additions & 0 deletions app/static/css/manageDepartments.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ h1 {

#flasher{
z-index: 999999;
}

#activeDepartmentsTable th,
#activeDepartmentsTable td {
vertical-align: middle;
text-align: center;
}
6 changes: 6 additions & 0 deletions app/static/js/departmentPortal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$(document).ready(function() {
$("#selectedDepartment").on("change",function() {
deptData = $(this).find('option:selected').data();
window.location = `/department/${deptData.org}/${deptData.account}`;
});
});
Loading