Skip to content

Commit 93cb2a9

Browse files
committed
Merge branch 'postgres-17' into preview
2 parents 6d5a9c2 + 89eb973 commit 93cb2a9

File tree

8 files changed

+107
-4
lines changed

8 files changed

+107
-4
lines changed

.TRACFREEZE.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ trac.wiki.web_api.wikirenderer
102102
trac.wiki.web_ui.defaultwikipolicy
103103
tracdjangoplugin.plugins.customnavigationbar
104104
tracdjangoplugin.plugins.customnewticket
105+
tracdjangoplugin.plugins.customsubnavigationbar
105106
tracdjangoplugin.plugins.customtheme
106107
tracdjangoplugin.plugins.customwikimodule
107108
tracdjangoplugin.plugins.githubbrowserwithsvnchangesets

DjangoPlugin/tracdjangoplugin/plugins.py

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,84 @@ def get_navigation_items(self, req):
8888
]
8989

9090

91+
class CustomSubNavigationBar(Component):
92+
"""Add queue items for the sub navigation bar."""
93+
94+
implements(INavigationContributor)
95+
96+
queues = [
97+
{
98+
"name": "unreviewed",
99+
"label": "Needs Triage",
100+
"params": "stage=Unreviewed&status=!closed&order=changetime&desc=1",
101+
},
102+
{
103+
"name": "needs_patch",
104+
"label": "Needs Patch",
105+
"params": "has_patch=0&stage=Accepted&status=!closed&order=changetime&desc=1",
106+
},
107+
{
108+
"name": "needs_pr_review",
109+
"label": "Needs PR Review",
110+
"params": (
111+
"has_patch=1&needs_better_patch=0&needs_docs=0&needs_tests=0&stage=Accepted"
112+
"&status=!closed&order=changetime&desc=1"
113+
),
114+
},
115+
{
116+
"name": "waiting_on_author",
117+
"label": "Waiting On Author",
118+
"params": (
119+
"has_patch=1&needs_better_patch=1&stage=Accepted&status=assigned&status=new"
120+
"&or&has_patch=1&needs_docs=1&stage=Accepted&status=assigned&status=new"
121+
"&or&has_patch=1&needs_tests=1&stage=Accepted&status=assigned&status=new"
122+
"&order=changetime&desc=1"
123+
),
124+
},
125+
{
126+
"name": "ready_for_checkin",
127+
"label": "Ready For Checkin",
128+
"params": "stage=Ready+for+checkin&status=!closed&order=changetime&desc=1",
129+
},
130+
]
131+
132+
def get_active_navigation_item(self, req):
133+
stage = req.args.get("stage")
134+
135+
if stage == "Unreviewed":
136+
return "unreviewed"
137+
if stage == "Ready for checkin":
138+
return "ready_for_checkin"
139+
if stage == "Accepted":
140+
if req.query_string == self.queues[1]["params"]:
141+
return "needs_patch"
142+
elif req.query_string == self.queues[2]["params"]:
143+
return "needs_pr_review"
144+
elif req.query_string == self.queues[3]["params"]:
145+
return "waiting_on_author"
146+
147+
return ""
148+
149+
def _get_active_class(self, active_item, subnav_name):
150+
return "active" if active_item == subnav_name else None
151+
152+
def get_navigation_items(self, req):
153+
if req.path_info.startswith("/query"):
154+
active_item = self.get_active_navigation_item(req)
155+
return [
156+
(
157+
"subnav",
158+
queue["name"],
159+
tag.a(
160+
queue["label"],
161+
href="/query?" + queue["params"],
162+
class_=self._get_active_class(active_item, queue["name"]),
163+
),
164+
)
165+
for queue in self.queues
166+
]
167+
168+
91169
class GitHubBrowserWithSVNChangesets(GitHubBrowser):
92170
def _format_changeset_link(self, formatter, ns, chgset, label, fullmatch=None):
93171
# Dead-simple version for SVN changesets.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN apt-get update \
1818
postgresql-common \
1919
subversion \
2020
&& /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y\
21-
&& apt-get install --assume-yes --no-install-recommends postgresql-client-14\
21+
&& apt-get install --assume-yes --no-install-recommends postgresql-client-17\
2222
&& apt-get purge --assume-yes --auto-remove gnupg\
2323
&& apt-get distclean
2424

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ services:
2323
depends_on:
2424
- db
2525
db:
26-
image: postgres:14-alpine
26+
image: postgres:17-alpine
2727
ports:
2828
# Port 5435 might be handy for loading trac.sql from the djangoproject.com repo
2929
- 5435:5432

scss/trachacks.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,22 @@ div[role="main"]{
330330
}
331331
}
332332

333+
#subnav {
334+
@include sans-serif;
335+
336+
ul {
337+
text-align: left;
338+
339+
li {
340+
a {
341+
&.active {
342+
font-weight: bold;
343+
}
344+
}
345+
}
346+
}
347+
}
348+
333349
#main {
334350
@include sans-serif;
335351

trac-env/conf/trac.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ tickets.order = 2.0
8484
timeline.order = 4.0
8585
wiki.order = 5.0
8686

87+
[subnav]
88+
unreviewed.order = 1.0
89+
needs_patch.order = 2.0
90+
needs_pr_review.order = 3.0
91+
waiting_on_author.order = 4.0
92+
ready_for_checkin.order = 5.0
93+
8794
[metanav]
8895
; The metanav is hardcoded in templates/django_theme.html
8996
; because it was too hard to make the login plugins play nice with each other

trac-env/templates/django_theme.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
</ul>
3535
</div>
3636
${navigation('mainnav')}
37+
${navigation('subnav')}
3738
<div id="main" ${{'class': {
3839
'uisymbols': req.session.get('ui.use_symbols'),
3940
'uinohelp': req.session.get('ui.hide_help'),

trac-env/templates/site_footer.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ <h2>Learn More</h2>
88
<ul>
99
<li><a href="https://www.djangoproject.com/overview/">About Django</a></li>
1010
<li><a href="https://www.djangoproject.com/start/">Getting Started with Django</a></li>
11-
<li><a href="https://docs.djangoproject.com/en/dev/internals/organization/">Team Organization</a></li>
11+
<li><a href="https://www.djangoproject.com/foundation/teams/">Team Organization</a></li>
1212
<li><a href="https://www.djangoproject.com/foundation/">Django Software Foundation</a></li>
1313
<li><a href="https://www.djangoproject.com/conduct/">Code of Conduct</a></li>
1414
<li><a href="https://www.djangoproject.com/diversity/">Diversity Statement</a></li>
@@ -71,7 +71,7 @@ <h2>Support Us</h2>
7171
<li class="design"><span>Design by</span> <a class="threespot" href="http://www.threespot.com">Threespot</a> <span class="ampersand">&amp;</span> <a class="andrevv" href="http://andrevv.com/"></a></li>
7272
</ul>
7373
<p class="copyright">&copy; 2005-${date.today().year}
74-
<a href="https://djangoproject.com/foundation/"> Django SoftwareFoundation</a>
74+
<a href="https://djangoproject.com/foundation/"> Django Software Foundation</a>
7575
unless otherwise noted. Django is a
7676
<a href="https://djangoproject.com/trademarks/">registered trademark</a>
7777
of the Django Software Foundation.

0 commit comments

Comments
 (0)