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:
2025-12-28 20:03:34 +01:00
parent c4ca57e9a0
commit bd447ae7f2
5 changed files with 70 additions and 8 deletions

View File

@@ -0,0 +1,41 @@
"""add show_in_legal to content_pages
Revision ID: ba2c0ce78396
Revises: m1b2c3d4e5f6
Create Date: 2025-12-28 20:00:24.263518
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = 'ba2c0ce78396'
down_revision: Union[str, None] = 'm1b2c3d4e5f6'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
"""Add show_in_legal column to content_pages table.
This column controls whether a page appears in the bottom bar
alongside the copyright notice (e.g., Privacy Policy, Terms of Service).
"""
op.add_column(
'content_pages',
sa.Column('show_in_legal', sa.Boolean(), nullable=True, default=False)
)
# Set default value for existing rows
op.execute("UPDATE content_pages SET show_in_legal = 0 WHERE show_in_legal IS NULL")
# Set privacy and terms pages to show in legal by default
op.execute("UPDATE content_pages SET show_in_legal = 1 WHERE slug IN ('privacy', 'terms')")
def downgrade() -> None:
"""Remove show_in_legal column from content_pages table."""
op.drop_column('content_pages', 'show_in_legal')