Skip to content

Commit ac9850c

Browse files
Fix datatables (#531)
* Fix datatables * oops it builds now * fix lint * specified docker repo
1 parent b2cad16 commit ac9850c

File tree

17 files changed

+48
-79
lines changed

17 files changed

+48
-79
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ WORKDIR /opt/conditional
66

77
COPY package.json package-lock.json /opt/conditional/
88

9-
RUN npm ci
9+
RUN npm ci --ignore-scripts
1010

1111
COPY webpack.config.js /opt/conditional
1212
COPY frontend /opt/conditional/frontend
1313

1414
RUN npm run webpack
1515

16-
FROM astral/uv:python3.13-trixie-slim
16+
FROM docker.io/astral/uv:python3.13-trixie-slim
1717
LABEL maintainer="Computer Science House <webmaster@csh.rit.edu>"
1818

1919
WORKDIR /opt/conditional

conditional/blueprints/housing.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from conditional.util.ldap import ldap_get_roomnumber
1414
from conditional.util.ldap import ldap_is_eval_director
1515
from conditional.util.ldap import ldap_set_active
16+
from conditional.util.user_dict import user_dict_is_eval_director
1617

1718
logger = structlog.get_logger()
1819

@@ -56,7 +57,7 @@ def display_housing(user_dict=None):
5657
# return names in 'first last (username)' format
5758
return render_template('housing.html',
5859
username=user_dict['username'],
59-
queue=get_housing_queue(ldap_is_eval_director(user_dict['account'])),
60+
queue=get_housing_queue(user_dict_is_eval_director(user_dict)),
6061
housing=housing,
6162
room_list=sorted(list(room_list)))
6263

@@ -67,7 +68,7 @@ def display_housing(user_dict=None):
6768
def change_queue_state(user_dict=None):
6869
log = logger.new(request=request, auth_dict=user_dict)
6970

70-
if not ldap_is_eval_director(user_dict['account']):
71+
if not user_dict_is_eval_director(user_dict):
7172
return "must be eval director", 403
7273

7374
post_data = request.get_json()
@@ -95,7 +96,7 @@ def change_room_numbers(rmnumber, user_dict=None):
9596

9697
update = request.get_json()
9798

98-
if not ldap_is_eval_director(user_dict['account']):
99+
if not user_dict_is_eval_director(user_dict):
99100
return "must be eval director", 403
100101

101102
# Get the current list of people living on-floor.

conditional/templates/attendance_hm.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h3 class="panel-title">Attendees</h3>
2626
<input class="form-control" type="text" placeholder="Quick Select" data-module="hmSearch" data-target="table.hm-attendance">
2727
</div>
2828
<div class="table-responsive">
29-
<table class="table table-striped no-bottom-margin hm-attendance" data-module="table" data-sort-column="0" data-sort-order="asc" data-paginated="false">
29+
<table class="table table-striped no-bottom-margin hm-attendance" data-module="table" data-order="[[ 0, &quot;asc&quot; ]]" data-paging="false">
3030
<thead>
3131
<tr>
3232
<th>Name</th>

conditional/templates/co_op_management.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h3 class="panel-title">Co-Op Management</h3>
1111
</div>
1212
<div class="panel-body table-fill">
1313
<div class="table-responsive">
14-
<table class="table table-striped no-bottom-margin" data-module="table" data-searchable="false" data-sort-column="1" data-sort-order="asc" data-length-changable="true" data-paginated="false">
14+
<table class="table table-striped no-bottom-margin" data-module="table" data-searchable="false" data-order="[[ 1, &quot;asc&quot; ]]" data-length-change="true" data-paging="false" data-info="true">
1515
<thead>
1616
<tr>
1717
<th>Name</th>

conditional/templates/dashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ <h3 class="panel-title">Directorship Meeting Attendance</h3>
462462
</div>
463463

464464
<div class="panel-body table-fill">
465-
<table class="table table-striped table-responsive" data-module="table">
465+
<table class="table table-striped table-responsive" data-module="table" data-length-change="false" data-searching="false">
466466
<thead>
467467
<tr>
468468
<th>Event</th>

conditional/templates/gatekeep.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,9 @@ <h4>Missed House Meetings</h4>
126126
</div>
127127
<div id="eval-table" style="display:none;">
128128
<div class="panel panel-default">
129-
<div class="panel-body table-fill">
130129
<div class="panel-body table-fill">
131130
<div class="table-responsive">
132-
<table class="table table-striped" data-module="table" data-searchable="true" data-sort-column="4" data-sort-order="asc" data-length-changable="true" data-paginated="false">
131+
<table class="table table-striped" data-module="table" data-order="[[ 4, &quot;asc&quot; ]]" data-length-change="true" data-paging="false" data-info="false">
133132
<thead>
134133
<tr>
135134
<th>Name</th>
@@ -181,7 +180,6 @@ <h4>Missed House Meetings</h4>
181180
</table>
182181
</div>
183182
</div>
184-
</div>
185183
</div>
186184
</div>
187185
</div>

conditional/templates/housing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h3 class="panel-title">Housing Queue
1818
</div>
1919
<div class="panel-body table-fill">
2020
<div class="table-responsive">
21-
<table class="table table-striped no-bottom-margin" data-module="table" data-paginated="false" data-ordering="false"{% if is_eval_director %} data-searchable="true" data-show="all"{% endif %}>
21+
<table class="table table-striped no-bottom-margin" data-module="table" data-paging="false" data-ordering="false"{% if is_eval_director %} data-search="true" data-show="all"{% endif %}>
2222
<thead>
2323
<tr>
2424
<th>Member</th>

conditional/templates/intro_evals.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,18 +174,17 @@ <h4>Other Comments</h4>
174174

175175
<div id="eval-table" style="display:none;">
176176
<div class="panel panel-default">
177-
<div class="panel-body table-fill">
178177
<div class="panel-body table-fill">
179178
<div class="table-responsive">
180-
<table class="table table-striped no-bottom-margin" data-module="table" data-searchable="true" data-sort-column="3" data-sort-order="asc" data-length-changable="true" data-paginated="false">
179+
<table class="table table-striped" data-module="table" data-order="[[ 4, &quot;asc&quot; ]]" data-sort-order="asc" data-length-change="true" data-paging="false" data-info="false">
181180
<thead>
182181
<tr>
183182
<th>Name</th>
184183
<th>Result</th>
185184
<th>Meetings</th>
186185
<th>Signatures Missed</th>
187186
<th>Technical Seminars</th>
188-
<th>House Meetings Missed</th>
187+
<th>House Meetings Missed</th>
189188
</tr>
190189
</thead>
191190
<tbody>
@@ -239,7 +238,6 @@ <h4>Other Comments</h4>
239238
</table>
240239
</div>
241240
</div>
242-
</div>
243241
</div>
244242
</div>
245243
</div>

conditional/templates/logs.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@
88
<h3 class="page-title">User Logs</h3>
99
<div class="panel panel-default">
1010
<div class="panel-body table-fill">
11-
<table class="table table-striped no-bottom-margin" data-module="table" data-searchable="true" data-sort-column="0" data-sort-order="desc" data-length-changable="true" data-page-length="100">
11+
<table class="table table-striped" data-module="table" data-searchable="true" data-order="[[ 0, &quot;desc&quot; ]]" data-length-change="true" data-page-length="100">
1212
<thead>
13-
<th>ID</th>
14-
<th>Method</th>
15-
<th>User</th>
16-
<th>Blueprint</th>
17-
<th>URL</th>
18-
<th>Description</th>
13+
<th>ID</th>
14+
<th>Method</th>
15+
<th>User</th>
16+
<th>Blueprint</th>
17+
<th>URL</th>
18+
<th>Description</th>
1919
</thead>
2020
<tbody>
21-
{% for log in logs %}
22-
<tr>
23-
<td>{{log.timestamp}}</td>
24-
<td>{{log.method}}</td>
25-
<td>{{log.uid}}</td>
26-
<td>{{log.blueprint}}</td>
27-
<td>{{log.path}}</td>
28-
<td>{{log.description}}</td>
29-
</tr>
30-
{% endfor %}
21+
{% for log in logs %}
22+
<tr>
23+
<td data-sort="{{log.timestamp}}">{{log.timestamp}}</td>
24+
<td>{{log.method}}</td>
25+
<td>{{log.uid}}</td>
26+
<td>{{log.blueprint}}</td>
27+
<td>{{log.path}}</td>
28+
<td>{{log.description}}</td>
29+
</tr>
30+
{% endfor %}
3131
</tbody>
3232
</table>
3333
</div>

conditional/templates/member_management.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ <h3 class="panel-title">Freshman Management</h3>
102102
</div>
103103
<div class="panel-body table-fill">
104104
<div class="table-responsive">
105-
<table class="table table-striped no-bottom-margin" data-module="table" data-searchable="true" data-sort-column="0" data-sort-order="asc" data-length-changable="true"{% if freshmen|length < 11 %} data-paginated="false" {% endif %}>
105+
<table class="table table-striped no-bottom-margin" data-module="table" data-order="[[ 0, &quot;asc&quot' ]]" data-length-change="true">
106106
<thead>
107107
<tr>
108108
<th>Name</th>
@@ -145,7 +145,7 @@ <h3 class="panel-title">
145145
</div>
146146
<div class="panel-body table-fill">
147147
<div class="table-responsive">
148-
<table class="table table-striped no-bottom-margin" data-module="table" data-searchable="true" data-sort-column="0" data-sort-order="asc" data-length-changable="true">
148+
<table class="table table-striped" data-module="table" data-order="[[ 0, &quot;asc&quot;]]" data-length-change="true">
149149
<thead>
150150
<tr>
151151
<th>Name</th>

0 commit comments

Comments
 (0)