feat: add show_in_legal category for bottom bar CMS pages
Add third placement category for content pages that appear in the bottom bar alongside the copyright notice (Privacy Policy, Terms, etc.): Model changes: - Add show_in_legal boolean field to ContentPage model - Add to to_dict() serialization Service changes: - Add legal_only filter to list_pages_for_vendor() Platform changes: - Fetch legal_pages in get_platform_context() - Update base.html to render legal_pages dynamically - Fallback to hardcoded links if no CMS pages configured Migration: - Add column with default=False - Auto-set show_in_legal=True for privacy and terms pages Categories: - show_in_header: Top navigation - show_in_footer: Quick Links column - show_in_legal: Bottom bar with copyright (NEW) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -47,9 +47,10 @@ def get_platform_context(request: Request, db: Session) -> dict:
|
||||
# Add i18n globals (_, t, current_language, SUPPORTED_LANGUAGES, etc.)
|
||||
context.update(i18n_globals)
|
||||
|
||||
# Load CMS pages for header and footer navigation
|
||||
# Load CMS pages for header, footer, and legal navigation
|
||||
header_pages = []
|
||||
footer_pages = []
|
||||
legal_pages = []
|
||||
try:
|
||||
# Platform pages have vendor_id=None
|
||||
header_pages = content_page_service.list_pages_for_vendor(
|
||||
@@ -58,14 +59,18 @@ def get_platform_context(request: Request, db: Session) -> dict:
|
||||
footer_pages = content_page_service.list_pages_for_vendor(
|
||||
db, vendor_id=None, footer_only=True, include_unpublished=False
|
||||
)
|
||||
legal_pages = content_page_service.list_pages_for_vendor(
|
||||
db, vendor_id=None, legal_only=True, include_unpublished=False
|
||||
)
|
||||
logger.debug(
|
||||
f"Loaded CMS pages: {len(header_pages)} header, {len(footer_pages)} footer"
|
||||
f"Loaded CMS pages: {len(header_pages)} header, {len(footer_pages)} footer, {len(legal_pages)} legal"
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to load CMS navigation pages: {e}")
|
||||
|
||||
context["header_pages"] = header_pages
|
||||
context["footer_pages"] = footer_pages
|
||||
context["legal_pages"] = legal_pages
|
||||
|
||||
return context
|
||||
|
||||
|
||||
Reference in New Issue
Block a user