Skip to content

Added tabs for queues. #266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
51 changes: 51 additions & 0 deletions DjangoPlugin/tracdjangoplugin/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,57 @@ def get_navigation_items(self, req):
]


class CustomSubNavigationBar(Component):
"""Add queue items for the sub navigation bar."""

implements(INavigationContributor)

def get_active_navigation_item(self, req):
stage = req.args.get("stage")
has_patch = req.args.get("has_patch")
needs_better_patch = req.args.get("needs_better_patch")

if stage == "Ready+for+checkin":
return "ready_for_checkin"
if stage == "Accepted" and has_patch == "0":
return "needs_patch"
if stage == "Accepted" and has_patch == "1" and needs_better_patch == "0":
return "needs_review"
if stage == "Accepted" and has_patch == "1" and needs_better_patch == "1":
return "waiting_on_author"

return "unreviewed"

def get_navigation_items(self, req):
return [
(
"subnav",
"unreviewed",
tag.a("Unreviewed", href="/query?stage=Unreviewed&status=!closed&order=changetime&desc=1"),
),
(
"subnav",
"needs_patch",
tag.a("Needs Patch", href="/query?has_patch=0&stage=Accepted&status=!closed&order=changetime&desc=1"),
),
(
"subnav",
"needs_review",
tag.a("Needs Review", href="/query?has_patch=1&needs_better_patch=0&needs_docs=0&needs_tests=0&stage=Accepted&status=!closed&order=changetime&desc=1"),
),
(
"subnav",
"waiting_on_author",
tag.a("Waiting On Author", href="/query?has_patch=1&needs_better_patch=1&stage=Accepted&status=!closed&order=changetime&desc=1"),
),
(
"subnav",
"ready_for_checkin",
tag.a("Ready For Checkin", href="/query?stage=Ready+for+checkin&status=!closed&order=changetime&desc=1"),
),
]


class GitHubBrowserWithSVNChangesets(GitHubBrowser):
def _format_changeset_link(self, formatter, ns, chgset, label, fullmatch=None):
# Dead-simple version for SVN changesets.
Expand Down
18 changes: 18 additions & 0 deletions scss/trachacks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,24 @@ div[role="main"]{
}
}

#subnav {
@include sans-serif;

ul {
text-align: left;

li {
&.active {
background: $green-medium;
a {
background: none;
color: $white;
}
}
}
}
}

#main {
@include sans-serif;

Expand Down
7 changes: 7 additions & 0 deletions trac-env/conf/trac.ini
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ tickets.order = 2.0
timeline.order = 4.0
wiki.order = 5.0

[subnav]
unreviewed.order = 1.0
needs_patch.order = 2.0
needs_review.order = 3.0
waiting_on_author.order = 4.0
ready_for_checkin.order = 5.0

[metanav]
; The metanav is hardcoded in templates/django_theme.html
; because it was too hard to make the login plugins play nice with each other
Expand Down
3 changes: 3 additions & 0 deletions trac-env/templates/django_theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
</ul>
</div>
${navigation('mainnav')}
# if req.path_info == '/query':
${navigation('subnav')}
# endif
<div id="main" ${{'class': {
'uisymbols': req.session.get('ui.use_symbols'),
'uinohelp': req.session.get('ui.hide_help'),
Expand Down