Show settings cog on root header for admin users
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m30s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m30s
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 <noreply@anthropic.com>
This commit is contained in:
@@ -33,6 +33,9 @@ def get_asset_url(ctx: dict) -> str:
|
|||||||
|
|
||||||
def root_header_html(ctx: dict, *, oob: bool = False) -> str:
|
def root_header_html(ctx: dict, *, oob: bool = False) -> str:
|
||||||
"""Build the root header row HTML."""
|
"""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(
|
return render(
|
||||||
"header-row",
|
"header-row",
|
||||||
cart_mini_html=ctx.get("cart_mini_html", ""),
|
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", ""),
|
nav_tree_html=ctx.get("nav_tree_html", ""),
|
||||||
auth_menu_html=ctx.get("auth_menu_html", ""),
|
auth_menu_html=ctx.get("auth_menu_html", ""),
|
||||||
nav_panel_html=ctx.get("nav_panel_html", ""),
|
nav_panel_html=ctx.get("nav_panel_html", ""),
|
||||||
|
settings_url=settings_url,
|
||||||
|
is_admin=is_admin,
|
||||||
oob=oob,
|
oob=oob,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user