This is an automated email from the ASF dual-hosted git repository. wave pushed a commit to branch adjust-topnav-menu-tests in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
commit e62fe2c2134ea32f1517395ef18b0d666bf93d7b Author: Dave Fisher <[email protected]> AuthorDate: Thu Mar 5 14:27:37 2026 -0800 Adjust topnav menu if ALLOW_TESTS --- 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..a5df9cf3 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": True if config.get().ALLOW_TESTS else False, "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]
