Skip to content

Commit 3fff88c

Browse files
committed
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.
1 parent 4c1233c commit 3fff88c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pgcommitfest/commitfest/templates/commitfest.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ <h3>{{p.is_open|yesno:"Active patches,Closed patches"}}</h3>
6565
<th>Author</th>
6666
<th>Reviewers</th>
6767
<th>Committer</th>
68+
<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>
6869
<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>
6970
<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>
7071
{%if user.is_staff%}
@@ -86,6 +87,7 @@ <h3>{{p.is_open|yesno:"Active patches,Closed patches"}}</h3>
8687
<td>{{p.author_names|default:''}}</td>
8788
<td>{{p.reviewer_names|default:''}}</td>
8889
<td>{{p.committer|default:''}}</td>
90+
<td>{{p.num_cfs}}</td>
8991
<td style="white-space: nowrap;">{{p.modified|date:"Y-m-d"}}<br/>{{p.modified|date:"H:i"}}</td>
9092
<td style="white-space: nowrap;">{{p.lastmail|date:"Y-m-d"}}<br/>{{p.lastmail|date:"H:i"}}</td>
9193
{%if user.is_staff%}

pgcommitfest/commitfest/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ def commitfest(request, cfid):
159159
ordering = ['-is_open', 'modified', 'created',]
160160
elif sortkey==2:
161161
ordering = ['-is_open', 'lastmail', 'created',]
162+
elif sortkey==3:
163+
ordering = ['-is_open', '-num_cfs', 'modified', 'created']
162164
else:
163165
sortkey=0
164166
else:
@@ -173,6 +175,7 @@ def commitfest(request, cfid):
173175
'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",
174176
'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",
175177
'is_open':'commitfest_patchoncommitfest.status IN (%s)' % ','.join([str(x) for x in PatchOnCommitFest.OPEN_STATUSES]),
178+
'num_cfs': 'SELECT count(1) FROM commitfest_patchoncommitfest pcf WHERE pcf.patch_id=commitfest_patch.id',
176179
}).order_by(*ordering))
177180

178181
# Generate patch status summary.

0 commit comments

Comments
 (0)