This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
The following commit(s) were added to refs/heads/main by this push:
new 1105ff5d Adjust topnav menu if ALLOW_TESTS
1105ff5d is described below
commit 1105ff5d90a9d60ca1433129b5c15102edd57bdb
Author: Dave Fisher <[email protected]>
AuthorDate: Fri Mar 6 06:19:21 2026 -0800
Adjust topnav menu if ALLOW_TESTS
* Adjust topnav menu if ALLOW_TESTS (#830)
* OF - not needed
---
atr/server.py | 1 +
atr/templates/includes/topnav.html | 22 ++++++++++++++--------
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/atr/server.py b/atr/server.py
index e77a86b7..594c80f6 100644
--- a/atr/server.py
+++ b/atr/server.py
@@ -251,6 +251,7 @@ def _app_setup_context(app: base.QuartApp) -> None:
"is_admin_fn": user.is_admin,
"is_viewing_as_admin_fn": util.is_user_viewing_as_admin,
"is_committee_member_fn": user.is_committee_member,
+ "is_test_mode": config.get().ALLOW_TESTS,
"post": post,
"static_url": util.static_url,
"unfinished_releases_fn": interaction.unfinished_releases,
diff --git a/atr/templates/includes/topnav.html
b/atr/templates/includes/topnav.html
index c021a261..002b591e 100644
--- a/atr/templates/includes/topnav.html
+++ b/atr/templates/includes/topnav.html
@@ -95,9 +95,13 @@
Committees</a>
</li>
<li>
- {# This path is handled by the frontend proxy server #}
- {# https://djlint.com/docs/ignoring-code/ #}
- {# djlint:off J018 #} <a class="dropdown-item" href="/downloads/"><i
class="bi bi-download"></i> Downloads</a> {# djlint:on #}
+ {% if is_test_mode %}
+ <a class="dropdown-item" href="/published/"><i class="bi
bi-download"></i> Downloads</a>
+ {% else %}
+ {# This path is handled by the frontend proxy server #}
+ {# https://djlint.com/docs/ignoring-code/ #}
+ {# djlint:off J018 #} <a class="dropdown-item"
href="/downloads/"><i class="bi bi-download"></i> Downloads</a> {# djlint:on #}
+ {% endif %}
</li>
</ul>
</li>
@@ -230,11 +234,13 @@
href="{{ as_url(admin.toggle_view_get) }}"
{% if request.endpoint == 'atr_admin_toggle_view_get'
%}class="active"{% endif %}><i class="bi bi-person-badge"></i> Toggle admin
view</a>
</li>
- <li>
- <a class="dropdown-item"
- href="{{ as_url(admin.validate_jwt_get) }}"
- {% if request.endpoint == 'atr_admin_validate_jwt_get'
%}class="active"{% endif %}><i class="bi bi-check-circle"></i> Validate JWT</a>
- </li>
+ {% if is_test_mode %}
+ <li>
+ <a class="dropdown-item"
+ href="{{ as_url(admin.validate_jwt_get) }}"
+ {% if request.endpoint == 'atr_admin_validate_jwt_get'
%}class="active"{% endif %}><i class="bi bi-check-circle"></i> Validate JWT</a>
+ </li>
+ {% endif %}
<li>
<hr class="dropdown-divider" />
</li>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]