Fix: update local _nav.html to use widget-driven nav
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m5s

The blog app's local templates/_types/post/_nav.html was shadowing
the shared version due to ChoiceLoader priority. Updated local copy
to use container_nav_widgets while keeping the blog-specific admin
cog link. Removed debug logging from context processor.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-19 19:57:30 +00:00
parent f625c42118
commit 5c203cb99c
3 changed files with 4 additions and 12 deletions

View File

@@ -70,10 +70,6 @@ def register():
post_slug = (g.post_data.get("post") or {}).get("slug", "")
# Widget-driven container nav
import logging
_log = logging.getLogger("coop")
_log.warning("WIDGET DEBUG: %d nav widgets registered, post_id=%s slug=%s",
len(widgets.container_nav), db_post_id, post_slug)
container_nav_loaded = []
for w in widgets.container_nav:
try:
@@ -82,12 +78,9 @@ def register():
post_slug=post_slug,
)
has_data = any(v for v in wctx.values() if isinstance(v, list) and v)
_log.warning("WIDGET DEBUG: %s has_data=%s keys=%s", w.domain, has_data,
{k: len(v) if isinstance(v, list) else v for k, v in wctx.items()})
if has_data:
container_nav_loaded.append({"widget": w, "ctx": wctx})
except Exception as e:
_log.exception("WIDGET ERROR: %s: %s", w.domain, e)
except Exception:
ctx = {
**p_data,

2
shared

Submodule shared updated: 8b6be6da96...71729ffb28

View File

@@ -1,6 +1,6 @@
{% import 'macros/links.html' as links %}
{# Associated Entries and Calendars - vertical on mobile, horizontal with arrows on desktop #}
{% if (associated_entries and associated_entries.entries) or calendars or markets %}
{# Widget-driven container nav — entries, calendars, markets #}
{% if container_nav_widgets %}
<div class="flex flex-col sm:flex-row sm:items-center gap-2 border-r border-stone-200 mr-2 sm:max-w-2xl"
id="entries-calendars-nav-wrapper">
{% include '_types/post/admin/_nav_entries.html' %}
@@ -9,7 +9,6 @@
{# Admin link #}
{% if post and has_access('blog.post.admin.admin') %}
{% import 'macros/links.html' as links %}
{% call links.link(url_for('blog.post.admin.admin', slug=post.slug), hx_select_search, select_colours, True, aclass=styles.nav_button) %}
<i class="fa fa-cog" aria-hidden="true"></i>
{% endcall %}