refactor(platform): make base template fully CMS-driven and platform-aware
Some checks failed
Some checks failed
Remove all hardcoded OMS-specific content from platform base template: nav links, contact info, brand name, and footer columns. Everything is now dynamic via platform model and CMS page queries. Wire up legal_pages context (privacy/terms) from database instead of hardcoded fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,7 @@ def _get_platform_context(request: Any, db: Any, platform: Any) -> dict[str, Any
|
||||
|
||||
header_pages = []
|
||||
footer_pages = []
|
||||
legal_pages = []
|
||||
|
||||
try:
|
||||
header_pages = content_page_service.list_platform_pages(
|
||||
@@ -53,8 +54,11 @@ def _get_platform_context(request: Any, db: Any, platform: Any) -> dict[str, Any
|
||||
footer_pages = content_page_service.list_platform_pages(
|
||||
db, platform_id=platform_id, footer_only=True, include_unpublished=False
|
||||
)
|
||||
legal_pages = content_page_service.list_platform_pages(
|
||||
db, platform_id=platform_id, legal_only=True, include_unpublished=False
|
||||
)
|
||||
logger.debug(
|
||||
f"[CMS] Platform context: {len(header_pages)} header, {len(footer_pages)} footer pages"
|
||||
f"[CMS] Platform context: {len(header_pages)} header, {len(footer_pages)} footer, {len(legal_pages)} legal pages"
|
||||
)
|
||||
except Exception as e:
|
||||
logger.warning(f"[CMS] Failed to load platform navigation pages: {e}")
|
||||
@@ -62,7 +66,7 @@ def _get_platform_context(request: Any, db: Any, platform: Any) -> dict[str, Any
|
||||
return {
|
||||
"header_pages": header_pages,
|
||||
"footer_pages": footer_pages,
|
||||
"legal_pages": [], # TODO: Add legal pages support if needed
|
||||
"legal_pages": legal_pages,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user