From: Charles Connell Date: Tue, 18 Mar 2014 21:14:01 +0000 (-0400) Subject: Fix sorting on course list X-Git-Tag: release-20150131~144^2~32^2~1 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9a180eff84d14e2c06b6a5346fd9f9e439a15de4;p=oweals%2Fkarmaworld.git Fix sorting on course list --- diff --git a/karmaworld/templates/courses/course_list.html b/karmaworld/templates/courses/course_list.html index c7d16ed..8ae1ab9 100644 --- a/karmaworld/templates/courses/course_list.html +++ b/karmaworld/templates/courses/course_list.html @@ -43,21 +43,24 @@ $(document).ready(function() { "aoColumnDefs": [ { // 4th element: thanks - "aTargets": [ 3 ], + "aTargets": [ 6 ], "bSortable": true, - "bVisible": true + "bVisible": true, + "aDataSort": [ 3 ] }, { // 3rd element: notes - "aTargets": [ 2 ], + "aTargets": [ 5 ], "bSortable": true, - "bVisible": true + "bVisible": true, + "aDataSort": [ 2 ] }, { // 2nd element: date - "aTargets": [ 1 ], + "aTargets": [ 4 ], "bSortable": true, - "bVisible": true + "bVisible": true, + "aDataSort": [ 1 ] }, { // 1st element: "sort by" label @@ -67,7 +70,7 @@ $(document).ready(function() { } ], // Initial sorting - 'aaSorting': [[2,'desc']] + 'aaSorting': [[6,'desc']] }); $('.dataTables_filter input').attr("placeholder", "search courses"); // TODO: can't prepend html to .dataTables_filter input html for fontawesome search icon @@ -95,8 +98,11 @@ $(document).ready(function() { Sort by: + Date + # Notes + Popularity Date - #Notes + # Notes Popularity Upload Course Name diff --git a/karmaworld/templates/courses/course_list_entry.html b/karmaworld/templates/courses/course_list_entry.html index 18fd2fc..ac70db0 100644 --- a/karmaworld/templates/courses/course_list_entry.html +++ b/karmaworld/templates/courses/course_list_entry.html @@ -1,5 +1,9 @@ + {{ course.updated_at|date:"U" }} + {{ course.file_count|stringformat:"010g" }} + {{ course.get_popularity|stringformat:"010g" }} + Updated {{ course.updated_at|date:"b d, o"|capfirst }} {{ course.file_count }} Notes {{ course.get_popularity }} Thanks