diff --git a/app/controllers/main_routes/main_routes.py b/app/controllers/main_routes/main_routes.py index e4b661e4..b9769600 100755 --- a/app/controllers/main_routes/main_routes.py +++ b/app/controllers/main_routes/main_routes.py @@ -6,7 +6,7 @@ from app.models.allocation import Allocation from app.models.department import Department from app.models.supervisor import Supervisor -from app.models.supervisorDepartment import SupervisorDepartment +from app.models.supervisorDepartment import SupervisorDepartment from app.models.student import Student from app.models.laborStatusForm import LaborStatusForm from app.models.formHistory import FormHistory @@ -161,12 +161,16 @@ def count_workers(job_type, hours_bucket): @main_bp.route('/department///positions', methods=['GET']) def managePositions(org, account): try: + currentUser = require_login() + if not currentUser or not currentUser.supervisor: + return render_template('errors/403.html'), 403 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) + print("THIS IS Dept:", dept) + + positions = PositionHistory.select().where((PositionHistory.department == dept) & (PositionHistory.status == "Active")).order_by(PositionHistory.positionTitle.asc()) + return render_template('main/managepositions.html', department = dept, department_name = dept.DEPT_NAME, diff --git a/app/static/css/managepositions.css b/app/static/css/managepositions.css index 9c40bbe3..964e7b3f 100644 --- a/app/static/css/managepositions.css +++ b/app/static/css/managepositions.css @@ -1,7 +1,9 @@ .width-12{ width:12%; } - +.margin-top-10{ + margin-top:-25px; +} *{ /* outline:solid 1px lime; */ margin:0; @@ -12,4 +14,8 @@ .department-header{ padding:1%; margin-top:-20px; +} + +td{ + text-align:center !important; } \ No newline at end of file diff --git a/app/static/js/managePositions.js b/app/static/js/managePositions.js new file mode 100644 index 00000000..0cbe4d7b --- /dev/null +++ b/app/static/js/managePositions.js @@ -0,0 +1,9 @@ +$(document).ready(function () { + $('#positionTable').DataTable({ + pageLength: 25, + columnDefs: [ + { className: 'dt-head-center', targets: '_all' }, + { orderable: false, targets: [4,4 ] } + ] + }); +}); diff --git a/app/templates/main/departmentPortal.html b/app/templates/main/departmentPortal.html index e2749191..8c3f3d63 100644 --- a/app/templates/main/departmentPortal.html +++ b/app/templates/main/departmentPortal.html @@ -3,7 +3,12 @@ {% block scripts %} {{super()}} +<<<<<<< HEAD + +======= +>>>>>>> 60ada1ecec53be4b8241ba3c3213984376bc73b6 {% endblock %} {% block app_content %}

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

@@ -25,8 +30,36 @@

{% if department %} {{department.DEPT_NAME}} Portal {% e +<<<<<<< HEAD {% if department %} -
+
+ +
+
+
+ + + + + Current Allocation +
+


AY 26/27 15/20 POSITIONS

Break Hours 0 of 200 hrs

+ Go somewhere +
+
+ +
+
+
+
+ +
+======= + + {% if department %} +
@@ -75,12 +108,30 @@

Break Hours

{{break_hours}}/{{allocation.breakHours or 0}} Hours

+>>>>>>> 60ada1ecec53be4b8241ba3c3213984376bc73b6

Members

+<<<<<<< HEAD +

Labor Coordinator(s)

+

Dr. Jones

+ +

Supervisors

+ {% for s in supervisors %} + {% if 3 > loop.index0 %} +

{{ s }}

+ {% elif 4 > loop.index0 %} +

and {{ supervisors | length}} more...

+ {% endif %} + {% endfor %} +
+ +
+<<<<<<< HEAD +
+
+
+
+

Positions

+
+
+ +
+ +
+
    + {% for p in positions %} + {% if 7 > loop.index0 %} +
  • {{ p }}
  • + {% elif 8 == loop.index0 %} +

and {{ positions | length}} more...

+ {% endif %} + {% endfor %} + + +
+ +
+
+ +{% endif %} + + + + +{% endblock %}\ + + + + +=======
@@ -185,3 +318,4 @@

Positions

{% endif %} {% endblock %} +>>>>>>> 60ada1ecec53be4b8241ba3c3213984376bc73b6 diff --git a/app/templates/main/managepositions.html b/app/templates/main/managepositions.html index f61558a3..a300c3b7 100644 --- a/app/templates/main/managepositions.html +++ b/app/templates/main/managepositions.html @@ -2,42 +2,23 @@ {% block styles %} {{super()}} + {% endblock %} {% block scripts %} {{super()}} + {% endblock %} {% block app_content %} -
-

{{ department_name }}

-
- @@ -45,35 +26,30 @@

Manage Positions

- - - + + - + + {% for position in positions %} - - - - + + + @@ -81,10 +57,10 @@

Manage Positions

Position (WSL)Position CodeStatusPositionWLS Last Revision Date View Position DescriptionEdit Position DescriptionEdit Position Description
{{position.POSN_TITLE}} ({{position.WLS}}){{position.POSN_CODE}} -

- Active -

-
01/01/2024{{position.positionTitle}} {{position.positionCode}} {{position.wls}}{{position.revisionDate}} -
-

+

{% endblock %} diff --git a/database/demo_data.py b/database/demo_data.py index e372ea85..7e674914 100644 --- a/database/demo_data.py +++ b/database/demo_data.py @@ -19,7 +19,8 @@ from app.models.notes import Notes from app.models.supervisorDepartment import SupervisorDepartment from app.models.allocation import Allocation -from app.models.positionHistory import PositionHistory +from app.models.positionHistory import PositionHistory +# from app.models.ActivePosition import ActivePosition print("Inserting data for demo and testing purposes") @@ -569,46 +570,10 @@ "adjustmentCutOff": f"{2026}-10-01", }, { - "termCode": f"{2025}00", - "termName": f"AY {2025}-{2025+1}", - "termStart": f"{2025}-08-01", - "termEnd": f"{2025+1}-05-01", - "termState": 1, - "primaryCutOff": f"{2025}-09-01", - "adjustmentCutOff": f"{2025}-09-01", - }, - { - "termCode": f"{2025-1}00", - "termName": f"AY {2025-1}-{2025}", - "termStart": f"{2025-1}-08-01", - "termEnd": f"{2025}-05-01", - "termState": 1, - "primaryCutOff": f"{2025-1}-09-01", - "adjustmentCutOff": f"{2025-1}-09-01", - }, - { - "termCode": f"{2025-2}00", - "termName": f"AY {2025-2}-{2025-1}", - "termStart": f"{2025-2}-08-01", - "termEnd": f"{2025-1}-05-01", - "termState": 1, - "primaryCutOff": f"{2025-2}-09-01", - "adjustmentCutOff": f"{2025-2}-09-01", - }, - { - "termCode": f"{2025-3}00", - "termName": f"AY {2025-3}-{2025-2}", - "termStart": f"{2025-3}-08-01", - "termEnd": f"{2025-2}-05-01", - "termState": 1, - "primaryCutOff": f"{2025-3}-09-01", - "adjustmentCutOff": f"{2025-3}-09-01", - }, - { - "termCode": f"{2025-4}00", - "termName": f"AY {2025-4}-{2025-3}", - "termStart": f"{2025-4}-08-01", - "termEnd": f"{2025-3}-05-01", + "termCode": f"202500", + "termName": f"AY 2025-2026", + "termStart": f"2025-08-01", + "termEnd": f"2026-05-01", "termState": 1, "primaryCutOff": f"{2025-4}-09-01", "adjustmentCutOff": f"{2025-4}-09-01", @@ -1015,43 +980,53 @@ { "positionTitle": "Student Programmer", "positionCode": "S61407", + "department": 1, "status": "Active", "wls": 1, "revisionDate": f"2026-07-01", + "revisionDate": "2025-07-01", "description": "", - "department": 1 + }, { + "positionTitle": "Research Associate", "positionTitle": "Research Associate", "positionCode": "S61408", + "department": 1, "status": "Active", "wls": 2, "revisionDate": f"2026-09-01", + "revisionDate": "2025-09-01", "description": "", - "department": 1 }, { "positionTitle": "Labor Workers", "positionCode": "S61409", + "department": 1, "status": "Active", "wls": 3, "revisionDate": f"2026-07-01", "description": "", - "department": 1 + }, { - "positionTitle": "Teaching Associate", + "positionTitle": "Teaching Associate", "positionCode": "S61411", + "department": 1, "status": "Active", "wls":3, "revisionDate" : f"2026-01-01", "description": "", - "department" : 1 + + }, + { + "positionTitle": "Teaching Associate", }, { "positionTitle": "Teaching Associate", "positionCode": "S61410", + "department": 1, "status": "Inactive", "wls":2, "revisionDate" : f"2026-01-01", @@ -1109,6 +1084,25 @@ "status": "Active", "wls":1, "revisionDate" : f"2026-05-03", + "revisionDate" : "2025-01-01", + "description": "", + + }, + { + "positionTitle": "Teaching Associate", + "positionCode": "S61410", + "status": "Active", + "wls":2, + "revisionDate" : "2025-03-29", + "description": "", + "department" : 3 + }, + { + "positionTitle": "DUMMY POSITION", + "positionCode": "S12345", + "status": "Active", + "wls":3, + "revisionDate" : "2025-01-23", "description": "", "department" : 1 },