diff --git a/apps/calendar/apps/web/src/lib/components/calendar/DayView.svelte b/apps/calendar/apps/web/src/lib/components/calendar/DayView.svelte index c0cca55b2..aaf62dd22 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/DayView.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/DayView.svelte @@ -3,6 +3,8 @@ import { eventsStore } from '$lib/stores/events.svelte'; import { calendarsStore } from '$lib/stores/calendars.svelte'; import { settingsStore } from '$lib/stores/settings.svelte'; + import { todosStore } from '$lib/stores/todos.svelte'; + import TodoRow from './TodoRow.svelte'; import { goto } from '$app/navigation'; import { format, @@ -405,6 +407,16 @@ {/if} + + {#if todosStore.serviceAvailable && todosStore.getTodosForDay(viewStore.currentDate).length > 0} +
+
+
+ +
+
+ {/if} +
@@ -533,6 +545,16 @@ cursor: pointer; } + /* Todos section */ + .todos-section { + display: flex; + border-bottom: 1px solid hsl(var(--color-border) / 0.5); + } + + .todos-content { + flex: 1; + } + /* Block-style all-day events (displayed as full-day blocks in the grid) */ .all-day-block-event { position: absolute; diff --git a/apps/calendar/apps/web/src/lib/components/calendar/MonthView.svelte b/apps/calendar/apps/web/src/lib/components/calendar/MonthView.svelte index 1227fdccf..a8b53381d 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/MonthView.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/MonthView.svelte @@ -3,6 +3,8 @@ import { eventsStore } from '$lib/stores/events.svelte'; import { calendarsStore } from '$lib/stores/calendars.svelte'; import { settingsStore } from '$lib/stores/settings.svelte'; + import { todosStore } from '$lib/stores/todos.svelte'; + import TodoDayCell from './TodoDayCell.svelte'; import { goto } from '$app/navigation'; import { format, @@ -265,6 +267,11 @@ {format(day, 'd')} + + {#if todosStore.serviceAvailable} + + {/if} +
{#each getEventsForDay(day) as event} {@const isBeingDragged = isDragging && draggedEvent?.id === event.id} diff --git a/apps/calendar/apps/web/src/lib/components/calendar/TodoDayCell.svelte b/apps/calendar/apps/web/src/lib/components/calendar/TodoDayCell.svelte new file mode 100644 index 000000000..d2e0f44fa --- /dev/null +++ b/apps/calendar/apps/web/src/lib/components/calendar/TodoDayCell.svelte @@ -0,0 +1,121 @@ + + +{#if todosForDay.length > 0} +
+ {#each visibleTodos as task (task.id)} + + {/each} + + {#if overflowCount > 0} + +{overflowCount} Aufgaben + {/if} +
+{/if} + + +{#if selectedTask} + +{/if} + + diff --git a/apps/calendar/apps/web/src/lib/components/calendar/TodoRow.svelte b/apps/calendar/apps/web/src/lib/components/calendar/TodoRow.svelte new file mode 100644 index 000000000..e18440e09 --- /dev/null +++ b/apps/calendar/apps/web/src/lib/components/calendar/TodoRow.svelte @@ -0,0 +1,169 @@ + + +{#if todosForDay.length > 0} +
+ Aufgaben: +
+ {#each visibleTodos as task (task.id)} + + + {/each} + + {#if overflowCount > 0} + + {/if} +
+
+{/if} + + +{#if selectedTask} + +{/if} + + diff --git a/apps/calendar/apps/web/src/lib/components/calendar/TodoSidebarSection.svelte b/apps/calendar/apps/web/src/lib/components/calendar/TodoSidebarSection.svelte new file mode 100644 index 000000000..2d2f28899 --- /dev/null +++ b/apps/calendar/apps/web/src/lib/components/calendar/TodoSidebarSection.svelte @@ -0,0 +1,292 @@ + + +
+ + + + + + {#if isExpanded} +
+ {#if !todosStore.serviceAvailable} +
+ + Todo-Service nicht erreichbar +
+ {:else if todosStore.loading} +
+
+ Laden... +
+ {:else if displayTodos.length === 0} +
+ + Keine offenen Aufgaben +
+ {:else} +
+ {#each displayTodos as task (task.id)} + handleTaskClick(task)} + /> + {/each} +
+ + {#if totalActiveCount > maxItems} + + {/if} + {/if} + + + {#if showQuickAdd} +
+ +
+ {/if} +
+ {/if} +
+ + +{#if selectedTask} + +{/if} + + diff --git a/apps/calendar/apps/web/src/lib/components/calendar/WeekView.svelte b/apps/calendar/apps/web/src/lib/components/calendar/WeekView.svelte index ed05c57a1..4b21db563 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/WeekView.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/WeekView.svelte @@ -3,6 +3,8 @@ import { eventsStore } from '$lib/stores/events.svelte'; import { calendarsStore } from '$lib/stores/calendars.svelte'; import { settingsStore } from '$lib/stores/settings.svelte'; + import { todosStore } from '$lib/stores/todos.svelte'; + import TodoRow from './TodoRow.svelte'; import { goto } from '$app/navigation'; import { format, @@ -499,6 +501,18 @@
{/if} + + {#if todosStore.serviceAvailable} +
+
+ {#each days as day} +
+ +
+ {/each} +
+ {/if} +
@@ -651,6 +665,18 @@ cursor: pointer; } + /* Todos row */ + .todos-row { + display: flex; + border-bottom: 1px solid hsl(var(--color-border) / 0.5); + } + + .todos-cell { + flex: 1; + border-left: 1px solid hsl(var(--color-border)); + min-height: 0; + } + /* Block-style all-day events (displayed as full-day blocks in the grid) */ .all-day-block-event { position: absolute; diff --git a/apps/calendar/apps/web/src/routes/(app)/+page.svelte b/apps/calendar/apps/web/src/routes/(app)/+page.svelte index 3918aab21..6707d9259 100644 --- a/apps/calendar/apps/web/src/routes/(app)/+page.svelte +++ b/apps/calendar/apps/web/src/routes/(app)/+page.svelte @@ -16,6 +16,7 @@ import YearView from '$lib/components/calendar/YearView.svelte'; import MiniCalendar from '$lib/components/calendar/MiniCalendar.svelte'; import CalendarSidebar from '$lib/components/calendar/CalendarSidebar.svelte'; + import TodoSidebarSection from '$lib/components/calendar/TodoSidebarSection.svelte'; import QuickEventOverlay from '$lib/components/event/QuickEventOverlay.svelte'; import EventDetailModal from '$lib/components/event/EventDetailModal.svelte'; import { CalendarViewSkeleton } from '$lib/components/skeletons'; @@ -130,6 +131,8 @@ + +