Files
LehrerApp/LehrerApp.Desktop/Views/ClassTeacher/ClassTeacherOverviewView.axaml
T
adminandClaude Sonnet 5 9d375caf14 Klassenlehrer-Tab: Theme-Ressourcen statt Hex-Farben, gestapelter Trend, Fehlquote seit Schuljahresbeginn
Semantische Brushes (Light/Dark) lösen die fest codierten Dark-Hex-Werte ab, die
im hellen Theme unbenutzbar waren. Trend-Chart zeigt jetzt einen echten
gestapelten Balken über die letzten 7 Schultage statt drei unabhängig
skalierten über Kalendertage; neue Fehlquote je Schüler*in seit
Schuljahresbeginn ergänzt den Heute-Snapshot.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-27 12:47:13 +02:00

328 lines
21 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.ClassTeacher"
xmlns:views="clr-namespace:LehrerApp.Desktop.Views.ClassTeacher"
x:Class="LehrerApp.Desktop.Views.ClassTeacher.ClassTeacherOverviewView"
x:DataType="vm:ClassTeacherOverviewViewModel">
<!-- Flächen- und Statusfarben kommen aus Styles/SemanticBrushes.axaml und werden bewusst per
DynamicResource geholt, damit der Theme-Wechsel (hell/dunkel) sie live austauscht. Die
Statusfarbe einer Zeile setzt deshalb ein Style-Selektor über Klassen und nicht ein
Hex-String aus dem ViewModel — ein lokal gesetztes Attribut würde den Selektor überstimmen. -->
<UserControl.Styles>
<Style Selector="Border.metric">
<Setter Property="Background" Value="{DynamicResource AppCardBackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource AppCardBorderBrush}"/>
<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="{DynamicResource AppFilterBorderBrush}"/>
<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="{DynamicResource AppFilterActiveBackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource AppFilterActiveBorderBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource AppFilterActiveForegroundBrush}"/>
</Style>
<Style Selector="Button.rosterRow">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Background" Value="{DynamicResource AppListRowBackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource AppListRowBorderBrush}"/>
<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="{DynamicResource AppListRowHoverBrush}"/>
</Style>
<Style Selector="Border.sidePanel">
<Setter Property="Background" Value="{DynamicResource AppCardBackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource AppCardBorderBrush}"/>
<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>
<!-- Statusstufe: Basis ist "unauffällig", die Klassen aus dem ViewModel schalten hoch. -->
<Style Selector="TextBlock.status">
<Setter Property="Foreground" Value="{DynamicResource AppStatusOkBrush}"/>
</Style>
<Style Selector="TextBlock.status.info">
<Setter Property="Foreground" Value="{DynamicResource AppStatusInfoBrush}"/>
</Style>
<Style Selector="TextBlock.status.warning">
<Setter Property="Foreground" Value="{DynamicResource AppStatusWarningBrush}"/>
</Style>
<Style Selector="TextBlock.status.danger">
<Setter Property="Foreground" Value="{DynamicResource AppStatusDangerBrush}"/>
</Style>
<Style Selector="Border.statusFill">
<Setter Property="Background" Value="{DynamicResource AppStatusOkBrush}"/>
</Style>
<Style Selector="Border.statusFill.info">
<Setter Property="Background" Value="{DynamicResource AppStatusInfoBrush}"/>
</Style>
<Style Selector="Border.statusFill.warning">
<Setter Property="Background" Value="{DynamicResource AppStatusWarningBrush}"/>
</Style>
<Style Selector="Border.statusFill.danger">
<Setter Property="Background" Value="{DynamicResource AppStatusDangerBrush}"/>
</Style>
</UserControl.Styles>
<UserControl.Resources>
<!-- Eine Vorlage für beide Roster-Listen (auffällig / übrige): Sie waren Zeichen für Zeichen
identisch und mussten bisher doppelt gepflegt werden. -->
<DataTemplate x:Key="RosterRowTemplate" 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" Classes="statusFill"
Classes.info="{Binding IsInfoStatus}"
Classes.warning="{Binding IsWarningStatus}"
Classes.danger="{Binding IsDangerStatus}"/>
<Border Grid.Column="1" Width="28" Height="28" CornerRadius="14"
BorderBrush="{DynamicResource AppAvatarBorderBrush}" 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"/>
<StackPanel Grid.Column="3" VerticalAlignment="Center" Spacing="1"
ToolTip.Tip="{Binding YearSummaryTooltip}">
<TextBlock Text="{Binding StatusText}" Classes="status"
Classes.info="{Binding IsInfoStatus}"
Classes.warning="{Binding IsWarningStatus}"
Classes.danger="{Binding IsDangerStatus}"
FontSize="12" TextTrimming="CharacterEllipsis"/>
<!-- Fehlquote seit Schuljahresbeginn (Nutzer-Feedback: der Heute-Snapshot allein sagt
für Zeugnis/Attestpflicht wenig aus) — als dezente zweite Zeile statt eigener
Spalte, damit das bestehende Layout nicht neu vermessen werden muss. -->
<TextBlock Text="{Binding YearSummaryLabel}" IsVisible="{Binding HasYearSummary}"
FontSize="10" Opacity="0.5" TextTrimming="CharacterEllipsis"/>
</StackPanel>
<TextBlock Grid.Column="4" Text="{Binding ClassRegisterLabel}"
Foreground="{DynamicResource AppAccentTextBrush}"
VerticalAlignment="Center" FontSize="11"/>
<TextBlock Grid.Column="5" Text="" FontSize="18" Opacity="0.7" VerticalAlignment="Center"/>
</Grid>
</Button>
</DataTemplate>
</UserControl.Resources>
<Grid>
<StackPanel IsVisible="{Binding !HomeroomClassConfigured}" HorizontalAlignment="Center"
VerticalAlignment="Center" Spacing="12" MaxWidth="380">
<Border Width="56" Height="56" CornerRadius="28" HorizontalAlignment="Center"
Background="{DynamicResource AppAccentSoftBackgroundBrush}">
<TextBlock Text="KL" FontSize="18" FontWeight="Bold"
Foreground="{DynamicResource AppAccentOnSoftBrush}"
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,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="{DynamicResource AppAccentTextBrush}"/>
</StackPanel>
</Grid>
<Grid Grid.Row="1" ColumnDefinitions="*,*,*,*">
<Border Grid.Column="0" Classes="metric">
<Grid ColumnDefinitions="36,*">
<TextBlock Text="◉" FontSize="22" VerticalAlignment="Center"
Foreground="{DynamicResource AppStatusInfoBrush}"/>
<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" VerticalAlignment="Center"
Foreground="{DynamicResource AppStatusWarningBrush}"/>
<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" VerticalAlignment="Center"
Foreground="{DynamicResource AppStatusDangerBrush}"/>
<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" VerticalAlignment="Center"
Foreground="{DynamicResource AppStatusInfoBrush}"/>
<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="{DynamicResource AppCardBackgroundBrush}"
BorderBrush="{DynamicResource AppCardBorderBrush}" 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}" ItemTemplate="{StaticResource RosterRowTemplate}"/>
<TextBlock Classes="sectionLabel" Text="{Binding SecondarySectionTitle}" IsVisible="{Binding HasSecondaryRoster}"/>
<ItemsControl ItemsSource="{Binding SecondaryRoster}" ItemTemplate="{StaticResource RosterRowTemplate}"/>
<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" Classes="statusFill"/><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" Classes="statusFill warning"/><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" Classes="statusFill info"/><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" Classes="statusFill danger"/><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="{DynamicResource AppTrackBackgroundBrush}" CornerRadius="4"/>
<!-- Gestapelter Balken: drei sich nicht überschneidende Segmente
(siehe ClassTeacherTrendDay), gemeinsam auf CornerRadius
zugeschnitten statt jedes Segment einzeln abzurunden. -->
<Border Width="{Binding TotalBarWidth}" HorizontalAlignment="Left"
CornerRadius="4" ClipToBounds="True">
<StackPanel Orientation="Horizontal">
<Border Width="{Binding UnexcusedBarWidth}" Classes="statusFill danger"/>
<Border Width="{Binding LateExcusedBarWidth}" Classes="statusFill warning"/>
<Border Width="{Binding ExcusedBarWidth}" Classes="statusFill info"/>
</StackPanel>
</Border>
</Grid>
<TextBlock Grid.Column="2" Text="{Binding AlertCount}" FontSize="11" HorizontalAlignment="Right"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<StackPanel Orientation="Horizontal" Spacing="10">
<StackPanel Orientation="Horizontal" Spacing="4">
<Border Width="7" Height="7" CornerRadius="4" Classes="statusFill danger"/>
<TextBlock Text="Unentsch." FontSize="10" Opacity="0.55"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="4">
<Border Width="7" Height="7" CornerRadius="4" Classes="statusFill warning"/>
<TextBlock Text="Verspätet" FontSize="10" Opacity="0.55"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="4">
<Border Width="7" Height="7" CornerRadius="4" Classes="statusFill info"/>
<TextBlock Text="Entschuldigt" FontSize="10" Opacity="0.55"/>
</StackPanel>
</StackPanel>
</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 CornerRadius="2" Margin="0,1,8,1" Classes="statusFill"
Classes.info="{Binding IsInfoStatus}"
Classes.warning="{Binding IsWarningStatus}"
Classes.danger="{Binding IsDangerStatus}"/>
<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="Klassenbuch">
<views:ClassTeacherRegisterView DataContext="{Binding DetailsTab}"/>
</ContentPage>
<ContentPage Header="Fehlzeiten">
<views:ClassTeacherAbsencesView DataContext="{Binding DetailsTab}"/>
</ContentPage>
</TabbedPage>
</Grid>
</UserControl>