Add Rules & Expectations feature with TV overlay and dashboard layout updates
- Add Rules & Expectations admin section with drag-to-reorder, add/edit/delete - Add Overlays card to Dashboard with Rules/Expectations toggle button (LIVE badge when active) - Add full-screen rules overlay on TV view (green theme, numbered list, tap to dismiss) - Backend: new RuleItem model, /api/rules CRUD + bulk reorder, /api/overlays WS broadcast endpoints - Schedule store handles show_rules / hide_rules WebSocket events - Rearrange Dashboard top row: TV Dashboard | 3 Strikes | Overlays (3-col, mobile stacks) - Put Today's Session and Today's Schedule side-by-side at 50/50 width (mobile stacks) - Update README with all new features, setup steps, WS events, and project structure Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
15
backend/app/models/rule.py
Normal file
15
backend/app/models/rule.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from sqlalchemy import ForeignKey, Integer, Text
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from app.models.base import Base
|
||||
|
||||
|
||||
class RuleItem(Base):
|
||||
__tablename__ = "rule_items"
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
|
||||
user_id: Mapped[int] = mapped_column(ForeignKey("users.id", ondelete="CASCADE"), nullable=False)
|
||||
text: Mapped[str] = mapped_column(Text, nullable=False)
|
||||
order_index: Mapped[int] = mapped_column(Integer, default=0)
|
||||
|
||||
user: Mapped["User"] = relationship("User") # noqa: F821
|
||||
Reference in New Issue
Block a user