diff options
author | Dan McGee <dan@archlinux.org> | 2010-09-01 14:50:50 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-09-01 14:50:50 +0200 |
commit | 0181177f8650e6870f6f87383feb44b67b995607 (patch) | |
tree | 901b5257d862bb0895e41d8e3645d960d2d4a9b4 /templates/devel | |
parent | d7854ed8f1af5b203efad976c04a43f80b336a2b (diff) | |
download | archweb-0181177f8650e6870f6f87383feb44b67b995607.tar.gz archweb-0181177f8650e6870f6f87383feb44b67b995607.tar.xz |
Dev dashboard: enable sorting by package count
Add another custom parser to the mix here so we can sort by package count,
which just involves extracting the digits from the table cell contents and
ignoring the text.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'templates/devel')
-rw-r--r-- | templates/devel/index.html | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/templates/devel/index.html b/templates/devel/index.html index dd315fd..ee0a97d 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -191,13 +191,22 @@ {% 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() { $("#dash-todo").tablesorter({widgets: ['zebra'], sortList: [[1,1]]}); $("#dash-myflagged").tablesorter({widgets: ['zebra'], sortList: [[0,0]]}); $("#dash-mytodolist").tablesorter({widgets: ['zebra'], sortList: [[0,0], [1,0]]}); - $("#stats-by-arch").tablesorter({widgets: ['zebra'], sortList: [[0,0]]}); - $("#stats-by-repo").tablesorter({widgets: ['zebra'], sortList: [[0,0]]}); - $("#stats-by-maintainer").tablesorter({widgets: ['zebra'], sortList: [[0,0]]}); + $("#stats-by-arch").tablesorter({widgets: ['zebra'], sortList: [[0,0]], headers: { 1: { sorter: 'pkgcount' }, 2: { sorter: 'pkgcount' } } }); + $("#stats-by-repo").tablesorter({widgets: ['zebra'], sortList: [[0,0]], headers: { 1: { sorter: 'pkgcount' }, 2: { sorter: 'pkgcount' } } }); + $("#stats-by-maintainer").tablesorter({widgets: ['zebra'], sortList: [[0,0]], headers: { 1: { sorter: 'pkgcount' } } }); $("h3.dash-stats").click( function(e) { $(this).next().toggle(); } ); |