feat: Monatswechsel-Markierung in Monatsansicht
In der rolling Monatsansicht wird jetzt am Monatswechsel: - eine dickere Trennlinie gezeichnet (links bei Wechsel mitten in Zeile, oben bei Zeilenstart) - das 3-Buchstaben-Monatskürzel (z.B. JUL, AUG) groß über der "1" angezeigt Beide Farben (Linie und Kürzel) sind in den Einstellungen unter "Farben" individuell anpassbar (Default: #7090c0). Backend: neue UserSettings-Felder month_divider_color und month_label_color mit Migration. Frontend: applyTheme setzt entsprechende CSS-Variablen.
This commit is contained in:
@@ -97,6 +97,18 @@ def _migrate():
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
conn.execute(text("ALTER TABLE user_settings ADD COLUMN month_divider_color VARCHAR(7) DEFAULT '#7090c0'"))
|
||||
conn.commit()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
conn.execute(text("ALTER TABLE user_settings ADD COLUMN month_label_color VARCHAR(7) DEFAULT '#7090c0'"))
|
||||
conn.commit()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
_migrate()
|
||||
|
||||
app = FastAPI(title="Calendarr", docs_url=None, redoc_url=None)
|
||||
|
||||
@@ -82,6 +82,8 @@ class UserSettings(Base):
|
||||
line_contrast = Column(Integer, default=3)
|
||||
hour_height = Column(Integer, default=60)
|
||||
language = Column(String(5), default="de")
|
||||
month_divider_color = Column(String(7), default="#7090c0")
|
||||
month_label_color = Column(String(7), default="#7090c0")
|
||||
|
||||
user = relationship("User", back_populates="settings")
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ class SettingsUpdate(BaseModel):
|
||||
line_contrast: Optional[int] = None
|
||||
hour_height: Optional[int] = None
|
||||
language: Optional[str] = None
|
||||
month_divider_color: Optional[str] = None
|
||||
month_label_color: Optional[str] = None
|
||||
|
||||
|
||||
def _settings_dict(s: models.UserSettings) -> dict:
|
||||
@@ -36,6 +38,8 @@ def _settings_dict(s: models.UserSettings) -> dict:
|
||||
"line_contrast": s.line_contrast or 3,
|
||||
"hour_height": s.hour_height or 60,
|
||||
"language": s.language or "de",
|
||||
"month_divider_color": s.month_divider_color or "#7090c0",
|
||||
"month_label_color": s.month_label_color or "#7090c0",
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user