Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 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
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
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
c343599
Merge pull request #632 from BCStudentSoftwareDevTeam/PeeWeeAttribute
nahom70 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
ab3bfb9
Merge branch 'manage_positions_ADN' into PeeWeeAttribute
nahom70 Jul 7, 2026
2dc225d
Merge pull request #635 from BCStudentSoftwareDevTeam/PeeWeeAttribute
nahom70 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
46 changes: 39 additions & 7 deletions app/controllers/main_routes/main_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -51,21 +52,52 @@ 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 = []
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)
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():
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)
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


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;
}
135 changes: 133 additions & 2 deletions app/templates/main/departmentPortal.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
{% block scripts %}
{{super()}}
<script type="text/javascript" src="{{url_for('static', filename='js/departmentPortal.js') }}?u={{lastStaticUpdate}}"></script>
<link rel="stylesheet" type="text/css"
href="{{url_for('static', filename ='css/departmentPortal.css')}}?u={{lastStaticUpdate}}">
{% 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">
<select class="selectpicker"
Expand All @@ -24,4 +26,133 @@ <h2 class="text-center">{% if department %} {{department.DEPT_NAME}} Portal {% e
</select>

</div>
{% endblock %}

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

<div class="card" style="width:50rem; border-radius: 2rem;">
<div class="card-body">
<h5 class="card-title">
<svg xmlns="http://www.w3.org/2000/svg" width="16"height="16"fill="currentColor" class="bi bi-clock" viewBox="0 0 16 16">
<path d="M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71z"/>
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0"/>
</svg>
Current Allocation
</h5>
<p class="card-text"><br> AY 26/27 15/20 POSITIONS <br><br> Break Hours 0 of 200 hrs</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>

<section class="card "style="width:50rem; border-radius: 2rem;" aria-labelledby="members-title">
<div class="card-body">
<div class="media">
<div class="media-left">
<span class="btn btn-default btn-lg img-circle disabled" aria-hidden="true">
<i class="fa fa-users"></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 mb-3" style="width:50rem; border-radius: 2rem;">
<div class="card-body">
<div class="media">
<div class="media-body media-middle">
<h1>Positions</h1>
</div>
<div class="media-right">
<span class="btn btn-default btn-lg img-circle disabled" aria-hidden="true">
<i class="fa fa-suitcase"></i>
</span>
</div>

</div>
<ul style="line-height:2;">
{% for p in positions %}
{% if 7 > loop.index0 %}
<li class="card-text">{{ p }}</li>
{% 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 Details <span class="glyphicon glyphicon-chevron-right"></span></a>
</div>
</div>
</div>

{% endif %}


<!-- <div class="col-sm-4">
<section class="card members-card" aria-labelledby="members-title">
<div class="card-body">

<div class="media">
<div class="media-left">
<span class="members-card-icon" aria-hidden="true">
<i class="fa fa-users"></i>
</span>
</div>

<div class="media-body media-middle">
<h3 id="members-title" class="media-heading card-title">
<strong>Members</strong>
</h3>
</div>
</div>

<h4 class="text-primary"><strong>Labor Coordinator</strong></h4>
<p class="card-text">Dr. Jones</p>

<h4 class="text-primary"><strong>Supervisors</strong></h4>
<p class="card-text">
Dr. Heggen<br>
Dr. Nakazawa
</p>

<p class="text-center">
<span class="members-card-cta">
<a href="#" class="btn btn-primary btn-sm members-card-btn">
View Details <span class="glyphicon glyphicon-chevron-right"></span>
</a>

</span>
</p>

</div>
</section>
</div> -->

{% 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 %}
2 changes: 1 addition & 1 deletion app/templates/main/supervisorPortal.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ <h1 class="fs-1" data-toggle="collapse">Form Search</h1>
</div>
<br>
<div style="position: relative; z-index: 1;" id="sortOptions">
<div class="container-fluid" style="margin-bottom: -40px; float: right;">
<div class="container-fluid" style="margin-bottom: 15px; float: right;">
<label for="columnPicker">Sorting Options:</label>
<select id="columnPicker" name="columnPicker" class="selectpicker" title="Column">
<option value="term">Term</option>
Expand Down
Loading