Einstellungen: Vollbild-Seite, Kontrast, Stundenhöhe, KW-Anzeige
- Einstellungen von Modal-Popup auf Vollbild-Seite mit Seitennavigation umgestellt - Schriftkontrast (4 Stufen) und Linienkontrast (4 Stufen) pro Benutzer gespeichert - Stundenhöhe (40/60/80/100px) in Wochen-/Tagesansicht per Einstellung steuerbar - Kalenderwoche in Monats- und Wochenansicht grösser dargestellt - CSS-Variable --hour-h für dynamische Zeitraster-Höhe in week.js und app.css - Backend: neue Felder text_contrast, line_contrast, hour_height in UserSettings
This commit is contained in:
@@ -43,6 +43,21 @@ def _migrate():
|
||||
logging.info("Migration: added sidebar_hidden to google_calendars")
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
conn.execute(text("ALTER TABLE user_settings ADD COLUMN text_contrast INTEGER DEFAULT 3"))
|
||||
conn.commit()
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
conn.execute(text("ALTER TABLE user_settings ADD COLUMN line_contrast INTEGER DEFAULT 3"))
|
||||
conn.commit()
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
conn.execute(text("ALTER TABLE user_settings ADD COLUMN hour_height INTEGER DEFAULT 60"))
|
||||
conn.commit()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
_migrate()
|
||||
|
||||
|
||||
@@ -75,6 +75,9 @@ class UserSettings(Base):
|
||||
accent_color = Column(String(7), default="#ea4335")
|
||||
today_color = Column(String(7), default="#4285f4")
|
||||
dim_past_events = Column(Boolean, default=False)
|
||||
text_contrast = Column(Integer, default=3)
|
||||
line_contrast = Column(Integer, default=3)
|
||||
hour_height = Column(Integer, default=60)
|
||||
|
||||
user = relationship("User", back_populates="settings")
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ class SettingsUpdate(BaseModel):
|
||||
accent_color: Optional[str] = None
|
||||
today_color: Optional[str] = None
|
||||
dim_past_events: Optional[bool] = None
|
||||
text_contrast: Optional[int] = None
|
||||
line_contrast: Optional[int] = None
|
||||
hour_height: Optional[int] = None
|
||||
|
||||
|
||||
def _settings_dict(s: models.UserSettings) -> dict:
|
||||
@@ -28,6 +31,9 @@ def _settings_dict(s: models.UserSettings) -> dict:
|
||||
"accent_color": s.accent_color,
|
||||
"today_color": s.today_color,
|
||||
"dim_past_events": s.dim_past_events,
|
||||
"text_contrast": s.text_contrast or 3,
|
||||
"line_contrast": s.line_contrast or 3,
|
||||
"hour_height": s.hour_height or 60,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user