feat: add admin menu configuration and sidebar improvements
- Add AdminMenuConfig model for per-platform menu customization - Add menu registry for centralized menu configuration - Add my-menu-config and platform-menu-config admin pages - Update sidebar with improved layout and Alpine.js interactions - Add FrontendType enum for admin/vendor menu separation - Document self-contained module patterns in session note Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@ from sqlalchemy.orm import Session
|
||||
from app.exceptions.platform import (
|
||||
PlatformNotFoundException,
|
||||
)
|
||||
from models.database.content_page import ContentPage
|
||||
from app.modules.cms.models import ContentPage
|
||||
from models.database.platform import Platform
|
||||
from models.database.vendor_platform import VendorPlatform
|
||||
|
||||
@@ -81,6 +81,28 @@ class PlatformService:
|
||||
"""
|
||||
return db.query(Platform).filter(Platform.code == code).first()
|
||||
|
||||
@staticmethod
|
||||
def get_platform_by_id(db: Session, platform_id: int) -> Platform:
|
||||
"""
|
||||
Get platform by ID.
|
||||
|
||||
Args:
|
||||
db: Database session
|
||||
platform_id: Platform ID
|
||||
|
||||
Returns:
|
||||
Platform object
|
||||
|
||||
Raises:
|
||||
PlatformNotFoundException: If platform not found
|
||||
"""
|
||||
platform = db.query(Platform).filter(Platform.id == platform_id).first()
|
||||
|
||||
if not platform:
|
||||
raise PlatformNotFoundException(str(platform_id))
|
||||
|
||||
return platform
|
||||
|
||||
@staticmethod
|
||||
def list_platforms(
|
||||
db: Session, include_inactive: bool = False
|
||||
|
||||
Reference in New Issue
Block a user