Skip to content

Commit 19b5aae

Browse files
committed
Merge remote-tracking branch 'origin' into ics
# Conflicts: # pgcommitfest/commitfest/templates/all_commitfests.html # pgcommitfest/commitfest/views.py
2 parents 338c748 + f749a37 commit 19b5aae

5 files changed

Lines changed: 15 additions & 31 deletions

File tree

‎pgcommitfest/commitfest/templates/all_commitfests.html‎

Lines changed: 0 additions & 10 deletions
This file was deleted.

‎pgcommitfest/commitfest/templates/archive.html‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<p><a href="/commitfests.ics">Subscribe to Commitfest dates (ICS)</a></p>
44
<ul>
55
{%for c in commitfests%}
6-
<li><a href="/{{c.id}}/">{{c}}</a> ({{c.statusstring}}{%if c.startdate%} - {{c.periodstring}}{%endif%})</li>
6+
<li><a href="/{{c.id}}/">{{c}}</a> ({{c.statusstring}} - {{c.periodstring}})</li>
77
{%endfor%}
88
</ul>
9+
<br/>
910
{%endblock%}

‎pgcommitfest/commitfest/templates/base.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@
4646
<a class="nav-link{% if cf and cf.is_open_draft %} active{% endif %}" href="/draft/">Draft CF</a>
4747
</li>
4848
<li class="nav-item dropdown">
49-
<a class="nav-link dropdown-toggle{% if '/activity/' in request.path or '/commitfest_history/' in request.path %} active{% endif %}" href="#" id="moreDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
49+
<a class="nav-link dropdown-toggle{% if '/activity/' in request.path or '/archive/' in request.path %} active{% endif %}" href="#" id="moreDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
5050
More
5151
</a>
5252
<ul class="dropdown-menu" aria-labelledby="moreDropdown">
5353
<li><a class="dropdown-item" href="/activity/">Activity Log</a></li>
54-
<li><a class="dropdown-item" href="/commitfest_history/">All Commitfests</a></li>
54+
<li><a class="dropdown-item" href="/archive/">All Commitfests</a></li>
5555
</ul>
5656
</li>
5757
<li class="nav-item">

‎pgcommitfest/commitfest/views.py‎

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
HttpRequest,
1010
HttpResponse,
1111
HttpResponseForbidden,
12+
HttpResponsePermanentRedirect,
1213
HttpResponseRedirect,
1314
)
1415
from django.shortcuts import get_object_or_404, render
@@ -194,12 +195,19 @@ def me_legacy_redirect(request):
194195
return HttpResponseRedirect("/#dashboard")
195196

196197

197-
def commitfest_history(request):
198+
def commitfest_history_legacy_redirect(request):
199+
# For a while the list of all commitfests lived here, next to an unsorted
200+
# duplicate at /archive/. The two were merged under /archive/ since that's
201+
# the shorter URL, but links to this one should keep working.
202+
return HttpResponsePermanentRedirect("/archive/")
203+
204+
205+
def archive(request):
198206
cfs = list(CommitFest.objects.order_by("-enddate"))
199207

200208
return render(
201209
request,
202-
"all_commitfests.html",
210+
"archive.html",
203211
{
204212
"commitfests": cfs,
205213
"title": "Commitfest history",
@@ -221,21 +229,6 @@ def help(request):
221229
)
222230

223231

224-
def archive(request):
225-
commitfests = list(CommitFest.objects.all())
226-
227-
return render(
228-
request,
229-
"archive.html",
230-
{
231-
"commitfests": commitfests,
232-
"title": "Commitfests",
233-
"header_activity": "Activity log",
234-
"header_activity_link": "activity/",
235-
},
236-
)
237-
238-
239232
def commitfests_ics(_: HttpRequest) -> HttpResponse:
240233
"""
241234
Calendar feed of all non-draft commitfests in iCalendar format (RFC 5545).

‎pgcommitfest/urls.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
re_path(r"^api/v1/commitfests/(\d+)/patches$", apiv1.commitfest_patches),
2222
re_path(r"^api/v1/patches/(\d+)/threads$", apiv1.patch_threads),
2323
re_path(r"^help/$", views.help),
24-
re_path(r"^commitfest_history/$", views.commitfest_history),
24+
re_path(r"^commitfest_history/$", views.commitfest_history_legacy_redirect),
2525
re_path(r"^me/$", views.me_legacy_redirect),
2626
re_path(r"^archive/$", views.archive),
2727
re_path(r"^commitfests\.ics$", views.commitfests_ics),

0 commit comments

Comments
 (0)