Skip to content

Commit 8b0b7cb

Browse files
committed
Tweak a bunch of things
1 parent 337bafe commit 8b0b7cb

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

pgcommitfest/commitfest/templates/home.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@
4848
</tbody>
4949
</table>
5050
{%endif%}
51-
<h3>{{p.is_open|yesno:"Active patches,Closed patches"}}</h3>
51+
<h3>{{user.is_authenticated|yesno:"Your personal dashboard,Patches in the current commitfest"}}</h3>
5252
<table class="table table-striped table-bordered table-hover table-condensed">
5353
<thead>
5454
<tr>
5555
<th><a href="#" style="color:#333333;" onclick="return sortpatches(5);">Patch</a>{%if sortkey == 5%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -5%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
5656
<th><a href="#" style="color:#333333;" onclick="return sortpatches(4);">ID</a>{%if sortkey == 4%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -4%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
57-
<th><a href="#" style="color:#333333;" onclick="return sortpatches(8);">CF</a>{%if sortkey == 8%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -8%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
57+
{%if user.is_authenticated %}
58+
<th><a href="#" style="color:#333333;" onclick="return sortpatches(8);">CF</a>{%if sortkey == 8%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -8%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
59+
{%endif%}
5860
<th>Status</th>
5961
<th>Ver</th>
6062
<th><a href="#" style="color:#333333;" onclick="return sortpatches(7);">CI status</a>{%if sortkey == 7%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -7%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
@@ -74,13 +76,15 @@ <h3>{{p.is_open|yesno:"Active patches,Closed patches"}}</h3>
7476

7577
{%if grouping%}
7678
{%ifchanged p.topic%}
77-
<tr><th colspan="{%if user.is_staff%}11{%else%}10{%endif%}">{{p.topic}}</th></tr>
79+
<tr><th colspan="{%if user.is_staff%}13{%elif user.is_authenticated %}12{%else%}11{%endif%}">{{p.topic}}</th></tr>
7880
{%endifchanged%}
7981
{%endif%}
8082
<tr>
8183
<td><a href="/patch/{{p.id}}/">{{p.name}}</a></td>
8284
<td>{{p.id}}</td>
83-
<td><a href="/{{p.cf_id}}/"><span class="label label-{{p.cf_status|commitfeststatuslabel}}">{{p.cf_name}}</span></a></td>
85+
{%if user.is_authenticated %}
86+
<td><a href="/{{p.cf_id}}/"><span class="label label-{{p.cf_status|commitfeststatuslabel}}">{{p.cf_name}}</span></a></td>
87+
{%endif%}
8488
<td><span class="label label-{{p.status|patchstatuslabel}}">{{p.status|patchstatusstring}}</span></td>
8589
<td>{%if p.targetversion%}<span class="label label-default">{{p.targetversion}}</span>{%endif%}</td>
8690
<td class="cfbot-summary">

pgcommitfest/commitfest/views.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def patchlist(request, cf, personalized=False):
311311
) AND (
312312
poc.status=ANY(%(review_statuses)s)
313313
)
314-
THEN 'Patches you might want to review'
314+
THEN 'Patches that are ready for your review'
315315
ELSE 'Blocked on others'
316316
END AS topic,
317317
cf.id AS cf_id,
@@ -377,9 +377,24 @@ def patchlist(request, cf, personalized=False):
377377
orderby_str = "poc.commitfest_id DESC, lastmail"
378378
else:
379379
if personalized:
380-
orderby_str = (
381-
"topic DESC, branch.failing_since NULLS FIRST, cf.id, lastmail DESC"
382-
)
380+
# First we sort by topic, to have the grouping work.
381+
# Then we show non-failing patches first, and the ones that are
382+
# shortest failing we show first. We consider patches in a closed
383+
# commitfest, as if they are failing since that commitfest was
384+
# closed.
385+
# Then we sort by start date of the CF, to show entries in the "In
386+
# progress" commitfest before ones in the "Open" commitfest.
387+
# And then to break ties, we put ones with the most recent email at
388+
# the top.
389+
orderby_str = """topic DESC,
390+
COALESCE(
391+
branch.failing_since,
392+
CASE WHEN cf.status = %(cf_closed_status)s
393+
THEN enddate ELSE NULL END
394+
) DESC NULLS FIRST,
395+
cf.startdate,
396+
lastmail DESC"""
397+
whereparams["cf_closed_status"] = CommitFest.STATUS_CLOSED
383398
else:
384399
orderby_str = "topic, created"
385400
sortkey = 0

0 commit comments

Comments
 (0)