Skip to content

Commit e4c483c

Browse files
committed
Move new homepage to /me and restore original homepage
Multiple people said they preferred a list of old commitfests and a bunch of links on the homepage. So this restores the old homepage and moves the dashboard to a dedicated /me/ page (for now).
1 parent 3371395 commit e4c483c

File tree

4 files changed

+154
-101
lines changed

4 files changed

+154
-101
lines changed
Lines changed: 25 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,32 @@
11
{%extends "base.html"%}
2-
{%load commitfest %}
32
{%block contents%}
4-
<a class="btn btn-default" href="/open/new/">New patch</a>
5-
<a class="btn btn-default" href="/current/">Current commitfest</a></li>
6-
<a class="btn btn-default" href="/open/">Open commitfest</a></li>
7-
<a class="btn btn-default" href="/archive/">Archive</a></li>
8-
<button type="button" class="btn btn-default{%if has_filter%} active{%endif%}" id="filterButton" onClick="togglePatchFilterButton('filterButton', 'collapseFilters')">Search/filter</button>
9-
<form method="GET" action="/search/" class="form-inline search-bar pull-right">
3+
<p>
4+
{%if inprogresscf%}A commitfest is currently in progress: <a href="/{{inprogresscf.id}}/">{{inprogresscf}}</a>.{%endif%}
5+
</p>
6+
<p>
7+
Useful links that you can use and bookmark:
8+
</p>
9+
<ul>
10+
<li><a href="/me/">Your personal dasboard</a></li>
11+
<li><a href="/current/">All patches in the current commitfest</a></li>
12+
<li><a href="/open/">All patches in the open commitfest</a></li>
13+
<li><a href="/open/new/">Create a new commitfest entry</a></li>
14+
<li><a href="/current/?author=-3">Your entries in the current commitfest</a></li>
15+
<li><a href="/open/?author=-3">Your entries in the open commitfest</a></li>
16+
<li><a href="/current/?reviewer=-3">Entries that you are reviewing in current commitfest</a></li>
17+
</ul>
18+
<h3>Commands</h3>
19+
<form method="GET" action="/search/" class="form-inline">
1020
<div class="form-group">
11-
<input type="text" class="form-control" id="searchterm" name="searchterm" placeholder="Keyword or Message-ID">
21+
<input type="text" class="form-control" id="searchterm" name="searchterm" placeholder="Global search">
1222
</div>
1323
<button type="submit" class="btn btn-default">Search</button>
1424
</form>
15-
{%include "filter_form.html" %}
16-
{%for p in patches %}
17-
{%ifchanged p.is_open%}
18-
{%if not forloop.first%}
19-
</tbody>
20-
</table>
21-
{%endif%}
22-
<h3>{%if user.is_authenticated%}Open patches you are subscribed to{%elif p.is_open%}Active patches in the current commitfest{%else%}Closed patches in the current commitfest{%endif%}</h3>
23-
<table class="table table-striped table-bordered table-hover table-condensed">
24-
<thead>
25-
<tr>
26-
<th><a href="#" style="color:#333333;" onclick="return sortpatches(5);">Patch</a>{%if sortkey == 5%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -5%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
27-
<th><a href="#" style="color:#333333;" onclick="return sortpatches(4);">ID</a>{%if sortkey == 4%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -4%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
28-
{%if user.is_authenticated %}
29-
<th><a href="#" style="color:#333333;" onclick="return sortpatches(8);">CF</a>{%if sortkey == 8%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -8%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
30-
{%endif%}
31-
<th>Status</th>
32-
<th>Ver</th>
33-
<th><a href="#" style="color:#333333;" onclick="return sortpatches(7);">CI status</a>{%if sortkey == 7%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -7%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
34-
<th><a href="#" style="color:#333333;" onclick="return sortpatches(6);">Stats</a>{%if sortkey == 6%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -6%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
35-
<th>Author</th>
36-
<th>Reviewers</th>
37-
<th>Committer</th>
38-
<th><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>{%elif sortkey == -3%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
39-
<th><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>{%elif sortkey == -2%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
40-
</tr>
41-
</thead>
42-
<tbody>
43-
{%endifchanged%}
44-
45-
{%if grouping%}
46-
{%ifchanged p.topic%}
47-
<tr><th colspan="{%if user.is_authenticated %}12{%else%}11{%endif%}">{{p.topic}}</th></tr>
48-
{%endifchanged%}
49-
{%endif%}
50-
<tr>
51-
<td><a href="/patch/{{p.id}}/">{{p.name}}</a></td>
52-
<td>{{p.id}}</td>
53-
{%if user.is_authenticated %}
54-
<td><a href="/{{p.cf_id}}/"><span class="label label-{{p.cf_status|commitfeststatuslabel}}">{{p.cf_name}}</span></a></td>
55-
{%endif%}
56-
<td><span class="label label-{{p.status|patchstatuslabel}}">{{p.status|patchstatusstring}}</span></td>
57-
<td>{%if p.targetversion%}<span class="label label-default">{{p.targetversion}}</span>{%endif%}</td>
58-
<td class="cfbot-summary">
59-
{%with p.cfbot_results as cfb%}
60-
{%if not cfb %}
61-
<span class="label label-default">Not processed</span>
62-
{%elif p.needs_rebase_since %}
63-
<a href="{{cfb.apply_url}}" title="View git apply logs. Needs rebase since {{p.needs_rebase_since|timesince}}. {%if p.failing_since and p.failing_since != p.needs_rebase_since %}Failing since {{p.failing_since|timesince}}.{%endif%}">
64-
<span class="label label-warning">Needs rebase!</span>
65-
</a>
66-
{%else%}
67-
<a href="https://github.com/postgresql-cfbot/postgresql/compare/cf/{{p.id}}~1...cf/{{p.id}}" title="View last patch set on GitHub"><img class="github-logo" src="/media/commitfest/github-mark.svg"/></a>
68-
<a href="https://cirrus-ci.com/github/postgresql-cfbot/postgresql/cf%2F{{p.id}}"
69-
title="View CI history. {%if p.failing_since%}Failing since {{p.failing_since|timesince}}. {%endif%}{%if cfb.failed_task_names %}Failed jobs: {{cfb.failed_task_names}}{%endif%}">
70-
{%if cfb.failed > 0 or cfb.branch_status == 'failed' or cfb.branch_status == 'timeout' %}
71-
<img src="/media/commitfest/new_failure.svg"/>
72-
{%elif cfb.completed < cfb.total %}
73-
<img src="/media/commitfest/running.svg"/>
74-
{%else%}
75-
<img src="/media/commitfest/new_success.svg"/>
76-
{%endif%}
77-
<span class="run-counters">
78-
{{cfb.completed}}/{{cfb.total}}
79-
</span>
80-
</a>
81-
{%endif%}
82-
</td>
83-
<td>
84-
{%if cfb and cfb.all_additions is not none %}
85-
<span class="additions">+{{ cfb.all_additions }}</span><span class="deletions">&#8722;{{ cfb.all_deletions }}</span>
86-
{%endif%}
87-
</td>
88-
{%endwith%}
89-
<td>{{p.author_names|default:''}}</td>
90-
<td>{{p.reviewer_names|default:''}}</td>
91-
<td>{{p.committer|default:''}}</td>
92-
<td>{{p.num_cfs}}</td>
93-
<td style="white-space: nowrap;" title="{{p.lastmail}}">{%if p.lastmail %}{{p.lastmail|timesince}} ago{%endif%}</td>
94-
</tr>
95-
{%if forloop.last%}
96-
</tbody>
97-
</table>
98-
{%endif%}
99-
{%endfor%}
100-
{%endblock%}
101-
{%block extrahead%}
102-
{%include "selectize_css.html" %}
103-
{%endblock%}
104-
{%block morescript%}
105-
{%include "selectize_js.html" %}
25+
<h3>List of commitfests</h3>
26+
<ul>
27+
{%for c in commitfests%}
28+
<li><a href="/{{c.id}}/">{{c}}</a> ({{c.statusstring}}{%if c.startdate%} - {{c.periodstring}}{%endif%})</li>
29+
{%endfor%}
30+
</ul>
31+
<br/>
10632
{%endblock%}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{%extends "base.html"%}
2+
{%load commitfest %}
3+
{%block contents%}
4+
<a class="btn btn-default" href="/open/new/">New patch</a>
5+
<a class="btn btn-default" href="/current/">Current commitfest</a></li>
6+
<a class="btn btn-default" href="/open/">Open commitfest</a></li>
7+
<button type="button" class="btn btn-default{%if has_filter%} active{%endif%}" id="filterButton" onClick="togglePatchFilterButton('filterButton', 'collapseFilters')">Search/filter</button>
8+
<form method="GET" action="/search/" class="form-inline search-bar pull-right">
9+
<div class="form-group">
10+
<input type="text" class="form-control" id="searchterm" name="searchterm" placeholder="Keyword or Message-ID">
11+
</div>
12+
<button type="submit" class="btn btn-default">Search</button>
13+
</form>
14+
{%include "filter_form.html" %}
15+
{%for p in patches %}
16+
{%ifchanged p.is_open%}
17+
{%if not forloop.first%}
18+
</tbody>
19+
</table>
20+
{%endif%}
21+
<h3>{%if user.is_authenticated%}Open patches you are subscribed to{%elif p.is_open%}Active patches in the current commitfest{%else%}Closed patches in the current commitfest{%endif%}</h3>
22+
<table class="table table-striped table-bordered table-hover table-condensed">
23+
<thead>
24+
<tr>
25+
<th><a href="#" style="color:#333333;" onclick="return sortpatches(5);">Patch</a>{%if sortkey == 5%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -5%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
26+
<th><a href="#" style="color:#333333;" onclick="return sortpatches(4);">ID</a>{%if sortkey == 4%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -4%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
27+
{%if user.is_authenticated %}
28+
<th><a href="#" style="color:#333333;" onclick="return sortpatches(8);">CF</a>{%if sortkey == 8%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -8%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
29+
{%endif%}
30+
<th>Status</th>
31+
<th>Ver</th>
32+
<th><a href="#" style="color:#333333;" onclick="return sortpatches(7);">CI status</a>{%if sortkey == 7%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -7%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
33+
<th><a href="#" style="color:#333333;" onclick="return sortpatches(6);">Stats</a>{%if sortkey == 6%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-down"></i></div>{%elif sortkey == -6%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
34+
<th>Author</th>
35+
<th>Reviewers</th>
36+
<th>Committer</th>
37+
<th><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>{%elif sortkey == -3%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
38+
<th><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>{%elif sortkey == -2%}<div style="float:right;"><i class="glyphicon glyphicon-arrow-up"></i></div>{%endif%}</th>
39+
</tr>
40+
</thead>
41+
<tbody>
42+
{%endifchanged%}
43+
44+
{%if grouping%}
45+
{%ifchanged p.topic%}
46+
<tr><th colspan="{%if user.is_authenticated %}12{%else%}11{%endif%}">{{p.topic}}</th></tr>
47+
{%endifchanged%}
48+
{%endif%}
49+
<tr>
50+
<td><a href="/patch/{{p.id}}/">{{p.name}}</a></td>
51+
<td>{{p.id}}</td>
52+
{%if user.is_authenticated %}
53+
<td><a href="/{{p.cf_id}}/"><span class="label label-{{p.cf_status|commitfeststatuslabel}}">{{p.cf_name}}</span></a></td>
54+
{%endif%}
55+
<td><span class="label label-{{p.status|patchstatuslabel}}">{{p.status|patchstatusstring}}</span></td>
56+
<td>{%if p.targetversion%}<span class="label label-default">{{p.targetversion}}</span>{%endif%}</td>
57+
<td class="cfbot-summary">
58+
{%with p.cfbot_results as cfb%}
59+
{%if not cfb %}
60+
<span class="label label-default">Not processed</span>
61+
{%elif p.needs_rebase_since %}
62+
<a href="{{cfb.apply_url}}" title="View git apply logs. Needs rebase since {{p.needs_rebase_since|timesince}}. {%if p.failing_since and p.failing_since != p.needs_rebase_since %}Failing since {{p.failing_since|timesince}}.{%endif%}">
63+
<span class="label label-warning">Needs rebase!</span>
64+
</a>
65+
{%else%}
66+
<a href="https://github.com/postgresql-cfbot/postgresql/compare/cf/{{p.id}}~1...cf/{{p.id}}" title="View last patch set on GitHub"><img class="github-logo" src="/media/commitfest/github-mark.svg"/></a>
67+
<a href="https://cirrus-ci.com/github/postgresql-cfbot/postgresql/cf%2F{{p.id}}"
68+
title="View CI history. {%if p.failing_since%}Failing since {{p.failing_since|timesince}}. {%endif%}{%if cfb.failed_task_names %}Failed jobs: {{cfb.failed_task_names}}{%endif%}">
69+
{%if cfb.failed > 0 or cfb.branch_status == 'failed' or cfb.branch_status == 'timeout' %}
70+
<img src="/media/commitfest/new_failure.svg"/>
71+
{%elif cfb.completed < cfb.total %}
72+
<img src="/media/commitfest/running.svg"/>
73+
{%else%}
74+
<img src="/media/commitfest/new_success.svg"/>
75+
{%endif%}
76+
<span class="run-counters">
77+
{{cfb.completed}}/{{cfb.total}}
78+
</span>
79+
</a>
80+
{%endif%}
81+
</td>
82+
<td>
83+
{%if cfb and cfb.all_additions is not none %}
84+
<span class="additions">+{{ cfb.all_additions }}</span><span class="deletions">&#8722;{{ cfb.all_deletions }}</span>
85+
{%endif%}
86+
</td>
87+
{%endwith%}
88+
<td>{{p.author_names|default:''}}</td>
89+
<td>{{p.reviewer_names|default:''}}</td>
90+
<td>{{p.committer|default:''}}</td>
91+
<td>{{p.num_cfs}}</td>
92+
<td style="white-space: nowrap;" title="{{p.lastmail}}">{%if p.lastmail %}{{p.lastmail|timesince}} ago{%endif%}</td>
93+
</tr>
94+
{%if forloop.last%}
95+
</tbody>
96+
</table>
97+
{%endif%}
98+
{%endfor%}
99+
{%endblock%}
100+
{%block extrahead%}
101+
{%include "selectize_css.html" %}
102+
{%endblock%}
103+
{%block morescript%}
104+
{%include "selectize_js.html" %}
105+
{%endblock%}

pgcommitfest/commitfest/views.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,27 @@
4545

4646

4747
def home(request):
48+
commitfests = list(CommitFest.objects.all())
49+
opencf = next((c for c in commitfests if c.status == CommitFest.STATUS_OPEN), None)
50+
inprogresscf = next(
51+
(c for c in commitfests if c.status == CommitFest.STATUS_INPROGRESS), None
52+
)
53+
54+
return render(
55+
request,
56+
"home.html",
57+
{
58+
"commitfests": commitfests,
59+
"opencf": opencf,
60+
"inprogresscf": inprogresscf,
61+
"title": "Commitfests",
62+
"header_activity": "Activity log",
63+
"header_activity_link": "/activity/",
64+
},
65+
)
66+
67+
68+
def me(request):
4869
cfs = list(CommitFest.objects.filter(status=CommitFest.STATUS_INPROGRESS))
4970
if len(cfs) == 0:
5071
cfs = list(CommitFest.objects.filter(status=CommitFest.STATUS_OPEN))
@@ -68,10 +89,10 @@ def home(request):
6889

6990
return render(
7091
request,
71-
"home.html",
92+
"me.html",
7293
{
7394
"form": form,
74-
"title": None,
95+
"title": "Personal Dashboard",
7596
"patches": patch_list.patches,
7697
"statussummary": "",
7798
"has_filter": patch_list.has_filter,

pgcommitfest/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
urlpatterns = [
1717
re_path(r"^$", views.home),
18+
re_path(r"^me/$", views.me),
1819
re_path(r"^archive/$", views.archive),
1920
re_path(r"^activity(?P<rss>\.rss)?/", views.activity),
2021
re_path(r"^(\d+)/$", views.commitfest),

0 commit comments

Comments
 (0)