Commit 3a3b4dc7 by Damien Moulard

enforce ordering in history table

parent 7a54c6fc
...@@ -99,7 +99,7 @@ class CagetteMembersSpace(models.Model): ...@@ -99,7 +99,7 @@ class CagetteMembersSpace(models.Model):
amnesty['state'] = '' amnesty['state'] = ''
res.append(amnesty) 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) res.sort(key = lambda x: datetime.datetime.strptime(x['date_begin'], '%Y-%m-%d %H:%M:%S'), reverse=True)
# Paginate # Paginate
......
...@@ -96,18 +96,30 @@ function init_history() { ...@@ -96,18 +96,30 @@ function init_history() {
data: partner_history, data: partner_history,
columns: [ columns: [
{ {
data: "date_begin",
title: "",
visible: false
},
{
data: "shift_name", data: "shift_name",
title: "<spans class='dt-body-center'>Service</span>", title: "<spans class='dt-body-center'>Service</span>",
width: "60%" width: "60%",
orderable: false
}, },
{ {
data: "details", data: "details",
title: "Détails", title: "Détails",
className: "tablet-l desktop" className: "tablet-l desktop",
orderable: false
} }
], ],
iDisplayLength: -1, iDisplayLength: -1,
ordering: false, order: [
[
0,
"desc"
]
],
language: {url : '/static/js/datatables/french.json'}, language: {url : '/static/js/datatables/french.json'},
dom: "t", dom: "t",
responsive: true, 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