Redesign Klassenlehrer Tab.

This commit is contained in:
2026-08-26 22:50:40 +02:00
parent 265ffe9a74
commit cf8de08501
11 changed files with 730 additions and 207 deletions
@@ -5,55 +5,259 @@
x:Class="LehrerApp.Desktop.Views.ClassTeacher.ClassTeacherOverviewView"
x:DataType="vm:ClassTeacherOverviewViewModel">
<UserControl.Styles>
<Style Selector="Border.metric">
<Setter Property="Background" Value="#11151B"/>
<Setter Property="BorderBrush" Value="#2A3038"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="8"/>
<Setter Property="Padding" Value="14,12"/>
<Setter Property="Margin" Value="0,0,10,0"/>
</Style>
<Style Selector="Button.filter">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="#343B45"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="6"/>
<Setter Property="Padding" Value="16,6"/>
<Setter Property="FontSize" Value="12"/>
</Style>
<Style Selector="Button.filter.active">
<Setter Property="Background" Value="#173765"/>
<Setter Property="BorderBrush" Value="#3C86F7"/>
<Setter Property="Foreground" Value="#FFFFFF"/>
</Style>
<Style Selector="Button.rosterRow">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Background" Value="#0E1217"/>
<Setter Property="BorderBrush" Value="#262C34"/>
<Setter Property="BorderThickness" Value="1,0,1,1"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="MinHeight" Value="48"/>
</Style>
<Style Selector="Button.rosterRow:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="#171D25"/>
</Style>
<Style Selector="Border.sidePanel">
<Setter Property="Background" Value="#11151B"/>
<Setter Property="BorderBrush" Value="#2A3038"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="8"/>
<Setter Property="Padding" Value="14"/>
<Setter Property="Margin" Value="0,0,0,10"/>
</Style>
<Style Selector="TextBlock.sectionLabel">
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Margin" Value="4,10,0,6"/>
</Style>
</UserControl.Styles>
<Grid>
<!-- Hinweis, solange in den Einstellungen keine Klasse ausgewählt ist -->
<StackPanel IsVisible="{Binding !HomeroomClassConfigured}" HorizontalAlignment="Center"
VerticalAlignment="Center" Spacing="12" MaxWidth="360">
<TextBlock Text="🎓" FontSize="40" HorizontalAlignment="Center"/>
<TextBlock Text="Noch keine Klasse ausgewählt" FontSize="16" FontWeight="SemiBold" HorizontalAlignment="Center"/>
<TextBlock TextWrapping="Wrap" TextAlignment="Center" FontSize="13" Opacity="0.7"
VerticalAlignment="Center" Spacing="12" MaxWidth="380">
<Border Width="56" Height="56" CornerRadius="28" Background="#173765" HorizontalAlignment="Center">
<TextBlock Text="KL" FontSize="18" FontWeight="Bold" Foreground="#66A3FF"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock Text="Noch keine Klasse ausgewählt" FontSize="18" FontWeight="SemiBold" HorizontalAlignment="Center"/>
<TextBlock TextWrapping="Wrap" TextAlignment="Center" FontSize="13" Opacity="0.65"
Text="Wähle in den WebUntis-Einstellungen die Klasse aus, deren Klassenlehrer/-in du bist."/>
<Button Content="Zu den Einstellungen" Command="{Binding GoToSettingsCommand}" HorizontalAlignment="Center"/>
</StackPanel>
<TabbedPage IsVisible="{Binding HomeroomClassConfigured}" TabPlacement="Top"
SelectedIndex="{Binding ActiveTabIndex, Mode=TwoWay}">
<ContentPage Header="Übersicht">
<Grid RowDefinitions="Auto,Auto,*" Margin="16" RowSpacing="8">
<TextBlock Grid.Row="0" Text="{Binding HomeroomClassName, StringFormat='Klasse {0}'}"
FontSize="18" FontWeight="SemiBold"/>
<TextBlock Grid.Row="1" Text="{Binding Status}" FontSize="12" Opacity="0.7"/>
<ScrollViewer Grid.Row="2">
<ItemsControl ItemsSource="{Binding Roster}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:ClassTeacherRosterRow">
<Button HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"
Background="Transparent" BorderThickness="0" Padding="8,6"
Command="{Binding $parent[ItemsControl].((vm:ClassTeacherOverviewViewModel)DataContext).ShowDetailsForStudentCommand}"
CommandParameter="{Binding}">
<Grid ColumnDefinitions="Auto,*,Auto">
<TextBlock Grid.Column="0" Text="{Binding StatusIcon}" FontSize="16" Width="28"
ToolTip.Tip="{Binding AbsenceTooltip}"/>
<TextBlock Grid.Column="1" Text="{Binding StudentName}" VerticalAlignment="Center"/>
<Border Grid.Column="2" Background="#1976D2" CornerRadius="8" Padding="6,1"
IsVisible="{Binding HasRecentClassRegisterEntry}"
ToolTip.Tip="Klassenbucheintrag einer anderen Lehrkraft in den letzten 7 Tagen">
<TextBlock Text="Klassenbuch" Foreground="White" FontSize="10"/>
</Border>
</Grid>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<Grid RowDefinitions="Auto,Auto,*" Margin="16,12,16,16" RowSpacing="10">
<Grid Grid.Row="0" ColumnDefinitions="*,Auto">
<StackPanel Grid.Column="0" Spacing="2">
<TextBlock Text="{Binding HomeroomClassName, StringFormat='Klasse {0}'}"
FontSize="24" FontWeight="SemiBold"/>
<TextBlock Text="Klassenlehrer-Übersicht" FontSize="13" Opacity="0.58"/>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="10" VerticalAlignment="Center">
<TextBlock Text="{Binding LastUpdatedLabel}" FontSize="11" Opacity="0.55" VerticalAlignment="Center"/>
<Button Content="↻ Aktualisieren" Command="{Binding LoadCommand}" IsEnabled="{Binding !Busy}"
Background="Transparent" BorderThickness="0" Foreground="#5795F5"/>
</StackPanel>
</Grid>
<Grid Grid.Row="1" ColumnDefinitions="*,*,*,*">
<Border Grid.Column="0" Classes="metric">
<Grid ColumnDefinitions="36,*">
<TextBlock Text="◉" FontSize="22" Foreground="#4C8DFF" VerticalAlignment="Center"/>
<StackPanel Grid.Column="1"><TextBlock Text="{Binding StudentCount}" FontSize="22" FontWeight="SemiBold"/><TextBlock Text="Schüler*innen" FontSize="11" Opacity="0.6"/></StackPanel>
</Grid>
</Border>
<Border Grid.Column="1" Classes="metric">
<Grid ColumnDefinitions="36,*">
<TextBlock Text="△" FontSize="24" Foreground="#F59E0B" VerticalAlignment="Center"/>
<StackPanel Grid.Column="1"><TextBlock Text="{Binding TodayAlertCount}" FontSize="22" FontWeight="SemiBold"/><TextBlock Text="heute auffällig" FontSize="11" Opacity="0.6"/></StackPanel>
</Grid>
</Border>
<Border Grid.Column="2" Classes="metric">
<Grid ColumnDefinitions="36,*">
<TextBlock Text="!" FontSize="22" Foreground="#FF5A67" VerticalAlignment="Center"/>
<StackPanel Grid.Column="1"><TextBlock Text="{Binding TodayUnexcusedCount}" FontSize="22" FontWeight="SemiBold"/><TextBlock Text="unentschuldigt" FontSize="11" Opacity="0.6"/></StackPanel>
</Grid>
</Border>
<Border Grid.Column="3" Classes="metric" Margin="0">
<Grid ColumnDefinitions="36,*">
<TextBlock Text="▤" FontSize="21" Foreground="#4C8DFF" VerticalAlignment="Center"/>
<StackPanel Grid.Column="1"><TextBlock Text="{Binding RecentClassRegisterCount}" FontSize="22" FontWeight="SemiBold"/><TextBlock Text="Klassenbucheinträge · 7 Tage" FontSize="11" Opacity="0.6"/></StackPanel>
</Grid>
</Border>
</Grid>
<Grid Grid.Row="2" ColumnDefinitions="*,286" ColumnSpacing="12">
<Grid Grid.Column="0" RowDefinitions="Auto,*">
<Border Grid.Row="0" Background="#11151B" BorderBrush="#2A3038" BorderThickness="1"
CornerRadius="8" Padding="8" Margin="0,0,0,4">
<Grid ColumnDefinitions="Auto,Auto,Auto,*,250" ColumnSpacing="8">
<Button Grid.Column="0" Classes="filter" Classes.active="{Binding AlertsFilterSelected}"
Content="Auffällig" Command="{Binding ShowAlertsCommand}"/>
<Button Grid.Column="1" Classes="filter" Classes.active="{Binding ClassRegisterFilterSelected}"
Content="Klassenbuch" Command="{Binding ShowClassRegisterCommand}"/>
<Button Grid.Column="2" Classes="filter" Classes.active="{Binding AllFilterSelected}"
Content="Alle" Command="{Binding ShowAllCommand}"/>
<TextBox Grid.Column="4" Text="{Binding SearchText, Mode=TwoWay}" PlaceholderText="Schüler*in suchen…"
FontSize="12" MinHeight="32"/>
</Grid>
</Border>
<ScrollViewer Grid.Row="1">
<StackPanel>
<TextBlock Classes="sectionLabel" Text="{Binding PrimarySectionTitle}" IsVisible="{Binding HasPrimaryRoster}"/>
<ItemsControl ItemsSource="{Binding PrimaryRoster}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:ClassTeacherRosterRow">
<Button Classes="rosterRow"
Command="{Binding $parent[ItemsControl].((vm:ClassTeacherOverviewViewModel)DataContext).ShowDetailsForStudentCommand}"
CommandParameter="{Binding}">
<Grid ColumnDefinitions="4,42,220,*,150,18" Margin="0">
<Border Grid.Column="0" Background="{Binding StatusBarColor}"/>
<Border Grid.Column="1" Width="28" Height="28" CornerRadius="14" BorderBrush="#4A515C"
BorderThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="{Binding Initials}" FontSize="10" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock Grid.Column="2" Text="{Binding StudentName}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/>
<TextBlock Grid.Column="3" Text="{Binding StatusText}" Foreground="{Binding StatusColor}"
VerticalAlignment="Center" FontSize="12" TextTrimming="CharacterEllipsis"/>
<TextBlock Grid.Column="4" Text="{Binding ClassRegisterLabel}" Foreground="#5795F5"
VerticalAlignment="Center" FontSize="11"/>
<TextBlock Grid.Column="5" Text="" FontSize="18" Opacity="0.7" VerticalAlignment="Center"/>
</Grid>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Classes="sectionLabel" Text="{Binding SecondarySectionTitle}" IsVisible="{Binding HasSecondaryRoster}"/>
<ItemsControl ItemsSource="{Binding SecondaryRoster}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:ClassTeacherRosterRow">
<Button Classes="rosterRow"
Command="{Binding $parent[ItemsControl].((vm:ClassTeacherOverviewViewModel)DataContext).ShowDetailsForStudentCommand}"
CommandParameter="{Binding}">
<Grid ColumnDefinitions="4,42,220,*,150,18">
<Border Grid.Column="0" Background="{Binding StatusBarColor}"/>
<Border Grid.Column="1" Width="28" Height="28" CornerRadius="14" BorderBrush="#4A515C" BorderThickness="1"
HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="{Binding Initials}" FontSize="10" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock Grid.Column="2" Text="{Binding StudentName}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/>
<TextBlock Grid.Column="3" Text="{Binding StatusText}" Foreground="{Binding StatusColor}"
VerticalAlignment="Center" FontSize="12"/>
<TextBlock Grid.Column="4" Text="{Binding ClassRegisterLabel}" Foreground="#5795F5" VerticalAlignment="Center" FontSize="11"/>
<TextBlock Grid.Column="5" Text="" FontSize="18" Opacity="0.7" VerticalAlignment="Center"/>
</Grid>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<StackPanel IsVisible="{Binding HasNoFilterResults}" HorizontalAlignment="Center" Margin="0,54,0,0" Spacing="6">
<TextBlock Text="Keine passenden Schüler*innen" FontWeight="SemiBold" HorizontalAlignment="Center"/>
<TextBlock Text="Passe Filter oder Suche an." FontSize="12" Opacity="0.55"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
<ScrollViewer Grid.Column="1">
<StackPanel>
<Border Classes="sidePanel">
<StackPanel Spacing="9">
<TextBlock Text="Tagesüberblick" FontSize="14" FontWeight="SemiBold"/>
<Grid ColumnDefinitions="10,*,Auto,40"><Border Width="7" Height="7" CornerRadius="4" Background="#73C45A"/><TextBlock Grid.Column="1" Text="Anwesend" FontSize="12"/><TextBlock Grid.Column="2" Text="{Binding PresentCount}"/><TextBlock Grid.Column="3" Text="{Binding PresentPercent, StringFormat='{}{0} %'}" Opacity="0.6" HorizontalAlignment="Right"/></Grid>
<Grid ColumnDefinitions="10,*,Auto,40"><Border Width="7" Height="7" CornerRadius="4" Background="#F59E0B"/><TextBlock Grid.Column="1" Text="Verspätet" FontSize="12"/><TextBlock Grid.Column="2" Text="{Binding LateCount}"/><TextBlock Grid.Column="3" Text="{Binding LatePercent, StringFormat='{}{0} %'}" Opacity="0.6" HorizontalAlignment="Right"/></Grid>
<Grid ColumnDefinitions="10,*,Auto,40"><Border Width="7" Height="7" CornerRadius="4" Background="#4C8DFF"/><TextBlock Grid.Column="1" Text="Fehlzeit · entschuldigt" FontSize="12"/><TextBlock Grid.Column="2" Text="{Binding ExcusedAbsenceCount}"/><TextBlock Grid.Column="3" Text="{Binding ExcusedAbsencePercent, StringFormat='{}{0} %'}" Opacity="0.6" HorizontalAlignment="Right"/></Grid>
<Grid ColumnDefinitions="10,*,Auto,40"><Border Width="7" Height="7" CornerRadius="4" Background="#FF5A67"/><TextBlock Grid.Column="1" Text="Fehlzeit · unentschuldigt" FontSize="12"/><TextBlock Grid.Column="2" Text="{Binding UnexcusedAbsenceCount}"/><TextBlock Grid.Column="3" Text="{Binding UnexcusedAbsencePercent, StringFormat='{}{0} %'}" Opacity="0.6" HorizontalAlignment="Right"/></Grid>
</StackPanel>
</Border>
<Border Classes="sidePanel">
<StackPanel Spacing="8">
<TextBlock Text="Trend · letzte 7 Tage" FontSize="14" FontWeight="SemiBold"/>
<ItemsControl ItemsSource="{Binding TrendDays}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:ClassTeacherTrendDay">
<Grid ColumnDefinitions="42,*,24" Margin="0,2">
<TextBlock Text="{Binding DayLabel}" FontSize="11" Opacity="0.6" VerticalAlignment="Center"/>
<Grid Grid.Column="1" Height="8" VerticalAlignment="Center">
<Border Background="#252B33" CornerRadius="4"/>
<Border Width="{Binding AlertBarWidth}" HorizontalAlignment="Left" Background="#F59E0B" CornerRadius="4"/>
</Grid>
<TextBlock Grid.Column="2" Text="{Binding AlertCount}" FontSize="11" HorizontalAlignment="Right"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Betroffene Schüler*innen pro Tag" FontSize="10" Opacity="0.45"/>
</StackPanel>
</Border>
<Border Classes="sidePanel" IsVisible="{Binding HasPatternNotices}">
<StackPanel Spacing="8">
<TextBlock Text="Muster erkannt" FontSize="14" FontWeight="SemiBold"/>
<ItemsControl ItemsSource="{Binding PatternNotices}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:ClassTeacherPatternNotice">
<Grid ColumnDefinitions="4,*" Margin="0,3">
<Border Background="{Binding Color}" CornerRadius="2" Margin="0,1,8,1"/>
<StackPanel Grid.Column="1">
<TextBlock Text="{Binding StudentName}" FontSize="12" FontWeight="SemiBold"/>
<TextBlock Text="{Binding Message}" FontSize="11" Opacity="0.62" TextWrapping="Wrap"/>
</StackPanel>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Border>
<Border Classes="sidePanel">
<StackPanel Spacing="8">
<TextBlock Text="Nächste Schritte" FontSize="14" FontWeight="SemiBold"/>
<Button Content="Klassenbuch öffnen" Command="{Binding OpenClassRegisterCommand}" HorizontalAlignment="Stretch"/>
<Button Content="Fehlzeiten öffnen" Command="{Binding OpenAbsencesCommand}" HorizontalAlignment="Stretch"/>
<Button Content="Aufgaben &amp; Wiedervorlagen" Command="{Binding GoToWorkloadCommand}"
HorizontalAlignment="Stretch" Background="Transparent"/>
</StackPanel>
</Border>
<TextBlock Text="{Binding Status}" FontSize="11" TextWrapping="Wrap" Opacity="0.6"/>
</StackPanel>
</ScrollViewer>
</Grid>
</Grid>
</ContentPage>
<ContentPage Header="Details">
<views:ClassTeacherDetailsView DataContext="{Binding DetailsTab}"/>
<ContentPage Header="Klassenbuch">
<views:ClassTeacherRegisterView DataContext="{Binding DetailsTab}"/>
</ContentPage>
<ContentPage Header="Fehlzeiten">
<views:ClassTeacherAbsencesView DataContext="{Binding DetailsTab}"/>
</ContentPage>
</TabbedPage>
</Grid>
</UserControl>