Remove settings cog from root header bar
The settings page is accessible via its own route; no need for a persistent cog icon next to Rose Ash 2.0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,9 +33,6 @@ 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", "/settings/") 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", ""),
|
||||||
@@ -45,8 +42,6 @@ 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,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -97,8 +97,7 @@
|
|||||||
(path :d "M6 9l6 6 6-6" :fill "currentColor"))))
|
(path :d "M6 9l6 6 6-6" :fill "currentColor"))))
|
||||||
|
|
||||||
(defcomp ~header-row (&key cart-mini-html blog-url site-title app-label
|
(defcomp ~header-row (&key cart-mini-html blog-url site-title app-label
|
||||||
nav-tree-html auth-menu-html nav-panel-html
|
nav-tree-html auth-menu-html nav-panel-html oob)
|
||||||
settings-url is-admin oob)
|
|
||||||
(<>
|
(<>
|
||||||
(div :id "root-row"
|
(div :id "root-row"
|
||||||
:hx-swap-oob (if oob "outerHTML" nil)
|
:hx-swap-oob (if oob "outerHTML" nil)
|
||||||
@@ -113,10 +112,7 @@
|
|||||||
(nav :class "hidden md:flex gap-4 text-sm ml-2 justify-end items-center flex-0"
|
(nav :class "hidden md:flex gap-4 text-sm ml-2 justify-end items-center flex-0"
|
||||||
(when nav-tree-html (raw! nav-tree-html))
|
(when nav-tree-html (raw! nav-tree-html))
|
||||||
(when auth-menu-html (raw! auth-menu-html))
|
(when auth-menu-html (raw! auth-menu-html))
|
||||||
(when nav-panel-html (raw! nav-panel-html))
|
(when nav-panel-html (raw! nav-panel-html)))
|
||||||
(when (and is-admin settings-url)
|
|
||||||
(a :href settings-url :class "justify-center cursor-pointer flex flex-row items-center gap-2 rounded bg-stone-200 text-black p-3"
|
|
||||||
(i :class "fa fa-cog" :aria-hidden "true"))))
|
|
||||||
(~hamburger)))
|
(~hamburger)))
|
||||||
(div :class "block md:hidden text-md font-bold"
|
(div :class "block md:hidden text-md font-bold"
|
||||||
(when auth-menu-html (raw! auth-menu-html)))))
|
(when auth-menu-html (raw! auth-menu-html)))))
|
||||||
|
|||||||
Reference in New Issue
Block a user