feat: add show_in_legal to admin content page editor

- Add "Show in Legal" checkbox to content page editor UI
- Update API schemas (ContentPageCreate, ContentPageUpdate, ContentPageResponse)
- Add show_in_legal parameter to service methods (create_page, update_page, etc.)
- Fix ContentPageNotFoundException to pass identifier correctly
- Fix UnauthorizedContentPageAccessException to use correct AuthorizationException API
- Add comprehensive unit tests for ContentPageService (35 tests)
- Add content page fixtures for testing
- Update CMS documentation with navigation categories diagram

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-28 20:27:20 +01:00
parent bd447ae7f2
commit 592a4fd7c2
9 changed files with 838 additions and 30 deletions

View File

@@ -172,6 +172,7 @@ class ContentPageService:
is_published: bool = False,
show_in_footer: bool = True,
show_in_header: bool = False,
show_in_legal: bool = False,
display_order: int = 0,
created_by: int | None = None,
) -> ContentPage:
@@ -191,6 +192,7 @@ class ContentPageService:
is_published: Publish immediately
show_in_footer: Show in footer navigation
show_in_header: Show in header navigation
show_in_legal: Show in legal/bottom bar navigation
display_order: Sort order
created_by: User ID who created it
@@ -210,6 +212,7 @@ class ContentPageService:
published_at=datetime.now(UTC) if is_published else None,
show_in_footer=show_in_footer,
show_in_header=show_in_header,
show_in_legal=show_in_legal,
display_order=display_order,
created_by=created_by,
updated_by=created_by,
@@ -237,6 +240,7 @@ class ContentPageService:
is_published: bool | None = None,
show_in_footer: bool | None = None,
show_in_header: bool | None = None,
show_in_legal: bool | None = None,
display_order: int | None = None,
updated_by: int | None = None,
) -> ContentPage | None:
@@ -255,6 +259,7 @@ class ContentPageService:
is_published: New publish status
show_in_footer: New footer visibility
show_in_header: New header visibility
show_in_legal: New legal bar visibility
display_order: New sort order
updated_by: User ID who updated it
@@ -288,6 +293,8 @@ class ContentPageService:
page.show_in_footer = show_in_footer
if show_in_header is not None:
page.show_in_header = show_in_header
if show_in_legal is not None:
page.show_in_legal = show_in_legal
if display_order is not None:
page.display_order = display_order
if updated_by is not None:
@@ -390,6 +397,7 @@ class ContentPageService:
is_published: bool | None = None,
show_in_footer: bool | None = None,
show_in_header: bool | None = None,
show_in_legal: bool | None = None,
display_order: int | None = None,
updated_by: int | None = None,
) -> ContentPage:
@@ -411,6 +419,7 @@ class ContentPageService:
is_published=is_published,
show_in_footer=show_in_footer,
show_in_header=show_in_header,
show_in_legal=show_in_legal,
display_order=display_order,
updated_by=updated_by,
)
@@ -443,6 +452,7 @@ class ContentPageService:
is_published: bool | None = None,
show_in_footer: bool | None = None,
show_in_header: bool | None = None,
show_in_legal: bool | None = None,
display_order: int | None = None,
updated_by: int | None = None,
) -> ContentPage:
@@ -478,6 +488,7 @@ class ContentPageService:
is_published=is_published,
show_in_footer=show_in_footer,
show_in_header=show_in_header,
show_in_legal=show_in_legal,
display_order=display_order,
updated_by=updated_by,
)