Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pgcommitfest/commitfest/templates/commitfest.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ <h3>{{p.is_open|yesno:"Active patches,Closed patches"}}</h3>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(5);">Patch</a>{%if sortkey == 5%}<div style="float:right;">↓</div>{%elif sortkey == -5%}<div style="float:right;"></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(4);">ID</a>{%if sortkey == 4%}<div style="float:right;">↓</div>{%elif sortkey == -4%}<div style="float:right;"></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(5);">Patch</a>{%if sortkey == 5%}<div style="float:right;"><i class="bi bi-sort-alpha-down"></i></div>{%elif sortkey == -5%}<div style="float:right;"><i class="bi bi-sort-alpha-up"></i></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(4);">ID</a>{%if sortkey == 4%}<div style="float:right;"><i class="bi bi-sort-numeric-down"></i></div>{%elif sortkey == -4%}<div style="float:right;"><i class="bi bi-sort-numeric-up"></i></div>{%endif%}</th>
<th>Status</th>
<th>Tags</th>
<th>Ver</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(7);">CI status</a>{%if sortkey == 7%}<div style="float:right;">↓</div>{%elif sortkey == -7%}<div style="float:right;"></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(6);">Stats</a>{%if sortkey == 6%}<div style="float:right;">↓</div>{%elif sortkey == -6%}<div style="float:right;"></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(7);">CI status</a>{%if sortkey == 7%}<div style="float:right;"><i class="bi bi-sort-down-alt"></i></div>{%elif sortkey == -7%}<div style="float:right;"><i class="bi bi-sort-up-alt"></i></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(6);">Stats</a>{%if sortkey == 6%}<div style="float:right;"><i class="bi bi-sort-numeric-down"></i></div>{%elif sortkey == -6%}<div style="float:right;"><i class="bi bi-sort-numeric-up"></i></div>{%endif%}</th>
<th>Author</th>
<th>Reviewers</th>
<th>Committer</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(3);">Num cfs</a>{%if sortkey == 3%}<div style="float:right;">↓</div>{%elif sortkey == -3%}<div style="float:right;"></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(2);">Latest mail</a>{%if sortkey == 2%}<div style="float:right;">↓</div>{%elif sortkey == -2%}<div style="float:right;"></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(3);">Num cfs</a>{%if sortkey == 3%}<div style="float:right;"><i class="bi bi-sort-numeric-down-alt"></i></div>{%elif sortkey == -3%}<div style="float:right;"><i class="bi bi-sort-numeric-up-alt"></i></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(2);">Latest mail</a>{%if sortkey == 2%}<div style="float:right;"><i class="bi bi-sort-down"></i></div>{%elif sortkey == -2%}<div style="float:right;"><i class="bi bi-sort-up"></i></div>{%endif%}</th>
{%if user.is_staff%}
<th>Select</th>
{%endif%}
Expand Down
14 changes: 7 additions & 7 deletions pgcommitfest/commitfest/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,25 +123,25 @@ <h3>{%if user.is_authenticated%}Open patches you are subscribed to{%elif p.is_op
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(5);">Patch</a>{%if sortkey == 5%}<div style="float:right;">↓</div>{%elif sortkey == -5%}<div style="float:right;"></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(4);">ID</a>{%if sortkey == 4%}<div style="float:right;">↓</div>{%elif sortkey == -4%}<div style="float:right;"></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(5);">Patch</a>{%if sortkey == 5%}<div style="float:right;"><i class="bi bi-sort-alpha-down"></i></div>{%elif sortkey == -5%}<div style="float:right;"><i class="bi bi-sort-alpha-up"></i></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(4);">ID</a>{%if sortkey == 4%}<div style="float:right;"><i class="bi bi-sort-numeric-down"></i></div>{%elif sortkey == -4%}<div style="float:right;"><i class="bi bi-sort-numeric-up"></i></div>{%endif%}</th>
{%if user.is_authenticated %}
<th>
<a href="#" style="color:#333333;" onclick="return sortpatches(8);">CF</a>
<i class="bi bi-question-circle text-muted" style="font-size: 0.8em; margin-left: 3px;" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-html="true" title="Color coding:<br>Green = In Progress<br>Blue = Open<br>Red = Closed"></i>
{%if sortkey == 8%}<div style="float:right;">↓</div>{%elif sortkey == -8%}<div style="float:right;"></div>{%endif%}
{%if sortkey == 8%}<div style="float:right;"><i class="bi bi-sort-numeric-down"></i></div>{%elif sortkey == -8%}<div style="float:right;"><i class="bi bi-sort-numeric-up"></i></div>{%endif%}
</th>
{%endif%}
<th>Status</th>
<th>Tags</th>
<th>Ver</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(7);">CI status</a>{%if sortkey == 7%}<div style="float:right;">↓</div>{%elif sortkey == -7%}<div style="float:right;"></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(6);">Stats</a>{%if sortkey == 6%}<div style="float:right;">↓</div>{%elif sortkey == -6%}<div style="float:right;"></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(7);">CI status</a>{%if sortkey == 7%}<div style="float:right;"><i class="bi bi-sort-down-alt"></i></div>{%elif sortkey == -7%}<div style="float:right;"><i class="bi bi-sort-up-alt"></i></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(6);">Stats</a>{%if sortkey == 6%}<div style="float:right;"><i class="bi bi-sort-numeric-down"></i></div>{%elif sortkey == -6%}<div style="float:right;"><i class="bi bi-sort-numeric-up"></i></div>{%endif%}</th>
<th>Author</th>
<th>Reviewers</th>
<th>Committer</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(3);">Num cfs</a>{%if sortkey == 3%}<div style="float:right;">↓</div>{%elif sortkey == -3%}<div style="float:right;"></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(2);">Latest mail</a>{%if sortkey == 2%}<div style="float:right;">↓</div>{%elif sortkey == -2%}<div style="float:right;"></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(3);">Num cfs</a>{%if sortkey == 3%}<div style="float:right;"><i class="bi bi-sort-numeric-down-alt"></i></div>{%elif sortkey == -3%}<div style="float:right;"><i class="bi bi-sort-numeric-up-alt"></i></div>{%endif%}</th>
<th><a href="#" style="color:#333333;" onclick="return sortpatches(2);">Latest mail</a>{%if sortkey == 2%}<div style="float:right;"><i class="bi bi-sort-down"></i></div>{%elif sortkey == -2%}<div style="float:right;"><i class="bi bi-sort-up"></i></div>{%endif%}</th>
</tr>
</thead>
<tbody>
Expand Down
84 changes: 42 additions & 42 deletions pgcommitfest/commitfest/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down