From 1a309ce1eb1c0663e68c9d055757b84d59b20e8e Mon Sep 17 00:00:00 2001 From: "Noah Hanford (spaced)" Date: Thu, 26 Mar 2026 17:33:00 -0400 Subject: [PATCH 1/4] Fix datatables --- Dockerfile | 2 +- conditional/blueprints/housing.py | 7 ++-- conditional/templates/attendance_hm.html | 2 +- conditional/templates/co_op_management.html | 2 +- conditional/templates/dashboard.html | 2 +- conditional/templates/gatekeep.html | 4 +-- conditional/templates/housing.html | 2 +- conditional/templates/intro_evals.html | 6 ++-- conditional/templates/logs.html | 34 +++++++++---------- conditional/templates/member_management.html | 4 +-- conditional/templates/new_year.html | 2 +- conditional/templates/spring_evals.html | 6 ++-- conditional/util/housing.py | 13 +++++-- frontend/javascript/modules/table.js | 33 ++---------------- .../stylesheets/components/_datatables.scss | 4 --- webpack.config.js | 1 + 16 files changed, 47 insertions(+), 77 deletions(-) delete mode 100644 frontend/stylesheets/components/_datatables.scss diff --git a/Dockerfile b/Dockerfile index 382bb72e..7b744999 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /opt/conditional COPY package.json package-lock.json /opt/conditional/ -RUN npm ci +RUN npm ci --ignore-scripts COPY webpack.config.js /opt/conditional COPY frontend /opt/conditional/frontend diff --git a/conditional/blueprints/housing.py b/conditional/blueprints/housing.py index 45e29f90..461d4195 100644 --- a/conditional/blueprints/housing.py +++ b/conditional/blueprints/housing.py @@ -1,3 +1,4 @@ +from conditional.util.user_dict import user_dict_is_eval_director import structlog from flask import Blueprint, request, jsonify @@ -56,7 +57,7 @@ def display_housing(user_dict=None): # return names in 'first last (username)' format return render_template('housing.html', username=user_dict['username'], - queue=get_housing_queue(ldap_is_eval_director(user_dict['account'])), + queue=get_housing_queue(user_dict_is_eval_director(user_dict)), housing=housing, room_list=sorted(list(room_list))) @@ -67,7 +68,7 @@ def display_housing(user_dict=None): def change_queue_state(user_dict=None): log = logger.new(request=request, auth_dict=user_dict) - if not ldap_is_eval_director(user_dict['account']): + if not user_dict_is_eval_director(user_dict): return "must be eval director", 403 post_data = request.get_json() @@ -95,7 +96,7 @@ def change_room_numbers(rmnumber, user_dict=None): update = request.get_json() - if not ldap_is_eval_director(user_dict['account']): + if not user_dict_is_eval_director(user_dict): return "must be eval director", 403 # Get the current list of people living on-floor. diff --git a/conditional/templates/attendance_hm.html b/conditional/templates/attendance_hm.html index 215a9c91..6859adb8 100644 --- a/conditional/templates/attendance_hm.html +++ b/conditional/templates/attendance_hm.html @@ -26,7 +26,7 @@

Attendees

- +
diff --git a/conditional/templates/co_op_management.html b/conditional/templates/co_op_management.html index a7a98b65..7419d90d 100644 --- a/conditional/templates/co_op_management.html +++ b/conditional/templates/co_op_management.html @@ -11,7 +11,7 @@

Co-Op Management

-
Name
+
diff --git a/conditional/templates/dashboard.html b/conditional/templates/dashboard.html index 3d3a1f2e..2b663661 100644 --- a/conditional/templates/dashboard.html +++ b/conditional/templates/dashboard.html @@ -462,7 +462,7 @@

Directorship Meeting Attendance

-
Name
+
diff --git a/conditional/templates/gatekeep.html b/conditional/templates/gatekeep.html index dc1e358e..35e56aa3 100644 --- a/conditional/templates/gatekeep.html +++ b/conditional/templates/gatekeep.html @@ -126,10 +126,9 @@

Missed House Meetings

Event
+
@@ -181,7 +180,6 @@

Missed House Meetings

Name
- diff --git a/conditional/templates/housing.html b/conditional/templates/housing.html index 5b5381b7..4fbcb9bb 100644 --- a/conditional/templates/housing.html +++ b/conditional/templates/housing.html @@ -18,7 +18,7 @@

Housing Queue
- +
diff --git a/conditional/templates/intro_evals.html b/conditional/templates/intro_evals.html index cf72653c..1d530ef5 100644 --- a/conditional/templates/intro_evals.html +++ b/conditional/templates/intro_evals.html @@ -174,10 +174,9 @@

Other Comments

Member
+
@@ -185,7 +184,7 @@

Other Comments

- + @@ -239,7 +238,6 @@

Other Comments

Name Meetings Signatures Missed Technical SeminarsHouse Meetings MissedHouse Meetings Missed
- diff --git a/conditional/templates/logs.html b/conditional/templates/logs.html index 9ca179d7..7652921f 100644 --- a/conditional/templates/logs.html +++ b/conditional/templates/logs.html @@ -8,26 +8,26 @@

User Logs

- +
- - - - - - + + + + + + - {% for log in logs %} - - - - - - - - - {% endfor %} + {% for log in logs %} + + + + + + + + + {% endfor %}
IDMethodUserBlueprintURLDescriptionIDMethodUserBlueprintURLDescription
{{log.timestamp}}{{log.method}}{{log.uid}}{{log.blueprint}}{{log.path}}{{log.description}}
{{log.timestamp}}{{log.method}}{{log.uid}}{{log.blueprint}}{{log.path}}{{log.description}}
diff --git a/conditional/templates/member_management.html b/conditional/templates/member_management.html index 8631061c..84b1b25e 100644 --- a/conditional/templates/member_management.html +++ b/conditional/templates/member_management.html @@ -102,7 +102,7 @@

Freshman Management

- +
@@ -145,7 +145,7 @@

-

Name
+
diff --git a/conditional/templates/new_year.html b/conditional/templates/new_year.html index 7ea84e1a..96ae2bfa 100644 --- a/conditional/templates/new_year.html +++ b/conditional/templates/new_year.html @@ -17,7 +17,7 @@

Clear Active Members and Floor Roster

Name
+
diff --git a/conditional/templates/spring_evals.html b/conditional/templates/spring_evals.html index 6b9d2658..b4da9341 100644 --- a/conditional/templates/spring_evals.html +++ b/conditional/templates/spring_evals.html @@ -183,17 +183,16 @@

Major Projects

Name
+
- + @@ -238,7 +237,6 @@

Major Projects

Name Result Meetings Major ProjectHouse Meetings MissedHouse Meetings Missed
- diff --git a/conditional/util/housing.py b/conditional/util/housing.py index b6203409..96ea5f44 100644 --- a/conditional/util/housing.py +++ b/conditional/util/housing.py @@ -2,7 +2,7 @@ from conditional.models.models import InHousingQueue from conditional.models.models import OnFloorStatusAssigned -from conditional.util.ldap import ldap_get_member, ldap_is_current_student +from conditional.util.ldap import ldap_get_current_students, ldap_get_member, ldap_is_current_student def get_housing_queue(is_eval_director=False): @@ -24,7 +24,14 @@ def get_housing_queue(is_eval_director=False): } # CSHMember accounts that are in queue - potential_accounts = [ldap_get_member(username) for username in in_queue] + potential_accounts = [] + + if is_eval_director: + potential_accounts = ldap_get_current_students() + else: + potential_accounts = [ldap_get_member(username) for username in in_queue] + + potential_accounts = [user for user in potential_accounts if ldap_is_current_student(user)] # Populate a list of dictionaries containing the name, username, # and on-floor datetime for each current studetn who has on-floor status @@ -37,7 +44,7 @@ def get_housing_queue(is_eval_director=False): "time": in_queue.get(account.uid, {}).get('time', datetime.now()) or datetime.now(), "in_queue": account.uid in in_queue } for account in potential_accounts - if ldap_is_current_student(account) and (is_eval_director or account.roomNumber is None) + if is_eval_director or account.roomNumber is None ] # Sort based on time (ascending) and then points (decending). diff --git a/frontend/javascript/modules/table.js b/frontend/javascript/modules/table.js index e1478820..7cdae7f4 100644 --- a/frontend/javascript/modules/table.js +++ b/frontend/javascript/modules/table.js @@ -1,37 +1,8 @@ /* global $ */ -import _ from "lodash"; -import "datatables.net-bs"; +import DataTable from "datatables.net-bs"; export default class Table { constructor(table) { - this.table = table; - - // Set options based on data attributes - this.sortColumn = (_.isNil(this.table.dataset.sortColumn) || - _.isNaN(this.table.dataset.sortColumn)) ? - 1 : this.table.dataset.sortColumn; - this.sortOrder = this.table.dataset.sortOrder === "asc" ? "asc" : "desc"; - - this.options = { - lengthChange: this.table.dataset.lengthChangable === 'true', - info: false, - paging: !(this.table.dataset.paginated === 'false'), - pagingType: "numbers", - order: [], - pageLength: this.table.dataset.pageLength || 10 - }; - - // Just remove the search input from the DOM instead of disabling it - if (this.table.dataset.searchable !== 'true') { - this.options.dom = "lrtip"; - } - - this.render(); - } - - render() { - this.table = $(this.table).DataTable(this.options) // eslint-disable-line new-cap - .order([this.sortColumn, this.sortOrder]) - .draw(); + this.table = new DataTable(table) } } diff --git a/frontend/stylesheets/components/_datatables.scss b/frontend/stylesheets/components/_datatables.scss deleted file mode 100644 index 90a1f9c8..00000000 --- a/frontend/stylesheets/components/_datatables.scss +++ /dev/null @@ -1,4 +0,0 @@ -.dt-paging nav { - display: flex; - justify-content: center; -} diff --git a/webpack.config.js b/webpack.config.js index a1aa1215..f184daee 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,6 +15,7 @@ var babelQuery = { var webpackConfig = { context: jsSrc, entry: ["./javascript/app.js"], + devtool: "source-map", output: { path: path.normalize(jsDest), filename: 'js/app.js', From 0d3edca72f45f5fb1cbebcac72c62b57a7681472 Mon Sep 17 00:00:00 2001 From: "Noah Hanford (spaced)" Date: Thu, 26 Mar 2026 17:36:14 -0400 Subject: [PATCH 2/4] oops it builds now --- frontend/stylesheets/app.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/stylesheets/app.scss b/frontend/stylesheets/app.scss index 026b0f49..0a51ae18 100644 --- a/frontend/stylesheets/app.scss +++ b/frontend/stylesheets/app.scss @@ -15,7 +15,6 @@ $bootstrap-icons-font-dir: "../fonts/"; // Components @import 'components/switches'; @import 'components/flat-buttons'; -@import 'components/datatables'; @import 'components/date-picker'; @import 'components/select'; @import 'components/dropzone'; From dbceddcd8693359d451b2e820591395d3183b047 Mon Sep 17 00:00:00 2001 From: "Noah Hanford (spaced)" Date: Thu, 26 Mar 2026 17:39:44 -0400 Subject: [PATCH 3/4] fix lint --- conditional/blueprints/housing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conditional/blueprints/housing.py b/conditional/blueprints/housing.py index 461d4195..45b25476 100644 --- a/conditional/blueprints/housing.py +++ b/conditional/blueprints/housing.py @@ -1,4 +1,3 @@ -from conditional.util.user_dict import user_dict_is_eval_director import structlog from flask import Blueprint, request, jsonify @@ -14,6 +13,7 @@ from conditional.util.ldap import ldap_get_roomnumber from conditional.util.ldap import ldap_is_eval_director from conditional.util.ldap import ldap_set_active +from conditional.util.user_dict import user_dict_is_eval_director logger = structlog.get_logger() From deb11f1bdaf32b8d2fe01e43839973c867f10b81 Mon Sep 17 00:00:00 2001 From: "Noah Hanford (spaced)" Date: Thu, 26 Mar 2026 17:42:52 -0400 Subject: [PATCH 4/4] specified docker repo --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7b744999..caf155a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ COPY frontend /opt/conditional/frontend RUN npm run webpack -FROM astral/uv:python3.13-trixie-slim +FROM docker.io/astral/uv:python3.13-trixie-slim LABEL maintainer="Computer Science House " WORKDIR /opt/conditional