Skip to content

Commit 60d5a29

Browse files
Allow sorting patches by committer (#123)
Fixes #112 The Committer column on the commitfest page can now be clicked to sort by committer, like the other columns. Combined with the Committed status filter this makes it easy to see who committed what in a commitfest. --------- Co-authored-by: Jelterminator FennemAI-Neo <fennemai@jeltef.nl>
1 parent 0145ed0 commit 60d5a29

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎pgcommitfest/commitfest/templates/commitfest.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ <h3>{{p.is_open|yesno:"Active patches,Closed patches"}}</h3>
4141
<th><a href="#" style="color:#333333;" onclick="return sortpatches(6);">Stats</a>{%if sortkey == 6%}<div style="float:right;"><i class="bi bi-sort-numeric-down"></i></div>{%elif sortkey == -6%}<div style="float:right;"><i class="bi bi-sort-numeric-up"></i></div>{%endif%}</th>
4242
<th>Author</th>
4343
<th>Reviewers</th>
44-
<th>Committer</th>
44+
<th><a href="#" style="color:#333333;" onclick="return sortpatches(9);">Committer</a>{%if sortkey == 9%}<div style="float:right;"><i class="bi bi-sort-alpha-down"></i></div>{%elif sortkey == -9%}<div style="float:right;"><i class="bi bi-sort-alpha-up"></i></div>{%endif%}</th>
4545
<th><a href="#" style="color:#333333;" onclick="return sortpatches(3);">Num cfs</a>{%if sortkey == 3%}<div style="float:right;"><i class="bi bi-sort-numeric-down-alt"></i></div>{%elif sortkey == -3%}<div style="float:right;"><i class="bi bi-sort-numeric-up-alt"></i></div>{%endif%}</th>
4646
<th><a href="#" style="color:#333333;" onclick="return sortpatches(2);">Latest mail</a>{%if sortkey == 2%}<div style="float:right;"><i class="bi bi-sort-down"></i></div>{%elif sortkey == -2%}<div style="float:right;"><i class="bi bi-sort-up"></i></div>{%endif%}</th>
4747
{%if user.is_staff%}

‎pgcommitfest/commitfest/views.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,18 @@ def patchlist(request, cf, personalized=False):
507507
orderby_str = "poc.commitfest_id, lastmail DESC"
508508
elif sortkey == -8:
509509
orderby_str = "poc.commitfest_id DESC, lastmail"
510+
elif sortkey == 9 and not personalized:
511+
# PostgreSQL sorts NULLs last when ascending and first when
512+
# descending, so patches without a committer end up at the bottom in
513+
# this order and at the top in the reverse one.
514+
orderby_str = (
515+
"committer.last_name, committer.first_name, committer.username, p.id"
516+
)
517+
elif sortkey == -9 and not personalized:
518+
orderby_str = (
519+
"committer.last_name DESC, committer.first_name DESC, "
520+
"committer.username DESC, p.id DESC"
521+
)
510522
else:
511523
if personalized:
512524
# First we sort by group_name, to have the grouping work.

0 commit comments

Comments
 (0)