WIP: Aureplop/kpsul js refactor #501
2 changed files with 5 additions and 8 deletions
|
@ -635,8 +635,8 @@ class HistoryGroup extends ModelObject {
|
||||||
*/
|
*/
|
||||||
static compare(a, b) {
|
static compare(a, b) {
|
||||||
//Groups are sorted by most recent first
|
//Groups are sorted by most recent first
|
||||||
if (a.at < b.at) return 1;
|
if (a.at.isBefore(b.at)) return 1;
|
||||||
else if (a.at > b.at) return -1;
|
else if (a.at.isAfter(b.at)) return -1;
|
||||||
else return 0;
|
else return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1502,6 +1502,7 @@ def history_json(request):
|
||||||
'id': transfergroup.at.strftime('%Y%m%d'),
|
'id': transfergroup.at.strftime('%Y%m%d'),
|
||||||
'date': transfergroup.at
|
'date': transfergroup.at
|
||||||
},
|
},
|
||||||
|
'child_sort': 'transfergroup',
|
||||||
},
|
},
|
||||||
'children': [],
|
'children': [],
|
||||||
}
|
}
|
||||||
|
@ -1604,14 +1605,10 @@ class SettingsUpdate(SuccessMessageMixin, UpdateView):
|
||||||
# Transfer views
|
# Transfer views
|
||||||
# -----
|
# -----
|
||||||
|
|
||||||
|
|
||||||
@teamkfet_required
|
@teamkfet_required
|
||||||
def transfers(request):
|
def transfers(request):
|
||||||
transfergroups = (TransferGroup.objects
|
return render(request, 'kfet/transfers.html')
|
||||||
.prefetch_related('transfers')
|
|
||||||
.order_by('-at'))
|
|
||||||
return render(request, 'kfet/transfers.html', {
|
|
||||||
'transfergroups': transfergroups,
|
|
||||||
})
|
|
||||||
|
|
||||||
@teamkfet_required
|
@teamkfet_required
|
||||||
def transfers_create(request):
|
def transfers_create(request):
|
||||||
|
|
Loading…
Reference in a new issue