Neuer Stundenplan mit "Heute"-Standardansicht (Tagesliste unten angedockt, gruppenübergreifendes Wochenraster mit Fach/Klasse/Raum/Thema, Vor-/Zurück- Navigation zwischen Kalenderwochen) und separatem Bearbeiten-Raster für die wöchentliche Zuordnung. Badges für Ferien-/Klausur-Nähe und ausgegraute Ferientage direkt im Plan statt einer separaten Liste. Ferien-/Feiertage- Pflege (Bundesland, Schulferien) sitzt jetzt in den Einstellungen statt im Stundenplan selbst. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
211 lines
13 KiB
XML
211 lines
13 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Planning"
|
||
xmlns:shared="clr-namespace:LehrerApp.Desktop.Views.Shared"
|
||
x:Class="LehrerApp.Desktop.Views.Planning.TimetableView"
|
||
x:DataType="vm:TimetableViewModel">
|
||
|
||
<UserControl.Styles>
|
||
<Style Selector="Border.timetablecell">
|
||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundBaseLowBrush}"/>
|
||
</Style>
|
||
<Style Selector="Border.timetablecell.assigned">
|
||
<Setter Property="Background" Value="Transparent"/>
|
||
</Style>
|
||
<Style Selector="Border.weekheader.today">
|
||
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}"/>
|
||
</Style>
|
||
</UserControl.Styles>
|
||
|
||
<Grid RowDefinitions="Auto,*">
|
||
<shared:PageHeader Grid.Row="0" Margin="32,28,32,0" Title="Stundenplan"
|
||
Subtitle="Wiederkehrendes wöchentliches Muster, keine konkreten Termine"/>
|
||
|
||
<TabbedPage Grid.Row="1" TabPlacement="Top" SelectedIndex="{Binding ActiveTabIndex}">
|
||
|
||
<!-- Tab: Heute (Standardansicht) -->
|
||
<ContentPage Header="Heute">
|
||
<DockPanel Margin="32,20,32,20">
|
||
|
||
<!-- Unten angedockt: heutige Stunden im Detail -->
|
||
<Border DockPanel.Dock="Bottom" Margin="0,16,0,0"
|
||
Background="{DynamicResource SystemControlBackgroundAltHighBrush}"
|
||
CornerRadius="8" Padding="16" MaxHeight="240">
|
||
<DockPanel>
|
||
<TextBlock DockPanel.Dock="Top" Text="{Binding TodayLabel}" FontSize="15" FontWeight="SemiBold" Margin="0,0,0,8"/>
|
||
<ScrollViewer>
|
||
<ItemsControl ItemsSource="{Binding TodayItems}">
|
||
<ItemsControl.ItemTemplate>
|
||
<DataTemplate x:DataType="vm:TodayLessonItem">
|
||
<Border BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
|
||
BorderThickness="0,0,0,1" Padding="0,8">
|
||
<Grid ColumnDefinitions="6,Auto,*,Auto">
|
||
<Rectangle Grid.Column="0" Fill="{Binding ColorHex}" Width="5" HorizontalAlignment="Left"/>
|
||
<TextBlock Grid.Column="1" Text="{Binding PeriodNumber}" FontSize="17" FontWeight="Bold"
|
||
Width="30" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,0"/>
|
||
<StackPanel Grid.Column="2" Spacing="2">
|
||
<TextBlock Text="{Binding GroupName}" FontSize="14" FontWeight="SemiBold"/>
|
||
<TextBlock FontSize="11" Opacity="0.6" IsVisible="{Binding HasRoom}">
|
||
<Run Text="Raum "/><Run Text="{Binding Room}"/>
|
||
</TextBlock>
|
||
<TextBlock Text="{Binding LessonTopic}" FontSize="11" Opacity="0.75"
|
||
TextWrapping="Wrap" IsVisible="{Binding HasLessonTopic}"/>
|
||
<TextBlock Text="{Binding ExamTitle}" FontSize="11" Foreground="#D85A30" FontWeight="SemiBold"
|
||
IsVisible="{Binding HasExam}"/>
|
||
</StackPanel>
|
||
<Button Grid.Column="3" Content="Zur Lerngruppe" FontSize="11" Padding="9,4"
|
||
VerticalAlignment="Center"
|
||
Command="{Binding $parent[ItemsControl].((vm:TimetableViewModel)DataContext).OpenGroupCommand}"
|
||
CommandParameter="{Binding GroupId}"/>
|
||
</Grid>
|
||
</Border>
|
||
</DataTemplate>
|
||
</ItemsControl.ItemTemplate>
|
||
</ItemsControl>
|
||
</ScrollViewer>
|
||
</DockPanel>
|
||
</Border>
|
||
<TextBlock DockPanel.Dock="Bottom" Text="Heute sind keine Stunden im Stundenplan eingetragen." Classes="emptyhint"
|
||
IsVisible="{Binding !TodayItems.Count}" Margin="0,8,0,0"/>
|
||
|
||
<!-- Rest: Wochenüberblick (nicht editierbar) -->
|
||
<ScrollViewer>
|
||
<StackPanel Spacing="14">
|
||
|
||
<Grid ColumnDefinitions="Auto,Auto,*,Auto,Auto">
|
||
<Button Grid.Column="0" Content="‹" FontWeight="Bold" Padding="10,4"
|
||
Command="{Binding PreviousWeekCommand}" ToolTip.Tip="Vorherige Woche"/>
|
||
<Button Grid.Column="1" Content="›" FontWeight="Bold" Padding="10,4" Margin="4,0,0,0"
|
||
Command="{Binding NextWeekCommand}" ToolTip.Tip="Nächste Woche"/>
|
||
<TextBlock Grid.Column="2" FontSize="16" FontWeight="SemiBold"
|
||
VerticalAlignment="Center" Margin="12,0,0,0">
|
||
<Run Text="Woche "/><Run Text="{Binding WeekRangeLabel}"/>
|
||
</TextBlock>
|
||
<Button Grid.Column="3" Content="Diese Woche" Margin="0,0,8,0"
|
||
Command="{Binding CurrentWeekCommand}" IsVisible="{Binding !IsCurrentWeek}"/>
|
||
<Button Grid.Column="4" Content="Stundenplan bearbeiten" Command="{Binding ShowEditorCommand}"/>
|
||
</Grid>
|
||
|
||
<ItemsControl ItemsSource="{Binding WeekItems}">
|
||
<ItemsControl.ItemsPanel>
|
||
<ItemsPanelTemplate><UniformGrid Columns="6"/></ItemsPanelTemplate>
|
||
</ItemsControl.ItemsPanel>
|
||
<ItemsControl.ItemTemplate>
|
||
<DataTemplate x:DataType="vm:WeekCellItem">
|
||
<Grid Margin="2" MinHeight="76">
|
||
<Border Classes="weekheader" Classes.today="{Binding IsToday}" CornerRadius="4"
|
||
IsVisible="{Binding IsHeader}">
|
||
<TextBlock Text="{Binding Text}" FontWeight="SemiBold" FontSize="12" Opacity="0.75"
|
||
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="4"/>
|
||
</Border>
|
||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsPeriodLabel}"
|
||
FontWeight="SemiBold" FontSize="13"
|
||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||
<Border Classes="timetablecell" Classes.assigned="{Binding IsAssigned}"
|
||
CornerRadius="6" IsVisible="{Binding IsSlotCell}">
|
||
<Button Background="{Binding ColorHex}" IsVisible="{Binding IsAssigned}"
|
||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||
HorizontalContentAlignment="Stretch" CornerRadius="6" Padding="6"
|
||
Command="{Binding $parent[ItemsControl].((vm:TimetableViewModel)DataContext).OpenGroupCommand}"
|
||
CommandParameter="{Binding GroupId}">
|
||
<StackPanel Spacing="1">
|
||
<TextBlock FontSize="11" FontWeight="Bold" Foreground="White" TextWrapping="Wrap">
|
||
<Run Text="{Binding SubjectLabel}"/><Run Text=" · "/><Run Text="{Binding GroupName}"/>
|
||
</TextBlock>
|
||
<TextBlock Text="{Binding Room}" FontSize="10" Foreground="White" Opacity="0.9"
|
||
IsVisible="{Binding HasRoom}"/>
|
||
<TextBlock Text="{Binding Topic}" FontSize="10" Foreground="White" Opacity="0.8"
|
||
TextWrapping="Wrap" IsVisible="{Binding HasTopic}"/>
|
||
<TextBlock Text="Ferien" FontSize="10" Foreground="White" FontWeight="SemiBold"
|
||
Opacity="0.9" IsVisible="{Binding IsHoliday}" Margin="0,2,0,0"/>
|
||
<StackPanel Orientation="Horizontal" Spacing="3" Margin="0,2,0,0"
|
||
IsVisible="{Binding !IsHoliday}">
|
||
<Border Background="#B71C1C" CornerRadius="7" Padding="4,0" IsVisible="{Binding HasHolidayBadge}">
|
||
<TextBlock Text="{Binding HolidayBadge}" FontSize="9" FontWeight="Bold" Foreground="White"/>
|
||
</Border>
|
||
<TextBlock Text="📝" FontSize="11" IsVisible="{Binding HasExam}" ToolTip.Tip="Klausur"/>
|
||
<TextBlock Text="⏰" FontSize="11" IsVisible="{Binding IsLastBeforeExam}" ToolTip.Tip="Letzte Stunde vor der Klausur"/>
|
||
<TextBlock Text="🧪" FontSize="11" IsVisible="{Binding HasExperiment}" ToolTip.Tip="Experiment geplant"/>
|
||
</StackPanel>
|
||
</StackPanel>
|
||
</Button>
|
||
</Border>
|
||
</Grid>
|
||
</DataTemplate>
|
||
</ItemsControl.ItemTemplate>
|
||
</ItemsControl>
|
||
|
||
<Border Background="{DynamicResource SystemControlBackgroundAltHighBrush}"
|
||
CornerRadius="8" Padding="16" IsVisible="{Binding HoursWarnings.Count}">
|
||
<StackPanel Spacing="8">
|
||
<TextBlock Text="ABWEICHENDE WOCHENSTUNDEN" FontSize="11" FontWeight="Bold" Opacity="0.5"/>
|
||
<ItemsControl ItemsSource="{Binding HoursWarnings}">
|
||
<ItemsControl.ItemTemplate>
|
||
<DataTemplate x:DataType="vm:HoursWarningItem">
|
||
<TextBlock Text="{Binding Text}" FontSize="12" Foreground="#FB8C00"
|
||
TextWrapping="Wrap" Margin="0,3"/>
|
||
</DataTemplate>
|
||
</ItemsControl.ItemTemplate>
|
||
</ItemsControl>
|
||
</StackPanel>
|
||
</Border>
|
||
|
||
</StackPanel>
|
||
</ScrollViewer>
|
||
</DockPanel>
|
||
</ContentPage>
|
||
|
||
<!-- Tab: Bearbeiten (Raster) -->
|
||
<ContentPage Header="Bearbeiten">
|
||
<ScrollViewer>
|
||
<StackPanel Margin="32,20,32,28" Spacing="10">
|
||
<ItemsControl ItemsSource="{Binding Cells}">
|
||
<ItemsControl.ItemsPanel>
|
||
<ItemsPanelTemplate><UniformGrid Columns="6"/></ItemsPanelTemplate>
|
||
</ItemsControl.ItemsPanel>
|
||
<ItemsControl.ItemTemplate>
|
||
<DataTemplate x:DataType="vm:TimetableCellItem">
|
||
<Grid Margin="2" MinHeight="46">
|
||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsHeader}"
|
||
FontWeight="SemiBold" FontSize="12" Opacity="0.6"
|
||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsPeriodLabel}"
|
||
FontWeight="SemiBold" FontSize="13"
|
||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||
<Border Classes="timetablecell" Classes.assigned="{Binding IsAssigned}"
|
||
CornerRadius="6" IsVisible="{Binding IsSlotCell}">
|
||
<Panel>
|
||
<Button Background="{Binding ColorHex}"
|
||
IsVisible="{Binding IsAssigned}"
|
||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||
HorizontalContentAlignment="Center" CornerRadius="6"
|
||
Command="{Binding $parent[ItemsControl].((vm:TimetableViewModel)DataContext).EditCellCommand}"
|
||
CommandParameter="{Binding}">
|
||
<TextBlock Text="{Binding Text}" FontSize="11" Foreground="White"
|
||
TextWrapping="Wrap" TextAlignment="Center"/>
|
||
</Button>
|
||
<Button Content="+" Opacity="0.35"
|
||
IsVisible="{Binding !IsAssigned}"
|
||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||
HorizontalContentAlignment="Center" Background="Transparent"
|
||
Command="{Binding $parent[ItemsControl].((vm:TimetableViewModel)DataContext).EditCellCommand}"
|
||
CommandParameter="{Binding}"/>
|
||
<Border Background="#D85A30" CornerRadius="8" Padding="5,1"
|
||
IsVisible="{Binding HasBadge}"
|
||
HorizontalAlignment="Right" VerticalAlignment="Top" Margin="2">
|
||
<TextBlock Text="{Binding BadgeText}" FontSize="10" FontWeight="Bold" Foreground="White"/>
|
||
</Border>
|
||
</Panel>
|
||
</Border>
|
||
</Grid>
|
||
</DataTemplate>
|
||
</ItemsControl.ItemTemplate>
|
||
</ItemsControl>
|
||
</StackPanel>
|
||
</ScrollViewer>
|
||
</ContentPage>
|
||
|
||
</TabbedPage>
|
||
</Grid>
|
||
</UserControl>
|