Week view flexibility: configurable day count, layout, and a CalDAV task list
Build and push server image / build-and-push (push) Successful in 52s
Build and push server image / build-and-push (push) Successful in 52s
- Day count (2-10, was fixed at 7) -- 5 days trims the weekend clutter without losing the grid format. - Layout choice: days side by side (original behavior) or stacked vertically as full agenda-style sections (reuses _draw_agenda_day, same approach _build_today_tomorrow already used for a fixed 2 days). - Optional task list (CalDAV VTODO collections only -- a plain ICS subscription doesn't meaningfully have one) that takes the space of one day slot instead of adding an extra one. Same owner-controls- their-own-data permission split as calendar sources: only the calendar's owner can point a frame's task list at it, but anyone linked to the frame can clear it. Browse-offset paging now moves by N days (was hardcoded to weeks), identical to the old behavior when days=7. Changing the day count resets the browse offset, same reasoning as changing views already did.
This commit is contained in:
@@ -172,6 +172,23 @@ def _migration_11(conn) -> None:
|
||||
conn.execute(text("ALTER TABLE frame_calendars ADD COLUMN color_index INTEGER"))
|
||||
|
||||
|
||||
def _migration_12(conn) -> None:
|
||||
"""Week view flexibility: a configurable day count (2-10, default 7
|
||||
-- the original fixed behavior) and a horizontal/vertical layout
|
||||
choice, plus an optional CalDAV task list that takes the space of
|
||||
one day slot when enabled (see calendar_render.py's _build_week/
|
||||
_draw_tasks). Every new column has a behavior-preserving default --
|
||||
no existing frame's render changes until its Calendar tab touches
|
||||
one of these."""
|
||||
conn.execute(text("ALTER TABLE frames ADD COLUMN calendar_week_days INTEGER NOT NULL DEFAULT 7"))
|
||||
conn.execute(text("ALTER TABLE frames ADD COLUMN calendar_week_layout TEXT NOT NULL DEFAULT 'horizontal'"))
|
||||
conn.execute(text("ALTER TABLE frames ADD COLUMN calendar_tasks_enabled INTEGER NOT NULL DEFAULT 0"))
|
||||
conn.execute(text("ALTER TABLE frames ADD COLUMN calendar_tasks_user_id INTEGER REFERENCES users(id) ON DELETE SET NULL"))
|
||||
conn.execute(text("ALTER TABLE frames ADD COLUMN calendar_tasks_calendar_key TEXT"))
|
||||
conn.execute(text("ALTER TABLE frames ADD COLUMN calendar_tasks_checked_at REAL NOT NULL DEFAULT 0.0"))
|
||||
conn.execute(text("ALTER TABLE frames ADD COLUMN calendar_tasks_cached TEXT"))
|
||||
|
||||
|
||||
MIGRATIONS = [
|
||||
(1, _migration_1),
|
||||
(2, _migration_2),
|
||||
@@ -184,6 +201,7 @@ MIGRATIONS = [
|
||||
(9, _migration_9),
|
||||
(10, _migration_10),
|
||||
(11, _migration_11),
|
||||
(12, _migration_12),
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user