Fix market and calendar URL routing

Market: blog links now use market_url('/{slug}/') instead of
events_url('/{slug}/markets/'), matching the market service's
actual route structure /<page_slug>/<market_slug>/.

Calendar: flatten route from /<slug>/calendars/<calendar_slug>/
to /<slug>/<calendar_slug>/ by changing the events app blueprint
prefix and moving listing routes to explicit /calendars/ paths.
Update all hardcoded calendar URL paths across blog and events
services (Python + Jinja templates).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 13:58:05 +00:00
parent 5c6d83f474
commit 16da08ff05
16 changed files with 40 additions and 36 deletions

View File

@@ -1250,7 +1250,7 @@ def _entry_card_html(entry, page_info: dict, pending_tickets: dict,
day_href = ""
if page_slug and entry.start_at:
day_href = events_url_fn(f"/{page_slug}/calendars/{entry.calendar_slug}/day/{entry.start_at.strftime('%Y/%-m/%-d')}/")
day_href = events_url_fn(f"/{page_slug}/{entry.calendar_slug}/day/{entry.start_at.strftime('%Y/%-m/%-d')}/")
entry_href = f"{day_href}entries/{entry.id}/" if day_href else ""
# Title (linked or plain)
@@ -1332,7 +1332,7 @@ def _entry_card_tile_html(entry, page_info: dict, pending_tickets: dict,
day_href = ""
if page_slug and entry.start_at:
day_href = events_url_fn(f"/{page_slug}/calendars/{entry.calendar_slug}/day/{entry.start_at.strftime('%Y/%-m/%-d')}/")
day_href = events_url_fn(f"/{page_slug}/{entry.calendar_slug}/day/{entry.start_at.strftime('%Y/%-m/%-d')}/")
entry_href = f"{day_href}entries/{entry.id}/" if day_href else ""
# Title
@@ -2762,7 +2762,7 @@ def render_post_nav_entries_oob(associated_entries, calendars, post) -> str:
if has_entries:
for entry in associated_entries.entries:
entry_path = (
f"/{slug}/calendars/{entry.calendar_slug}/"
f"/{slug}/{entry.calendar_slug}/"
f"{entry.start_at.year}/{entry.start_at.month}/{entry.start_at.day}/"
f"entries/{entry.id}/"
)
@@ -2781,7 +2781,7 @@ def render_post_nav_entries_oob(associated_entries, calendars, post) -> str:
if calendars:
for cal in calendars:
cs = getattr(cal, "slug", "")
local_href = events_url(f"/{slug}/calendars/{cs}/")
local_href = events_url(f"/{slug}/{cs}/")
items += sexp(
'(a :href lh :class nb'
' (i :class "fa fa-calendar" :aria-hidden "true")'