Skip to content

Commit 1f8a38d

Browse files
authored
Merge pull request automatic-ripping-machine#512 from newhinton/v2_master
Fix tablesorter using wrong column for sorting
2 parents 5ca3a17 + f431bbb commit 1f8a38d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

arm/ui/routes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def history():
490490
if os.path.isfile(cfg['DBFILE']):
491491
# after roughly 175 entries firefox readermode will break
492492
# jobs = Job.query.filter_by().limit(175).all()
493-
jobs = Job.query.order_by().paginate(page, 100, False)
493+
jobs = Job.query.order_by(Job.start_time.desc()).paginate(page, 100, False)
494494
else:
495495
app.logger.error('ERROR: /history database file doesnt exist')
496496
jobs = {}

arm/ui/templates/history.html

+7-2
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@
8383
content: "Logfile:\A";
8484
}
8585
}
86+
87+
.hidden {
88+
display: none;
89+
}
8690
</style>
8791
<div class="container content">
8892
<div class="row">
@@ -138,6 +142,7 @@
138142
job.title|truncate(50, True) if job.title is not none else 'Title unknown' }}</a>
139143
</th>
140144
<td>{{ job.start_time.strftime(date_format) if job.start_time is not none }}</td>
145+
<td class="hidden">{{ job.start_time if job.start_time is not none }}</td>
141146
<td>{{ job.job_length }}</td>
142147
<td class="{{ job.status }}"><img src="static/img/{{ job.status }}.png" height="30px"
143148
width="30px" alt="{{ job.status }}"
@@ -163,8 +168,8 @@
163168
$(document).ready(function () {
164169
// call the tablesorter plugin
165170
$("table").tablesorter({
166-
// sort on the first column and third column, order asc
167-
sortList: [[1, 1]]
171+
// sort on the third column (startime, no format)
172+
sortList: [[2, 1]]
168173
});
169174
});
170175
activeTab("history");

0 commit comments

Comments
 (0)