Commit 3a3b4dc7 by Damien Moulard

enforce ordering in history table

parent 7a54c6fc
......@@ -99,7 +99,7 @@ class CagetteMembersSpace(models.Model):
amnesty['state'] = ''
res.append(amnesty)
# ordering
# Ordering here is necessary for pagination
res.sort(key = lambda x: datetime.datetime.strptime(x['date_begin'], '%Y-%m-%d %H:%M:%S'), reverse=True)
# Paginate
......
......@@ -96,18 +96,30 @@ function init_history() {
data: partner_history,
columns: [
{
data: "date_begin",
title: "",
visible: false
},
{
data: "shift_name",
title: "<spans class='dt-body-center'>Service</span>",
width: "60%"
width: "60%",
orderable: false
},
{
data: "details",
title: "Détails",
className: "tablet-l desktop"
className: "tablet-l desktop",
orderable: false
}
],
iDisplayLength: -1,
ordering: false,
order: [
[
0,
"desc"
]
],
language: {url : '/static/js/datatables/french.json'},
dom: "t",
responsive: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment