From c8aa462c7a94c1fee690a083955e8549d38d6fe0 Mon Sep 17 00:00:00 2001 From: fritzj2 Date: Thu, 16 Jul 2026 11:32:17 -0400 Subject: [PATCH 01/14] added previous fixes into the branch from pos-card-fixes --- app/controllers/main_routes/main_routes.py | 10 ++++----- app/templates/main/departmentPortal.html | 24 ++++++++++------------ 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/app/controllers/main_routes/main_routes.py b/app/controllers/main_routes/main_routes.py index ec32d4fc..e83e57e4 100755 --- a/app/controllers/main_routes/main_routes.py +++ b/app/controllers/main_routes/main_routes.py @@ -67,20 +67,20 @@ def departmentPortal(org=None,account=None): positions = list(PositionHistory.select().where(PositionHistory.department == dept, PositionHistory.status == "Active").order_by(PositionHistory.positionTitle.asc())) if dept else [] positionsList = [] - posUrl = [] - if not positions: - positionsList = ["No active positions in this department"] + posURL = [] + if positions == []: + pass else: for i in positions: positionsList.append(i.positionTitle + ": " + "(WLS " + str(i.wls) + ")") - posUrl.append(str(i.positionCode)) + posURL.append(str(i.positionCode)) return render_template('main/departmentPortal.html', departments = departments, department = dept, positions = positionsList, - posUrl = posUrl) + posURL = posURL) @main_bp.route('/supervisorPortal/addUserToDept', methods=['GET', 'POST']) def addUserToDept(): diff --git a/app/templates/main/departmentPortal.html b/app/templates/main/departmentPortal.html index 173adb3d..1ad252df 100644 --- a/app/templates/main/departmentPortal.html +++ b/app/templates/main/departmentPortal.html @@ -65,22 +65,20 @@

Positions

and {{ (positions | length) - 7}} more...

+ {% endfor %} + {% if (positions | length) > 7 %} +

and {{ (positions | length) - 7}} more...

+ {% endif %} {% endif %} - {% endfor %} From df65fa4ca62ad1483ce5ca52c226bb1a3a07d5db Mon Sep 17 00:00:00 2001 From: fritzj2 Date: Mon, 20 Jul 2026 14:45:01 -0400 Subject: [PATCH 02/14] Revert "Revert position card PR #639" This reverts commit 3e5a529c031e6141fa95b3fa614f4763a92f76d5. --- app/config/contributors.yaml | 3 + app/controllers/main_routes/main_routes.py | 17 +++- app/models/positionHistory.py | 1 + app/static/css/base.css | 27 +++++++ app/static/css/contributors.css | 1 - app/static/css/departmentPortal.css | 31 ++++++++ app/templates/base.html | 20 +++-- app/templates/main/contributors.html | 6 +- app/templates/main/departmentPortal.html | 25 +++--- database/demo_data.py | 91 +++++++++++++++++++--- setup.sh | 10 +++ 11 files changed, 200 insertions(+), 32 deletions(-) create mode 100644 app/static/css/departmentPortal.css diff --git a/app/config/contributors.yaml b/app/config/contributors.yaml index d26cdd36..2a47673c 100755 --- a/app/config/contributors.yaml +++ b/app/config/contributors.yaml @@ -59,4 +59,7 @@ contributors: - name: "Oluwagbayi Makinde" username: "makindeo" year: 2024 + - name: "Bhushan Sah " + username: "sahb" + year: 2029 \ No newline at end of file diff --git a/app/controllers/main_routes/main_routes.py b/app/controllers/main_routes/main_routes.py index 43aca3ce..d0991074 100755 --- a/app/controllers/main_routes/main_routes.py +++ b/app/controllers/main_routes/main_routes.py @@ -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.models.positionHistory import PositionHistory + @main_bp.route('/logout', methods=['GET']) def triggerLogout(): @@ -57,7 +59,6 @@ def departmentPortal(org=None,account=None): dept = None - if g.currentUser.isLaborAdmin: departments = list(Department.select().order_by(Department.isActive.desc(), Department.DEPT_NAME.asc())) else: @@ -66,6 +67,7 @@ def departmentPortal(org=None,account=None): positions = list(PositionHistory.select().where(PositionHistory.department == dept, PositionHistory.status == "Active").order_by(PositionHistory.positionTitle.asc())) if dept else [] positionsList = [] +<<<<<<< HEAD posURL = [] if positions == []: pass @@ -73,13 +75,26 @@ def departmentPortal(org=None,account=None): for i in positions: positionsList.append(i.positionTitle + ": " + "(WLS " + str(i.wls) + ")") posURL.append(str(i.positionCode)) +======= + posUrl = [] + if not positions: + positionsList = ["No active positions in this department"] + else: + for i in positions: + positionsList.append(i.positionTitle + ": " + "(WLS " + str(i.wls) + ")") + posUrl.append(str(i.positionCode)) +>>>>>>> parent of 3e5a529c (Revert position card PR #639) return render_template('main/departmentPortal.html', departments = departments, department = dept, positions = positionsList, +<<<<<<< HEAD posURL = posURL) +======= + posUrl = posUrl) +>>>>>>> parent of 3e5a529c (Revert position card PR #639) @main_bp.route('/supervisorPortal/addUserToDept', methods=['GET', 'POST']) def addUserToDept(): diff --git a/app/models/positionHistory.py b/app/models/positionHistory.py index 51467075..9a248aac 100644 --- a/app/models/positionHistory.py +++ b/app/models/positionHistory.py @@ -2,6 +2,7 @@ from app.models.department import Department class PositionHistory(baseModel): + positionTitle = CharField() positionCode = CharField() department = ForeignKeyField(Department) status = CharField() diff --git a/app/static/css/base.css b/app/static/css/base.css index 940f8d6e..812d3c89 100755 --- a/app/static/css/base.css +++ b/app/static/css/base.css @@ -250,6 +250,7 @@ a { padding: 0.5rem 1rem; background-color: rgba(0, 0, 0, 0.03); border-top: 1px solid rgba(0, 0, 0, 0.125); + margin-top: auto; } .card-footer:last-child { @@ -264,3 +265,29 @@ a { border-top-left-radius: calc(0.25rem - 1px); border-top-right-radius: calc(0.25rem - 1px); } +.site-footer { + position: fixed; + left: 280px; + right: 0; + bottom: 0; + + background-color: #e9ebec; + color: #1e2433; + + padding: 8px 15px; + line-height: 1.4; + box-sizing: border-box; + z-index: 101; + +} + +.sidebar-push { + padding-bottom: 85px; +} + +@media (max-width: 991px) { + .site-footer { + left: 0; + width: 100%; + } +} diff --git a/app/static/css/contributors.css b/app/static/css/contributors.css index 0fe0601b..2f54c122 100755 --- a/app/static/css/contributors.css +++ b/app/static/css/contributors.css @@ -3,7 +3,6 @@ color: #ffffff; padding: 7px 30px; margin-top: 100px; - margin-right: 250px; } .container { top: -75px; diff --git a/app/static/css/departmentPortal.css b/app/static/css/departmentPortal.css new file mode 100644 index 00000000..b563c505 --- /dev/null +++ b/app/static/css/departmentPortal.css @@ -0,0 +1,31 @@ +.card { + border-radius: 1rem; + overflow: hidden; + width: 100%; + height: 100%; + min-width: 100%; + box-shadow: 2px 2px 4px rgba(100, 100, 100, 0.26); +} +.bi-suitcase-lg-fill { /* Bootstrap Icon */ + border: 1px solid #c0c0c0; + border-radius: 8px; + padding: 3px 3.5px 1.5px 3.5px; + font-size: 3rem; + color:#6e6e6e; +} +.card-group { + gap: 1rem; +} +.form-group { + width: 50%; + margin-left: auto ; + margin-right:auto; +} +.card-body { + padding: 1rem 1rem; + min-width: 100% +} +.row { + display: flex; + flex-wrap: wrap; +} \ No newline at end of file diff --git a/app/templates/base.html b/app/templates/base.html index 4d6c2a79..4b982536 100755 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -66,10 +66,20 @@
{% block footer %} - -{% endblock %} + +{% endblock %} {% endblock %} diff --git a/app/templates/main/contributors.html b/app/templates/main/contributors.html index ffdfe439..af33209d 100755 --- a/app/templates/main/contributors.html +++ b/app/templates/main/contributors.html @@ -23,9 +23,9 @@

Contributors

{% endfor %} -
- -
+
+
+
diff --git a/app/templates/main/departmentPortal.html b/app/templates/main/departmentPortal.html index 94df62f4..173adb3d 100644 --- a/app/templates/main/departmentPortal.html +++ b/app/templates/main/departmentPortal.html @@ -3,6 +3,7 @@ {% block scripts %} {{super()}} + {% endblock %} {% block app_content %} @@ -64,20 +65,22 @@

Positions

and {{ (positions | length) - 7}} more...

- {% endif %} + {% else %} +
  • + {{ p }} +
  • + {% endif %} + + {% elif 7 == loop.index0 %} +

    and {{ (positions | length) - 7}} more...

    {% endif %} + {% endfor %} diff --git a/database/demo_data.py b/database/demo_data.py index de604762..1311a748 100644 --- a/database/demo_data.py +++ b/database/demo_data.py @@ -750,50 +750,119 @@ # Position History ############################# -positionHistory = [ +positionhistory = [ { + "positionTitle": "Student Programmer", "positionCode": "S61407", "status": "Active", "wls": 1, - "revisionDate": f"2025-07-01", + "revisionDate": f"2026-07-01", "description": "", "department": 1 }, { - + "positionTitle": "Research Associate", "positionCode": "S61408", "status": "Active", "wls": 2, - "revisionDate": f"2025-09-01", + "revisionDate": f"2026-09-01", "description": "", "department": 1 }, { + "positionTitle": "Labor Workers", "positionCode": "S61409", "status": "Active", "wls": 3, - "revisionDate": f"2025-07-01", + "revisionDate": f"2026-07-01", "description": "", "department": 1 }, { + "positionTitle": "Teaching Associate", "positionCode": "S61411", "status": "Active", "wls":3, - "revisionDate" : f"2025-01-01", + "revisionDate" : f"2026-01-01", "description": "", "department" : 1 - }, - { + }, + { + "positionTitle": "Teaching Associate", "positionCode": "S61410", "status": "Inactive", "wls":2, - "revisionDate" : f"2025-01-01", + "revisionDate" : f"2026-01-01", + "description": "", + "department" : 3 + }, + { + "positionTitle": "Teaching Associate", + "positionCode": "S61410", + "status": "Active", + "wls":2, + "revisionDate" : f"2026-03-29", + "description": "", + "department" : 3 + }, + { + "positionTitle": "DUMMY POSITION", + "positionCode": "S12345", + "status": "Active", + "wls":3, + "revisionDate" : f"2026-01-23", "description": "", "department" : 1 - }, + }, + { + "positionTitle": "Junior Data Analyst", + "positionCode": "S39568", + "status": "Active", + "wls":4, + "revisionDate" : f"2026-01-31", + "description": "", + "department" : 1 + }, + { + "positionTitle": "Student Manager", + "positionCode": "S74933", + "status": "Active", + "wls":5, + "revisionDate" : f"2026-04-01", + "description": "", + "department" : 1 + }, + { + "positionTitle": "IT Technician", + "positionCode": "S94932", + "status": "Active", + "wls":6, + "revisionDate" : f"2026-05-03", + "description": "", + "department" : 1 + }, + { + "positionTitle": "Human code generator", + "positionCode": "S22222", + "status": "Active", + "wls":1, + "revisionDate" : f"2026-05-03", + "description": "", + "department" : 1 + }, + { + "positionTitle": "Senior Software Engineer", + "positionCode": "S00000", + "status": "Active", + "wls":6, + "revisionDate" : f"2026-05-03", + "description": "", + "department" : 1 + } + + ] -PositionHistory.insert_many(positionHistory).on_conflict_replace().execute() +PositionHistory.insert_many(positionhistory).on_conflict_replace().execute() print(" * position history added") \ No newline at end of file diff --git a/setup.sh b/setup.sh index 895e43b9..c4e43d65 100755 --- a/setup.sh +++ b/setup.sh @@ -39,3 +39,13 @@ export FLASK_APP=app.py # app entry point export APP_ENV=development # default export FLASK_RUN_PORT=8080 # For consistency (python app.py vs flask run) export FLASK_RUN_HOST=0.0.0.0 # To allow external routing to the application + +# Fix symbolic link inside database directory +if ! [ -L "database/app" ]; then + echo "Fixing symlink to app in database directory" + cd database + rm app + ln -s ../app + cd .. +fi + From 00930c4883f6f40c8bc03b7b3af66a55398d8bad Mon Sep 17 00:00:00 2001 From: fritzj2 Date: Mon, 20 Jul 2026 14:54:36 -0400 Subject: [PATCH 03/14] re-added fixes to the position card --- app/controllers/main_routes/main_routes.py | 14 ------------ app/templates/main/departmentPortal.html | 26 ++++++++++------------ 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/app/controllers/main_routes/main_routes.py b/app/controllers/main_routes/main_routes.py index d0991074..e83e57e4 100755 --- a/app/controllers/main_routes/main_routes.py +++ b/app/controllers/main_routes/main_routes.py @@ -67,7 +67,6 @@ def departmentPortal(org=None,account=None): positions = list(PositionHistory.select().where(PositionHistory.department == dept, PositionHistory.status == "Active").order_by(PositionHistory.positionTitle.asc())) if dept else [] positionsList = [] -<<<<<<< HEAD posURL = [] if positions == []: pass @@ -75,26 +74,13 @@ def departmentPortal(org=None,account=None): for i in positions: positionsList.append(i.positionTitle + ": " + "(WLS " + str(i.wls) + ")") posURL.append(str(i.positionCode)) -======= - posUrl = [] - if not positions: - positionsList = ["No active positions in this department"] - else: - for i in positions: - positionsList.append(i.positionTitle + ": " + "(WLS " + str(i.wls) + ")") - posUrl.append(str(i.positionCode)) ->>>>>>> parent of 3e5a529c (Revert position card PR #639) return render_template('main/departmentPortal.html', departments = departments, department = dept, positions = positionsList, -<<<<<<< HEAD posURL = posURL) -======= - posUrl = posUrl) ->>>>>>> parent of 3e5a529c (Revert position card PR #639) @main_bp.route('/supervisorPortal/addUserToDept', methods=['GET', 'POST']) def addUserToDept(): diff --git a/app/templates/main/departmentPortal.html b/app/templates/main/departmentPortal.html index 173adb3d..8385a94e 100644 --- a/app/templates/main/departmentPortal.html +++ b/app/templates/main/departmentPortal.html @@ -65,24 +65,22 @@

    Positions

      - {% for p in positions %} - {% if 7 > loop.index0 %} - {% if p == "No active positions in this department" %} + {% if positions == [] %} +
    • +

      No active positions in this department

      +
    • + {% else %} + {% for p in positions[:7] %}
    • -

      {{ p }}

      + {{ p }}
    • - {% else %} -
    • - {{ p }} -
    • - {% endif %} - - {% elif 7 == loop.index0 %} -

    and {{ (positions | length) - 7}} more...

    + {% endfor %} + {% if (positions | length) > 7 %} +

    and {{ (positions | length) - 7}} more...

    + {% endif %} {% endif %} - {% endfor %} - +