Add Done button, tablet controls, super admin management, midnight strike reset, and activity log improvements
- Done button snaps block to full duration, marks complete, logs "Marked Done by User"; Reset after Done fully un-completes the block - Session action buttons stretch full-width and double height for tablet tapping - Super admin: reset password, disable/enable accounts, delete user (with cascade), last active date per user's timezone - Disabled account login returns specific error message instead of generic invalid credentials - Users can change own password from Admin → Settings - Strikes reset automatically at midnight in user's configured timezone (lazy reset on page load) - Break timer state fully restored when navigating away and back to dashboard - Timer no longer auto-starts on navigation if it wasn't running before - Implicit pause guard: no duplicate pause events when switching already-paused blocks or starting a break - Block selection events removed from activity log; all event types have human-readable labels - House emoji favicon via inline SVG data URI - README updated to reflect all changes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from datetime import date
|
||||
from sqlalchemy import String, Boolean, ForeignKey, Date, Integer
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
from typing import Optional
|
||||
from app.models.base import Base, TimestampMixin
|
||||
|
||||
|
||||
@@ -14,6 +15,7 @@ class Child(TimestampMixin, Base):
|
||||
is_active: Mapped[bool] = mapped_column(Boolean, default=True)
|
||||
color: Mapped[str] = mapped_column(String(7), default="#4F46E5") # hex color for UI
|
||||
strikes: Mapped[int] = mapped_column(Integer, default=0, nullable=False)
|
||||
strikes_last_reset: Mapped[Optional[date]] = mapped_column(Date, nullable=True, default=None)
|
||||
|
||||
user: Mapped["User"] = relationship("User", back_populates="children") # noqa: F821
|
||||
daily_sessions: Mapped[list["DailySession"]] = relationship( # noqa: F821
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from sqlalchemy import String, Boolean
|
||||
from datetime import datetime
|
||||
from sqlalchemy import String, Boolean, DateTime
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
from app.models.base import Base, TimestampMixin
|
||||
|
||||
@@ -13,6 +14,7 @@ class User(TimestampMixin, Base):
|
||||
is_active: Mapped[bool] = mapped_column(Boolean, default=True)
|
||||
is_admin: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||
timezone: Mapped[str] = mapped_column(String(64), nullable=False, default="UTC")
|
||||
last_active_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=True, default=None)
|
||||
|
||||
children: Mapped[list["Child"]] = relationship("Child", back_populates="user") # noqa: F821
|
||||
subjects: Mapped[list["Subject"]] = relationship("Subject", back_populates="user") # noqa: F821
|
||||
|
||||
Reference in New Issue
Block a user