From b6119b7f04b50fcc6a3a6588179e4fc16daf51cd Mon Sep 17 00:00:00 2001 From: giles Date: Sat, 28 Feb 2026 22:47:32 +0000 Subject: [PATCH] Show settings cog on root header for admin users Pass settings_url and is_admin to header-row component so the blog settings cog appears on the root header row for admin users across all services. Links to blog /admin/. Co-Authored-By: Claude Opus 4.6 --- shared/sexp/helpers.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shared/sexp/helpers.py b/shared/sexp/helpers.py index 56cda57..4fba57f 100644 --- a/shared/sexp/helpers.py +++ b/shared/sexp/helpers.py @@ -33,6 +33,9 @@ def get_asset_url(ctx: dict) -> str: def root_header_html(ctx: dict, *, oob: bool = False) -> str: """Build the root header row HTML.""" + rights = ctx.get("rights") or {} + is_admin = rights.get("admin") if isinstance(rights, dict) else getattr(rights, "admin", False) + settings_url = call_url(ctx, "blog_url", "/admin/") if is_admin else "" return render( "header-row", cart_mini_html=ctx.get("cart_mini_html", ""), @@ -42,6 +45,8 @@ def root_header_html(ctx: dict, *, oob: bool = False) -> str: nav_tree_html=ctx.get("nav_tree_html", ""), auth_menu_html=ctx.get("auth_menu_html", ""), nav_panel_html=ctx.get("nav_panel_html", ""), + settings_url=settings_url, + is_admin=is_admin, oob=oob, )