diff --git a/pgcommitfest/commitfest/templates/commitfest.html b/pgcommitfest/commitfest/templates/commitfest.html index 99ccebc9..53d4fde9 100644 --- a/pgcommitfest/commitfest/templates/commitfest.html +++ b/pgcommitfest/commitfest/templates/commitfest.html @@ -26,18 +26,18 @@

{{p.is_open|yesno:"Active patches,Closed patches"}}

- - + + - - + + - - + + {%if user.is_staff%} {%endif%} diff --git a/pgcommitfest/commitfest/templates/home.html b/pgcommitfest/commitfest/templates/home.html index 4e8a5d80..f21eb21c 100644 --- a/pgcommitfest/commitfest/templates/home.html +++ b/pgcommitfest/commitfest/templates/home.html @@ -123,25 +123,25 @@

{%if user.is_authenticated%}Open patches you are subscribed to{%elif p.is_op

Patch{%if sortkey == 5%}
{%elif sortkey == -5%}
{%endif%}
ID{%if sortkey == 4%}
{%elif sortkey == -4%}
{%endif%}
Patch{%if sortkey == 5%}
{%elif sortkey == -5%}
{%endif%}
ID{%if sortkey == 4%}
{%elif sortkey == -4%}
{%endif%}
Status Tags VerCI status{%if sortkey == 7%}
{%elif sortkey == -7%}
{%endif%}
Stats{%if sortkey == 6%}
{%elif sortkey == -6%}
{%endif%}
CI status{%if sortkey == 7%}
{%elif sortkey == -7%}
{%endif%}
Stats{%if sortkey == 6%}
{%elif sortkey == -6%}
{%endif%}
Author Reviewers CommitterNum cfs{%if sortkey == 3%}
{%elif sortkey == -3%}
{%endif%}
Latest mail{%if sortkey == 2%}
{%elif sortkey == -2%}
{%endif%}
Num cfs{%if sortkey == 3%}
{%elif sortkey == -3%}
{%endif%}
Latest mail{%if sortkey == 2%}
{%elif sortkey == -2%}
{%endif%}
Select
- - + + {%if user.is_authenticated %} {%endif%} - - + + - - + + diff --git a/pgcommitfest/commitfest/views.py b/pgcommitfest/commitfest/views.py index 465e0f70..9d6f3f6f 100644 --- a/pgcommitfest/commitfest/views.py +++ b/pgcommitfest/commitfest/views.py @@ -82,50 +82,50 @@ def home(request): form = CommitFestFilterForm(request.GET) patch_list = patchlist(request, cf, personalized=True) - if not patch_list.redirect: - # Get stats related to user for current commitfest (same as me() view) - curs.execute( - """SELECT - ps.status, ps.statusstring, count(*) - FROM commitfest_patchoncommitfest poc - INNER JOIN commitfest_patch p ON p.id = poc.patch_id - INNER JOIN commitfest_patchstatus ps ON ps.status=poc.status - WHERE - ps.status = ANY(%(openstatuses)s) - AND ( - EXISTS ( - SELECT 1 FROM commitfest_patch_reviewers cpr WHERE cpr.patch_id=p.id AND cpr.user_id=%(user_id)s - ) - OR EXISTS ( - SELECT 1 FROM commitfest_patch_authors cpa WHERE cpa.patch_id=p.id AND cpa.user_id=%(user_id)s - ) - OR p.committer_id=%(user_id)s + if patch_list.redirect: + return patch_list.redirect + + # Get stats related to user for current commitfest (same as me() view) + curs.execute( + """SELECT + ps.status, ps.statusstring, count(*) + FROM commitfest_patchoncommitfest poc + INNER JOIN commitfest_patch p ON p.id = poc.patch_id + INNER JOIN commitfest_patchstatus ps ON ps.status=poc.status + WHERE + ps.status = ANY(%(openstatuses)s) + AND ( + EXISTS ( + SELECT 1 FROM commitfest_patch_reviewers cpr WHERE cpr.patch_id=p.id AND cpr.user_id=%(user_id)s ) - GROUP BY ps.status ORDER BY ps.sortkey""", - { - "user_id": request.user.id, - "openstatuses": PatchOnCommitFest.OPEN_STATUSES, - }, - ) - statussummary = curs.fetchall() - - context.update( - { - "show_dashboard": True, - "form": form, - "patches": patch_list.patches, - "statussummary": statussummary, - "all_tags": {t.id: t for t in Tag.objects.all()}, - "has_filter": patch_list.has_filter, - "grouping": patch_list.sortkey == 0, - "sortkey": patch_list.sortkey, - "openpatchids": [ - p["id"] for p in patch_list.patches if p["is_open"] - ], - "userprofile": getattr(request.user, "userprofile", UserProfile()), - "is_experienced_user": is_experienced_user, - } + OR EXISTS ( + SELECT 1 FROM commitfest_patch_authors cpa WHERE cpa.patch_id=p.id AND cpa.user_id=%(user_id)s + ) + OR p.committer_id=%(user_id)s ) + GROUP BY ps.status ORDER BY ps.sortkey""", + { + "user_id": request.user.id, + "openstatuses": PatchOnCommitFest.OPEN_STATUSES, + }, + ) + statussummary = curs.fetchall() + + context.update( + { + "show_dashboard": True, + "form": form, + "patches": patch_list.patches, + "statussummary": statussummary, + "all_tags": {t.id: t for t in Tag.objects.all()}, + "has_filter": patch_list.has_filter, + "grouping": patch_list.sortkey == 0, + "sortkey": patch_list.sortkey, + "openpatchids": [p["id"] for p in patch_list.patches if p["is_open"]], + "userprofile": getattr(request.user, "userprofile", UserProfile()), + "is_experienced_user": is_experienced_user, + } + ) return render(request, "home.html", context)
Patch{%if sortkey == 5%}
{%elif sortkey == -5%}
{%endif%}
ID{%if sortkey == 4%}
{%elif sortkey == -4%}
{%endif%}
Patch{%if sortkey == 5%}
{%elif sortkey == -5%}
{%endif%}
ID{%if sortkey == 4%}
{%elif sortkey == -4%}
{%endif%}
CF - {%if sortkey == 8%}
{%elif sortkey == -8%}
{%endif%} + {%if sortkey == 8%}
{%elif sortkey == -8%}
{%endif%}
Status Tags VerCI status{%if sortkey == 7%}
{%elif sortkey == -7%}
{%endif%}
Stats{%if sortkey == 6%}
{%elif sortkey == -6%}
{%endif%}
CI status{%if sortkey == 7%}
{%elif sortkey == -7%}
{%endif%}
Stats{%if sortkey == 6%}
{%elif sortkey == -6%}
{%endif%}
Author Reviewers CommitterNum cfs{%if sortkey == 3%}
{%elif sortkey == -3%}
{%endif%}
Latest mail{%if sortkey == 2%}
{%elif sortkey == -2%}
{%endif%}
Num cfs{%if sortkey == 3%}
{%elif sortkey == -3%}
{%endif%}
Latest mail{%if sortkey == 2%}
{%elif sortkey == -2%}
{%endif%}