diff options
-rw-r--r-- | sitestatic/archweb.js | 23 | ||||
-rw-r--r-- | templates/packages/differences.html | 3 | ||||
-rw-r--r-- | templates/todolists/view.html | 22 |
3 files changed, 44 insertions, 4 deletions
diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index b04b1d01..e6d73414 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -279,6 +279,29 @@ function todolist_flag() { return false; } +function filter_todolist() { + /* start with all rows, and then remove ones we shouldn't show */ + var rows = $('#dev-todo-pkglist tbody').children(); + var all_rows = rows; + /* apply the filters, cheaper ones first */ + if ($('#id_mine_only').is(':checked')) { + rows = rows.filter('.mine'); + } + if ($('#id_incomplete').is(':checked')) { + rows = rows.has('.incomplete'); + } + /* hide all rows, then show the set we care about */ + all_rows.hide(); + rows.show(); + /* make sure we update the odd/even styling from sorting */ + $('.results').trigger('applyWidgets'); +} +function filter_todolist_reset() { + $('#id_incomplete').removeAttr('checked'); + $('#id_mine_only').removeAttr('checked'); + filter_todolist(); +} + /* signoffs.html */ function signoff_package() { var link = this; diff --git a/templates/packages/differences.html b/templates/packages/differences.html index 8d6887a3..b0c5b539 100644 --- a/templates/packages/differences.html +++ b/templates/packages/differences.html @@ -8,7 +8,7 @@ {% if differences %} <div class="box"> <h2>Package Differences by Architecture</h2> - <div id="differences-filter" class="filter-criteria"> + <div class="filter-criteria"> <h3>Filter Differences View</h3> <form id="diff_filter" method="post" action="."> <fieldset> @@ -29,7 +29,6 @@ </fieldset> </form> </div> - {# TODO some sort of spacing here #} <table id="table_differences" class="results"> <thead> diff --git a/templates/todolists/view.html b/templates/todolists/view.html index c774c9cd..69595e1a 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -29,6 +29,20 @@ <li><a href="pkgbases/{{ svn_root }}/">{{ svn_root }}</a></li> {% endfor %}</ul> + <div class="filter-criteria"> + <h3>Filter Todolist Packages</h3> + <form id="todolist_filter" method="post" action="."> + <fieldset> + <legend>Select filter criteria</legend> + <div><label for="id_mine_only" title="Show only packages maintained by me">Only Mine</label> + <input type="checkbox" name="mine_only" id="id_mine_only" value="mine_only"/></div> + <div><label for="id_incomplete" title="Packages not yet completed">Only Incomplete</label> + <input type="checkbox" name="incomplete" id="id_incomplete" value="incomplete"/></div> + <div ><label> </label><input title="Reset search criteria" type="button" id="criteria_reset" value="Reset"/></div> + </fieldset> + </form> + </div> + <table id="dev-todo-pkglist" class="results todo-table"> <thead> <tr> @@ -42,7 +56,7 @@ </thead> <tbody> {% for pkg in list.packages %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr class="{% cycle 'odd' 'even' %}{% if user in pkg.pkg.maintainers %} mine{% endif %}"> <td>{{ pkg.pkg.arch.name }}</td> <td>{{ pkg.pkg.repo.name|capfirst }}</td> <td>{% pkg_details_link pkg.pkg %}</td> @@ -74,12 +88,16 @@ <script type="text/javascript" src="{% static "archweb.js" %}"></script> <script type="text/javascript"> $(document).ready(function() { - $('a.status-link').click(todolist_flag); $(".results").tablesorter({ widgets: ['zebra'], sortList: [[2,0], [0,0]], headers: { 5: { sorter: 'todostatus' } } }); + $('a.status-link').click(todolist_flag); + $('#todolist_filter input').change(filter_todolist); + $('#criteria_reset').click(filter_todolist_reset); + // fire function on page load to ensure the current form selections take effect + filter_todolist(); }); </script> {% endblock %} |