summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander2018-05-29 18:25:12 +0000
committerMagnus Hagander2018-05-29 18:25:12 +0000
commit3fff88c040a47ffa85382ef7ad7e578d4c934bc7 (patch)
tree11ba40c33fb6a0ab65f8ea9d765112d2e11dbddc
parent4c1233cbfe36805fe5fb511b6746bae86cac975d (diff)
Show the number of CFs a patch has been on
Per discussions at the developer meeting, show the number of CFs a patch has been on, and make it possible to sort on this value.
-rw-r--r--pgcommitfest/commitfest/templates/commitfest.html2
-rw-r--r--pgcommitfest/commitfest/views.py3
2 files changed, 5 insertions, 0 deletions
diff --git a/pgcommitfest/commitfest/templates/commitfest.html b/pgcommitfest/commitfest/templates/commitfest.html
index 63f6a25..009ff5e 100644
--- a/pgcommitfest/commitfest/templates/commitfest.html
+++ b/pgcommitfest/commitfest/templates/commitfest.html
@@ -65,6 +65,7 @@
<th>Author</th>
<th>Reviewers</th>
<th>Committer</th>
+ <th>{%if p.is_open%}<a href="#" style="color:#333333;" onclick="return sortpatches(3);">Num cfs</a>{%if sortkey == 3%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%endif%}{%else%}Num cfs{%endif%}</th>
<th>{%if p.is_open%}<a href="#" style="color:#333333;" onclick="return sortpatches(1);">Latest activity</a>{%if sortkey == 1%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%endif%}{%else%}Latest activity{%endif%}</th>
<th>{%if p.is_open%}<a href="#" style="color:#333333;" onclick="return sortpatches(2);">Latest mail</a>{%if sortkey == 2%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%endif%}{%else%}Latest mail{%endif%}</th>
{%if user.is_staff%}
@@ -86,6 +87,7 @@
<td>{{p.author_names|default:''}}</td>
<td>{{p.reviewer_names|default:''}}</td>
<td>{{p.committer|default:''}}</td>
+ <td>{{p.num_cfs}}</td>
<td style="white-space: nowrap;">{{p.modified|date:"Y-m-d"}}<br/>{{p.modified|date:"H:i"}}</td>
<td style="white-space: nowrap;">{{p.lastmail|date:"Y-m-d"}}<br/>{{p.lastmail|date:"H:i"}}</td>
{%if user.is_staff%}
diff --git a/pgcommitfest/commitfest/views.py b/pgcommitfest/commitfest/views.py
index 049610f..5a5505f 100644
--- a/pgcommitfest/commitfest/views.py
+++ b/pgcommitfest/commitfest/views.py
@@ -159,6 +159,8 @@ def commitfest(request, cfid):
ordering = ['-is_open', 'modified', 'created',]
elif sortkey==2:
ordering = ['-is_open', 'lastmail', 'created',]
+ elif sortkey==3:
+ ordering = ['-is_open', '-num_cfs', 'modified', 'created']
else:
sortkey=0
else:
@@ -173,6 +175,7 @@ def commitfest(request, cfid):
'author_names':"SELECT string_agg(first_name || ' ' || last_name || ' (' || username || ')', ', ') FROM auth_user INNER JOIN commitfest_patch_authors cpa ON cpa.user_id=auth_user.id WHERE cpa.patch_id=commitfest_patch.id",
'reviewer_names':"SELECT string_agg(first_name || ' ' || last_name || ' (' || username || ')', ', ') FROM auth_user INNER JOIN commitfest_patch_reviewers cpr ON cpr.user_id=auth_user.id WHERE cpr.patch_id=commitfest_patch.id",
'is_open':'commitfest_patchoncommitfest.status IN (%s)' % ','.join([str(x) for x in PatchOnCommitFest.OPEN_STATUSES]),
+ 'num_cfs': 'SELECT count(1) FROM commitfest_patchoncommitfest pcf WHERE pcf.patch_id=commitfest_patch.id',
}).order_by(*ordering))
# Generate patch status summary.