From 3fff88c040a47ffa85382ef7ad7e578d4c934bc7 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 29 May 2018 14:25:12 -0400 Subject: [PATCH] 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. --- pgcommitfest/commitfest/templates/commitfest.html | 2 ++ pgcommitfest/commitfest/views.py | 3 +++ 2 files changed, 5 insertions(+) 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 @@ Author Reviewers Committer + {%if p.is_open%}Num cfs{%if sortkey == 3%}
{%endif%}{%else%}Num cfs{%endif%} {%if p.is_open%}Latest activity{%if sortkey == 1%}
{%endif%}{%else%}Latest activity{%endif%} {%if p.is_open%}Latest mail{%if sortkey == 2%}
{%endif%}{%else%}Latest mail{%endif%} {%if user.is_staff%} @@ -86,6 +87,7 @@ {{p.author_names|default:''}} {{p.reviewer_names|default:''}} {{p.committer|default:''}} + {{p.num_cfs}} {{p.modified|date:"Y-m-d"}}
{{p.modified|date:"H:i"}} {{p.lastmail|date:"Y-m-d"}}
{{p.lastmail|date:"H:i"}} {%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. -- 2.39.5