From 5ea7b4c732818ae7b469abc597fa4da6161c4781 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 8 Sep 2010 09:57:34 -0500 Subject: Developer dashboard fixes As reported by Thomas, the dashboard JS dies when we try to apply table sorting to a table with no entries (those in the top section). Use some selector magic to only apply tablesorting if the table actually has rows worth sorting. Also move the package todo lists table down in the dashboard as the other two tables are more relevant for the individual developer. Signed-off-by: Dan McGee --- templates/devel/index.html | 73 ++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/templates/devel/index.html b/templates/devel/index.html index ee0a97d7..eccfbe3d 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -6,30 +6,6 @@

Developer Dashboard

- {% if todos %} -

Package Todo Lists

- - - - - - - - - - - {% for todo in todos %} - - - - - - {% endfor %} - -
NameCreation DateDescription
{{ todo.name }}{{ todo.date_added }}{{ todo.description|safe }}
- {% endif %} -

My Flagged Packages

@@ -51,7 +27,7 @@ {% empty %} - + {% endfor %}
{{ pkg.arch.name }}
No flagged packages to display
No flagged packages to display
@@ -80,7 +56,31 @@ {{ todopkg.pkg.maintainers|join:', ' }} {% empty %} - No incomplete todo list packages to display + No incomplete todo list packages to display + {% endfor %} + + + +

Package Todo Lists

+ + + + + + + + + + + {% for todo in todos %} + + + + + + {% empty %} + {% endfor %}
NameCreation DateDescription
{{ todo.name }}{{ todo.date_added }}{{ todo.description|safe }}
No package todo lists to display
@@ -201,12 +201,21 @@ $.tablesorter.addParser({ 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]], 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' } } }); + $("#dash-myflagged:not(:has(tbody tr.empty))").tablesorter( + {widgets: ['zebra'], sortList: [[0,0]]}); + $("#dash-mytodolist:not(:has(tbody tr.empty))").tablesorter( + {widgets: ['zebra'], sortList: [[0,0], [1,0]]}); + $("#dash-todo:not(:has(tbody tr.empty))").tablesorter( + {widgets: ['zebra'], sortList: [[1,1]]}); + $("#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(); } ); -- cgit v1.2.3-55-g3dc8