Skip to content

Commit 2027ada

Browse files
polyzenjelly
authored andcommitted
signoffs: add "Only Mine" filter
Implements #550
1 parent 05abc7f commit 2027ada

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

sitestatic/archweb.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ function filter_signoffs() {
324324
/* start with all rows, and then remove ones we shouldn't show */
325325
var rows = $('#tbody_signoffs').children(),
326326
all_rows = rows;
327+
/* apply the filters, cheaper ones first */
328+
if ($('#id_mine_only').is(':checked')) {
329+
rows = rows.filter('.mine');
330+
}
327331
/* apply arch and repo filters */
328332
$('#signoffs_filter .arch_filter').add(
329333
'#signoffs_filter .repo_filter').each(function() {
@@ -352,6 +356,7 @@ function filter_signoffs() {
352356
function filter_signoffs_reset() {
353357
$('#signoffs_filter .arch_filter').prop('checked', true);
354358
$('#signoffs_filter .repo_filter').prop('checked', true);
359+
$('#id_mine_only').prop('checked', false);
355360
$('#id_pending').prop('checked', false);
356361
filter_signoffs();
357362
}

templates/packages/signoffs.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ <h3>Filter Displayed Signoffs</h3>
2626
<div><label for="id_repo_{{ repo_name|lower }}" title="Target Repository {{ repo_name }}">[{{ repo_name|lower }}]</label>
2727
<input type="checkbox" name="repo_{{ repo_name|lower }}" id="id_repo_{{ repo_name|lower }}" class="repo_filter" value="{{ repo_name|lower }}" checked="checked"/></div>
2828
{% endfor %}
29+
{% if user.is_authenticated %}
30+
<div><label for="id_mine_only" title="Show only packages packaged by me">Only Mine</label>
31+
<input type="checkbox" name="mine_only" id="id_mine_only" value="mine_only"/></div>
32+
{% endif %}
2933
<div><label for="id_pending" title="Packages with not enough signoffs">Only Pending Approval</label>
3034
<input type="checkbox" name="pending" id="id_pending" value="pending"/></div>
3135
<div><label>&nbsp;</label><input title="Reset search criteria" type="button" id="criteria_reset" value="Reset"/></div>
@@ -50,7 +54,8 @@ <h3>Filter Displayed Signoffs</h3>
5054
</tr>
5155
</thead>
5256
<tbody id="tbody_signoffs">
53-
{% for group in signoff_groups %}<tr class="{{ group.arch.name }} {{ group.target_repo|lower }}">
57+
{% for group in signoff_groups %}
58+
<tr class="{% if user == group.packager %} mine{% endif %} {{ group.arch.name }} {{ group.target_repo|lower }}">
5459
<td>{% pkg_details_link group.package %} {{ group.version }}</td>
5560
<td>{{ group.arch.name }}</td>
5661
<td>{{ group.target_repo }}</td>

0 commit comments

Comments
 (0)