Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 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
076c2c4
Updating setup.sh to fix symbolic link issue
sheggen 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
c141adc
thought about storing it in CURRENT_DIR=/Users/imran/Desktop/SSDT Imr…
MImran2002 Jul 1, 2026
ff54bf7
as this works from the root as source setup must run from the root we…
MImran2002 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
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
aa3a837
uniform sizing for cards that scale with the screen and no cards when…
fritzj2 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
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
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
abcd951
Add real data to the Current Allocation card
DanielRukwasha 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
cdabc2a
added changes to format with all 3 cards
conwelld 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
b75e822
Revert "Add real data to the Current Allocation card"
DanielRukwasha Jul 6, 2026
b1e8ee2
made changes so three cards show up
conwelld Jul 6, 2026
68c055b
Merge branch 'card1-alloc' of https://github.com/BCStudentSoftwareDev…
conwelld Jul 6, 2026
827becc
gitMerge branch 'dp-position-card' of https://github.com/BCStudentSof…
fritzj2 Jul 6, 2026
26704f9
Merge pull request #599 from BCStudentSoftwareDevTeam/update_setup
BrianRamsay 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
f5b4976
began formatting allocation card for pull request draft
conwelld Jul 6, 2026
eacbf27
removed some hardcoded css, fixed the icon
fritzj2 Jul 6, 2026
c3b577a
merge commit with the allocation branch
fritzj2 Jul 6, 2026
dbb1bd1
Revert "merge commit with the allocation branch"
fritzj2 Jul 6, 2026
3bcc164
refixed the icon, added an if statement for the No positions edge case
fritzj2 Jul 6, 2026
f759f54
began fixing the position of the current alloc icon.
fritzj2 Jul 6, 2026
c343599
Merge pull request #632 from BCStudentSoftwareDevTeam/PeeWeeAttribute
nahom70 Jul 6, 2026
c768d7b
added format changes to match the 3 cards and corrected color
conwelld Jul 6, 2026
0f137c0
merge commit with PeeWeeAttribute, creates a nested meta class
conwelld Jul 6, 2026
c304338
Merge branch 'PeeWeeAttribute' into allocation_card
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
4945044
fixed the view positions button and WLS print
johnlolonga19 Jul 7, 2026
ab3bfb9
Merge branch 'manage_positions_ADN' into PeeWeeAttribute
nahom70 Jul 7, 2026
b64a5a6
made cards dynamiocally resizable
johnlolonga19 Jul 7, 2026
d9a4772
merged commit peeweeattribute
johnlolonga19 Jul 7, 2026
aa69805
added a link from position history to Tracy on the card
johnlolonga19 Jul 7, 2026
9699743
added a link to the html position card
johnlolonga19 Jul 7, 2026
1ea2a90
Merge branch 'development' of https://github.com/BCStudentSoftwareDev…
fritzj2 Jul 8, 2026
b93eaf9
added a conditional to check if a link is present in dp, removed prin…
fritzj2 Jul 8, 2026
b1e9d1e
added changes from previous branch, card and main routes
fritzj2 Jul 8, 2026
7fda0cf
added space for the other cards, gave a db table for the positionHistory
fritzj2 Jul 8, 2026
d86c8ea
Fixed the url for the specific positions in the card
fritzj2 Jul 8, 2026
f6dabdf
rounded the corner of the card using base.css
fritzj2 Jul 8, 2026
a951515
view details -> view all positions
fritzj2 Jul 8, 2026
082569e
added the position history to the demo data to test the links
fritzj2 Jul 8, 2026
980db52
merging changes from position-card-604 into dp-position-card
fritzj2 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
69 changes: 64 additions & 5 deletions app/controllers/main_routes/main_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
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
from app.models.positionHistory import PositionHistory

@main_bp.route('/logout', methods=['GET'])
def triggerLogout():
Expand Down Expand Up @@ -51,21 +53,78 @@ def supervisorPortal():
@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):
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 = []
pos_his = []
if pos == []:
positions = ["No Positions for this Department"]
else:
for i in pos:
positions.append(i.POSN_TITLE + ": " + "(WLS " + i.WLS + ")")
try:
pos_his_obj = PositionHistory.get(PositionHistory.positioncode == i.POSN_CODE)
pos_his.append(str(pos_his_obj.positioncode) + str(pos_his_obj.revisiondate))
except:
pos_his.append("#")

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

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


pos = Tracy().getPositionsFromDepartment(org, account)
positions = []
pos_his = []
if pos == []:
positions = ["No Positions for this Department"]
else:
for i in pos:
positions.append(i.POSN_TITLE + ": " + "(WLS " + i.WLS + ")")
try:
pos_his_obj = PositionHistory.get(PositionHistory.positioncode == i.POSN_CODE)
pos_his.append(str(pos_his_obj.positioncode) + str(pos_his_obj.revisiondate))
except:
pos_his.append("#")

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

@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():
Expand Down
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()
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()
13 changes: 13 additions & 0 deletions app/models/positionHistory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from app.models import *
from app.models.department import Department

class PositionHistory(baseModel):
positioncode = CharField()
status = CharField()
WLS = IntegerField()
revisiondate = DateField()
Description = TextField(default=None)
Department = ForeignKeyField(Department)

class Meta:
primary_key = CompositeKey('positioncode', 'revisiondate', 'status')
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


4 changes: 4 additions & 0 deletions app/static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ a {
background-clip: border-box;
border: 1px solid rgba(0, 0, 0, 0.125);
border-radius: 0.25rem;
overflow: hidden;
}

.card-body {
Expand Down Expand Up @@ -250,6 +251,9 @@ a {
padding: 0.5rem 1rem;
background-color: rgba(0, 0, 0, 0.03);
border-top: 1px solid rgba(0, 0, 0, 0.125);
border-bottom-left-radius: 1rem;
border-bottom-right-radius: 1rem;

}

.card-footer:last-child {
Expand Down
15 changes: 15 additions & 0 deletions app/static/css/managepositions.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.width-12{
width:12%;
}

*{
/* outline:solid 1px lime; */
margin:0;
padding:0;
box-sizing:border-box;
}

.department-header{
padding:1%;
margin-top:-20px;
}
116 changes: 114 additions & 2 deletions app/templates/main/departmentPortal.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
{% block scripts %}
{{super()}}
<script type="text/javascript" src="{{url_for('static', filename='js/departmentPortal.js') }}?u={{lastStaticUpdate}}"></script>
<link rel="stylesheet" type="text/css"
{% endblock %}

{% block app_content %}
<h2 class="text-center">{% if department %} {{department.DEPT_NAME}} Portal {% else %} Choose a Department: {% endif %} </h2>


<!--selectpicker for department-->
<div class="form-group">
<div class="form-group" style="width:65rem; margin-left: auto; margin-right:auto">
<select class="selectpicker"
name='department'
id='selectedDepartment'
Expand All @@ -24,4 +25,115 @@ <h2 class="text-center">{% if department %} {{department.DEPT_NAME}} Portal {% e
</select>

</div>

{% if department %}
<div class="card-group" style="display:inline-flex; gap: 1rem">

<section class="card "style="width:90%; border-radius: 1rem;" aria-labelledby="current_allocation-title">
<div class="card-body">
<div class="media">
<div class="header-container" style="padding-top: 12px;">
<span aria-hidden="true" style="color: #424242; font-size: 24px;">
<i class="bi bi-clock" style="border: 1px solid #c0c0c0; border-radius: 12px; padding: 3px 3.5px 1.5px 3.5px; font-size: 1.5em; color: #6e6e6e"></i>
<h1 style="display: inline; margin: 0;" >Current Allocation</h1>
</span>
</div>
</div>
<div>
<div class="header-container" style="display: flex; justify-content: space-between; align-items: center; padding-left: 10px; padding-right: 10px;">
<h3>AY 26/27</h3> <h3>15/20 Positions</h3>
</div>
<ul style="font-size: 1.2em; padding-left: 75px;">
<li>10 HR : 2</li>
<li>12 HR : 3</li>
<li>15 HR : 5</li>
<li>20 HR : 5</li>
</ul>
</div>
<div class="header-container" style="display: flex; justify-content: space-between; align-items: center; padding-left: 10px; padding-right: 10px;">
<h3>Break Hours</h3> <h3>0 of 200 Hrs.</h3>
</div>
</div>
<div class="card-footer text-center">
<a href="#" class="btn btn-primary btn-sm">
View Details <span class="glyphicon glyphicon-chevron-right"></span>
</a>
<a href="#" class="btn btn-primary btn-sm">
Request Allocation <span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</section>

<section class="card "style="width:90%; border-radius: 1rem;" aria-labelledby="members-title">
<div class="card-body">
<div class="media">
<div class="media-left media-middle">
<span aria-hidden="true" style="color: #000; font-size: 24px;">
<i class="bi bi-people-fill" style="border: 1px solid #c0c0c0; border-radius: 12px; padding: 3px 3.5px 1.5px 3.5px; font-size: 1.5em; color: #6e6e6e"></i>
</span>
</div>

<div class="media-body media-middle">
<h1>
Members
</h1>
</div>
</div>
<h4>Labor Coordinator(s)</h4>
<p>Dr. Jones</p>

<h2>Supervisors</h2>
{% for s in supervisors %}
{% if 3 > loop.index0 %}
<p>{{ s }}</p>
{% elif 4 > loop.index0 %}
<p>and {{ supervisors | length}} more...</p>
{% endif %}
{% endfor %}
</div>

<div class="card-footer text-center">
<a href="#" class="btn btn-primary">View Details
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</section>

<div class="card" style="width:90%; border-radius: 1rem;">
<div class="card-body">
<div class="media">
<div class="media-left media-middle">
<span aria-hidden="true" style="color: #424242; font-size: 24px;">
<i class="bi bi-suitcase-lg-fill" style="border: 1px solid #c0c0c0; border-radius: 12px; padding: 3px 3.5px 1.5px 3.5px; font-size: 1.5em; color: #6e6e6e"></i>
</span>
</div>
<div class="media-body media-middle">
<h1>Positions</h1>
</div>

</div>
<ul style="line-height:2;">
{% for p in positions %}
{% if 7 > loop.index0 %}
{% if not pos_his[loop.index0] == "#" %}
<li class="card-text">
<a href= "/department/{{ department.ORG }}/{{ department.ACCOUNT }}/managepositions/{{pos_his[loop.index0]}}">{{ p }}</a> </li>
{% else %}
<li class="card-text">{{ p }}</li>
{% endif %}
{% elif 8 == loop.index0 %}
</ul><p class="card-text">and {{ positions | length}} more...</p>
{% endif %}
{% endfor %}
</ul>

</div>
<div class="card-footer text-center">
<a href="/department/{{ department.ORG }}/{{ department.ACCOUNT }}/managepositions" class="btn btn-primary">View All Positions<span class="glyphicon glyphicon-chevron-right"></span></a>
</div>
</div>
</div>

{% endif %}

{% endblock %}
90 changes: 90 additions & 0 deletions app/templates/main/managepositions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{% extends "base.html" %}

{% block styles %}
{{super()}}
<link href="/static/css/managepositions.css?u={{lastStaticUpdate}}" rel="stylesheet" type="text/css">
{% endblock %}

{% block scripts %}
{{super()}}
<script type="text/javascript" src="{{url_for('static', filename='js/managePositions.js') }}?u={{lastStaticUpdate}}"></script>
{% endblock %}

{% block app_content %}
<div class="text-white department-header">
<h2>{{ department_name }}</h2>
</div>

<div class="container-fluid position-management">

<div class="row page-header">
<div class="form-group col-xs-4 ">
<select class="selectpicker"
name='department'
id='selectedDepartment'
data-live-search='true'
title="Department"
>
<option value = "" disabled selected>Search a position</option>
{% for p in positions %}
<option data-account="{{p.POSN_TITLE}}" data-org="{{p.POSN_CODE}}" data-content=
"<span>{{p.DEPT_NAME}}</span><small class='text-muted'> {{p.POSN_TITLE}} </small>">{{p.POSN_TITLE}}</option>
{% endfor %}
</select>

</div>
<h1 class="col-xs-4 text-center">Manage Positions</h1>
<div class="col-xs-4 text-right">
<button class="btn add-btn btn-primary" id="addPositionButton">
Add Position
</button>
</div>
</div>

<div class="table-responsive">
<table class="table table-striped table-bordered text-center" id="positionTable">
<thead>
<tr>
<th class="text-center">Position (WSL)</th>
<th class="text-center">Position Code</th>
<th class="text-center">Status</th>
<th class="width-12 text-center">Last Revision Date</th>
<th class="width-12 text-center">View Position Description</th>
<th class="text-center">Edit Position Description</th>
</tr>
</thead>
<tbody>
<!-- Sample Row -->

{% for position in positions %}
<tr>
<td>{{position.POSN_TITLE}} ({{position.WLS}})</td>
<td>{{position.POSN_CODE}}</td>
<td>
<p class="bg-success p-5">
Active
</p>
</td>
<td>01/01/2024</td>
<td>
<button class="btn btn-success view-btn">
View
</button>
</td>
<td>
<button class="btn btn-primary request-btn">
Request an Update
</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<h3 class="total">
Total Positions:
<span id="positionCount">{{ positions|length }}</span>
</h2>
</div>

{% endblock %}
Loading