diff options
-rw-r--r-- | templates/packages/groups.html | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/templates/packages/groups.html b/templates/packages/groups.html index bb475b1..13840a8 100644 --- a/templates/packages/groups.html +++ b/templates/packages/groups.html @@ -30,8 +30,18 @@ {% load cdn %}{% jquery %} <script type="text/javascript" src="/media/jquery.tablesorter.min.js"></script> <script type="text/javascript"> +$.tablesorter.addParser({ + id: 'pkgcount', + is: function(s) { return false; }, + format: function(s) { + var m = s.match(/\d+/); + return m ? parseInt(m[0]) : 0; + }, + type: 'numeric' +}); + $(document).ready(function() { - $(".results").tablesorter({widgets: ['zebra'], sortList: [[1,0], [0,0]]}); + $(".results").tablesorter({widgets: ['zebra'], sortList: [[1,0], [0,0]], headers: { 2: { sorter: 'pkgcount' } } }); }); </script> {% endblock %} |