From 8383a071608329c7683f7a710030ce945bd20b4d Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 8 Jul 2012 23:30:48 -0500 Subject: Add a new jquery_tablesorter CDN template tag And use it everywhere we were including the file before. This should make updating the version a heck of a lot easier. Signed-off-by: Dan McGee --- templates/todolists/view.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'templates/todolists/view.html') diff --git a/templates/todolists/view.html b/templates/todolists/view.html index 02bbfd4f..c774c9cd 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -70,8 +70,7 @@

Todo List: {{ list.name }}

-{% load cdn %}{% jquery %} - +{% load cdn %}{% jquery %}{% jquery_tablesorter %} {% endblock %} -- cgit v1.2.3-54-g00ecf From c1a6a87e23864ea044cb15f76b9dbb16734f08d8 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 25 Jul 2012 00:45:36 -0500 Subject: Add arch and repo filter to todolist packages This matches what we do on signoffs. Also beef up the styling a bit and add the dynamically updated package count info. Signed-off-by: Dan McGee --- sitestatic/archweb.js | 9 +++++++++ templates/todolists/view.html | 16 ++++++++++++++-- todolists/views.py | 4 ++++ 3 files changed, 27 insertions(+), 2 deletions(-) (limited to 'templates/todolists/view.html') diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index e6d73414..6586d312 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -287,12 +287,21 @@ function filter_todolist() { if ($('#id_mine_only').is(':checked')) { rows = rows.filter('.mine'); } + /* apply arch and repo filters */ + $('#todolist_filter .arch_filter').add( + '#todolist_filter .repo_filter').each(function() { + if (!$(this).is(':checked')) { + rows = rows.not('.' + $(this).val()); + } + }); + /* more expensive filter because of 'has' call */ if ($('#id_incomplete').is(':checked')) { rows = rows.has('.incomplete'); } /* hide all rows, then show the set we care about */ all_rows.hide(); rows.show(); + $('#filter-count').text(rows.length); /* make sure we update the odd/even styling from sorting */ $('.results').trigger('applyWidgets'); } diff --git a/templates/todolists/view.html b/templates/todolists/view.html index 69595e1a..35bc9446 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -29,16 +29,28 @@

Todo List: {{ list.name }}

  • {{ svn_root }}
  • {% endfor %} -
    +

    {{ list.packages|length }} total todolist package{{ list.packages|pluralize }} found.

    + +

    Filter Todolist Packages

    Select filter criteria + {% for arch in arches %} +
    +
    + {% endfor %} + {% for repo in repos %} +
    +
    + {% endfor %}
    +
    +
    {{ list.packages|length }} todolist packages displayed.
    @@ -56,7 +68,7 @@

    Filter Todolist Packages

    {% for pkg in list.packages %} - + {{ pkg.pkg.arch.name }} {{ pkg.pkg.repo.name|capfirst }} {% pkg_details_link pkg.pkg %} diff --git a/todolists/views.py b/todolists/views.py index c7ba2560..b8d1dae1 100644 --- a/todolists/views.py +++ b/todolists/views.py @@ -53,9 +53,13 @@ def view(request, list_id): # we don't hold onto the result, but the objects are the same here, # so accessing maintainers in the template is now cheap attach_maintainers(tp.pkg for tp in todolist.packages) + arches = set(tp.pkg.arch for tp in todolist.packages) + repos = set(tp.pkg.repo for tp in todolist.packages) return render(request, 'todolists/view.html', { 'list': todolist, 'svn_roots': svn_roots, + 'arches': sorted(arches), + 'repos': sorted(repos), }) # really no need for login_required on this one... -- cgit v1.2.3-54-g00ecf From 59c353e22c5a9d1fda347e82f0734cf78bc7d387 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 15 Sep 2012 08:52:34 -0500 Subject: Standardize spelling of 'todo list' We use a space everywhere but a few places; fix the exceptions. Signed-off-by: Dan McGee --- templates/todolists/view.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'templates/todolists/view.html') diff --git a/templates/todolists/view.html b/templates/todolists/view.html index 35bc9446..c22bfecf 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -29,10 +29,10 @@

    Todo List: {{ list.name }}

  • {{ svn_root }}
  • {% endfor %} -

    {{ list.packages|length }} total todolist package{{ list.packages|pluralize }} found.

    +

    {{ list.packages|length }} total todo list package{{ list.packages|pluralize }} found.

    -

    Filter Todolist Packages

    +

    Filter Todo List Packages

    Select filter criteria @@ -50,7 +50,7 @@

    Filter Todolist Packages

    -
    {{ list.packages|length }} todolist packages displayed.
    +
    {{ list.packages|length }} todo list packages displayed.
    -- cgit v1.2.3-54-g00ecf From dfbf7cdd4c273f2b1f3c1c79b97149d37e63e028 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 15 Sep 2012 09:13:58 -0500 Subject: Make todolist filtering functions more generic This will allow us to use them elsewhere in a future commit. Signed-off-by: Dan McGee --- sitestatic/archweb.js | 14 ++++++++------ templates/todolists/view.html | 7 ++++--- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'templates/todolists/view.html') diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index c274a675..783f75c6 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -293,17 +293,17 @@ function todolist_flag() { return false; } -function filter_todolist() { +function filter_pkgs_list(filter_ele, tbody_ele) { /* start with all rows, and then remove ones we shouldn't show */ - var rows = $('#dev-todo-pkglist tbody').children(); + var rows = $(tbody_ele).children(); var all_rows = rows; /* apply the filters, cheaper ones first */ if ($('#id_mine_only').is(':checked')) { rows = rows.filter('.mine'); } /* apply arch and repo filters */ - $('#todolist_filter .arch_filter').add( - '#todolist_filter .repo_filter').each(function() { + $(filter_ele + ' .arch_filter').add( + filter_ele + ' .repo_filter').each(function() { if (!$(this).is(':checked')) { rows = rows.not('.' + $(this).val()); } @@ -319,10 +319,12 @@ function filter_todolist() { /* make sure we update the odd/even styling from sorting */ $('.results').trigger('applyWidgets', [false]); } -function filter_todolist_reset() { +function filter_pkgs_reset(callback) { $('#id_incomplete').removeAttr('checked'); $('#id_mine_only').removeAttr('checked'); - filter_todolist(); + $('.arch_filter').attr('checked', 'checked'); + $('.repo_filter').attr('checked', 'checked'); + callback(); } /* signoffs.html */ diff --git a/templates/todolists/view.html b/templates/todolists/view.html index c22bfecf..eff81aaf 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -106,10 +106,11 @@

    Filter Todo List Packages

    headers: { 5: { sorter: 'todostatus' } } }); $('a.status-link').click(todolist_flag); - $('#todolist_filter input').change(filter_todolist); - $('#criteria_reset').click(filter_todolist_reset); + filter_func = function() { filter_pkgs_list('#todolist_filter', '#dev-todo-pkglist tbody'); }; + $('#todolist_filter input').change(filter_func); + $('#criteria_reset').click(function() { filter_pkgs_reset(filter_func); }); // fire function on page load to ensure the current form selections take effect - filter_todolist(); + filter_func(); }); {% endblock %} -- cgit v1.2.3-54-g00ecf From 8a8542ede6493939bd6528a72b8fd912fdf4d14b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 11 Dec 2012 10:02:26 -0600 Subject: Use multiple separate document.ready() handlers If one of them breaks, we don't want to prevent the rest of the on-load events from firing. This is currently a problem on some browsers with the versions of jQuery and tablesorter we are using. Signed-off-by: Dan McGee --- templates/devel/packages.html | 4 +++- templates/packages/differences.html | 5 +++-- templates/packages/signoffs.html | 6 ++++-- templates/todolists/view.html | 4 +++- 4 files changed, 13 insertions(+), 6 deletions(-) (limited to 'templates/todolists/view.html') diff --git a/templates/devel/packages.html b/templates/devel/packages.html index 4e1381ab..a62ae1ab 100644 --- a/templates/devel/packages.html +++ b/templates/devel/packages.html @@ -78,7 +78,9 @@

    Filter Packages

    {% endif %} diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index fc6adca2..b6737230 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -85,9 +85,11 @@

    Filter Displayed Signoffs