Skip to content

Commit cc6f1d1

Browse files
committed
Attempt to roll back some of the general changes, and make a specific change to fix batchgroup sorting
1 parent 800ebc2 commit cc6f1d1

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

logic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def _score_weight_average(v):
298298
def scored_proposals():
299299
q = '''SELECT scores, nominate, proposal, proposals.data->>'title' AS title,
300300
proposals.accepted,
301-
COALESCE(batchgroups.name,'') as batchgroup,
301+
batchgroups.name as batchgroup,
302302
batchgroups.id as batch_id
303303
FROM votes
304304
INNER JOIN proposals ON (votes.proposal = proposals.id)

static/js/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function table_sorter($table, data_src, row_template, extra_column_functions){
118118
$this.addClass('warning');
119119
var column = $this.data().column;
120120
var value_function = function(x){
121-
return x[column]?x[column]:'';
121+
return x[column];
122122
}
123123
if(extra_column_functions[column]){
124124
value_function = extra_column_functions[column]($this);

templates/admin/rough_scores.html

+8-1
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,15 @@
138138
});
139139
}
140140

141+
function batchgroup_val(e){
142+
if(e.batchgroup){
143+
return e.batchgroup;
144+
}
145+
return 'ZZZZZZZZZZZZZZ';
146+
}
147+
141148
$(document).ready(function(){
142-
table_sorter($('table'), proposals, TEMPLATES.table_row);
149+
table_sorter($('table'), proposals, TEMPLATES.table_row, {batchgroup:batchgroup_val});
143150
$('#get-groups').on('click', get_groups);
144151
$('tbody').on('click', '.batchgroup', handle_batch_click);
145152
$('tbody').on('change', '.batchgroup select', handle_batch_change);

0 commit comments

Comments
 (0)