Files
LehrerApp/LehrerApp.Desktop/Views/ClassTeacher/ClassTeacherCasesView.axaml
T
2026-10-28 16:36:46 +01:00

227 lines
16 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:svm="clr-namespace:LehrerApp.Desktop.ViewModels.Students"
x:Class="LehrerApp.Desktop.Views.ClassTeacher.ClassTeacherCasesView"
x:DataType="vm:ClassTeacherCasesViewModel">
<UserControl.Styles>
<Style Selector="Border.statusPill">
<Setter Property="CornerRadius" Value="10"/>
<Setter Property="Padding" Value="8,2"/>
</Style>
<Style Selector="Border.statusPill.open">
<Setter Property="Background" Value="#FB8C00"/>
</Style>
<Style Selector="Border.statusPill.closed">
<Setter Property="Background" Value="#43A047"/>
</Style>
<Style Selector="Border.statusPill TextBlock">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="11"/>
<Setter Property="FontWeight" Value="SemiBold"/>
</Style>
</UserControl.Styles>
<Grid RowDefinitions="Auto,Auto,*" Margin="16" RowSpacing="10">
<Grid Grid.Row="0" ColumnDefinitions="*,Auto,Auto">
<StackPanel Grid.Column="0">
<TextBlock Text="Vorgänge" FontSize="22" FontWeight="SemiBold"/>
<TextBlock Text="Fallmappen für laufende Probleme mit einer/einem oder mehreren Schüler*innen der Klasse"
FontSize="12" Opacity="0.55"/>
</StackPanel>
<CheckBox Grid.Column="1" Content="Nur offene" IsChecked="{Binding OnlyOpen}"
VerticalAlignment="Center" Margin="0,0,12,0"/>
<Button Grid.Column="2" Content="+ Vorgang" Command="{Binding AddVorgangCommand}"/>
</Grid>
<TextBlock Grid.Row="1" Text="{Binding Status}" FontSize="11" Opacity="0.6"/>
<ScrollViewer Grid.Row="2">
<StackPanel>
<ItemsControl ItemsSource="{Binding Cases}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="vm:VorgangItem">
<Border Background="{DynamicResource AppCardBackgroundBrush}"
BorderBrush="{DynamicResource AppCardBorderBrush}" BorderThickness="1"
CornerRadius="8" Padding="12,10" Margin="0,0,0,8">
<StackPanel Spacing="8">
<Grid ColumnDefinitions="*,Auto,Auto,Auto,Auto,Auto">
<StackPanel Grid.Column="0">
<StackPanel Orientation="Horizontal" Spacing="8">
<Border Classes="statusPill" Classes.open="{Binding IsOpen}" Classes.closed="{Binding !IsOpen}">
<TextBlock Text="{Binding StatusLabel}"/>
</Border>
<TextBlock Text="{Binding Model.Title}" FontWeight="SemiBold" FontSize="14"/>
</StackPanel>
<TextBlock Text="{Binding StudentNames}" FontSize="12" Opacity="0.7" Margin="0,2,0,0"/>
<ItemsControl ItemsSource="{Binding TagChips}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate><WrapPanel ItemSpacing="6" LineSpacing="4"/></ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate DataType="svm:TagChip">
<Border Background="{Binding ColorHex}" CornerRadius="10" Padding="8,2" Margin="0,4,0,0">
<TextBlock Text="{Binding Text}" FontSize="10" Foreground="White"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<Button Content="Details anzeigen" FontSize="11" Padding="8,3"
Command="{Binding RevealCommand}" IsVisible="{Binding !IsRevealed}"/>
<Button Content="Details ausblenden" FontSize="11" Padding="8,3"
Command="{Binding RevealCommand}" IsVisible="{Binding IsRevealed}"/>
</StackPanel>
<Button Grid.Column="2" Content="Bearbeiten" FontSize="11" Padding="8,3"
Command="{Binding $parent[ItemsControl].((vm:ClassTeacherCasesViewModel)DataContext).EditVorgangCommand}"
CommandParameter="{Binding}"/>
<StackPanel Grid.Column="3" Orientation="Horizontal">
<Button Content="Schließen" FontSize="11" Padding="8,3" IsVisible="{Binding IsOpen}"
Command="{Binding $parent[ItemsControl].((vm:ClassTeacherCasesViewModel)DataContext).ToggleStatusCommand}"
CommandParameter="{Binding}"/>
<Button Content="Wieder öffnen" FontSize="11" Padding="8,3" IsVisible="{Binding !IsOpen}"
Command="{Binding $parent[ItemsControl].((vm:ClassTeacherCasesViewModel)DataContext).ToggleStatusCommand}"
CommandParameter="{Binding}"/>
</StackPanel>
<Button Grid.Column="4" Content="Löschen" FontSize="11" Padding="8,3"
Command="{Binding $parent[ItemsControl].((vm:ClassTeacherCasesViewModel)DataContext).DeleteVorgangCommand}"
CommandParameter="{Binding}"/>
</Grid>
<StackPanel Spacing="10" IsVisible="{Binding IsRevealed}" Margin="0,4,0,0">
<TextBlock Text="{Binding Model.Description}" FontSize="12" TextWrapping="Wrap" Opacity="0.85"
IsVisible="{Binding Model.Description, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
<StackPanel Spacing="4">
<TextBlock Text="Verknüpfte Dokumentation" FontSize="12" FontWeight="SemiBold" Opacity="0.7"/>
<ItemsControl ItemsSource="{Binding LinkedDocumentation}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="svm:DocumentationItem">
<Grid ColumnDefinitions="70,*,Auto,Auto,Auto" Margin="0,2">
<TextBlock Grid.Column="0" Text="{Binding DateDisplay}" FontSize="11" Opacity="0.5"/>
<StackPanel Grid.Column="1">
<StackPanel Orientation="Horizontal" Spacing="6">
<TextBlock Text="{Binding StudentName}" FontSize="12" FontWeight="SemiBold"/>
<TextBlock Text="{Binding Model.Title}" FontSize="12" IsVisible="{Binding IsRevealed}"/>
<TextBlock Text="Vertraulich" FontSize="12" Opacity="0.6" IsVisible="{Binding !IsRevealed}"/>
</StackPanel>
<TextBlock Text="{Binding TypeLabel}" FontSize="10" Opacity="0.5"/>
</StackPanel>
<Button Grid.Column="2" Content="Anzeigen" FontSize="10" Padding="6,2" Margin="0,0,4,0"
Command="{Binding RevealCommand}" IsVisible="{Binding !IsRevealed}"/>
<!-- Nutzer-Feedback: verknüpfte Einträge sollen sich zum Nachlesen direkt
hier öffnen lassen, ohne in den Schülerdatensatz wechseln zu müssen. -->
<Button Grid.Column="3" Content="Bearbeiten" FontSize="10" Padding="6,2" Margin="0,0,4,0"
IsVisible="{Binding IsRevealed}"
Command="{Binding $parent[ItemsControl].((vm:VorgangItem)DataContext).EditDocumentationCommand}"
CommandParameter="{Binding}"/>
<Button Grid.Column="4" Content="Entfernen" FontSize="10" Padding="6,2"
Command="{Binding $parent[ItemsControl].((vm:VorgangItem)DataContext).UnlinkCommand}"
CommandParameter="{Binding}"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Noch keine Dokumentation verknüpft." FontSize="11" Opacity="0.5"
IsVisible="{Binding !HasLinkedDocumentation}"/>
<StackPanel Orientation="Horizontal" Spacing="6">
<Button Content="+ Neue Dokumentation anlegen" FontSize="11" Padding="8,3"
Command="{Binding $parent[ItemsControl].((vm:ClassTeacherCasesViewModel)DataContext).CreateAndLinkDocumentationCommand}"
CommandParameter="{Binding}"/>
<!-- Nutzer-Feedback: standardisierte Einträge statt alles von Hand. Zahlen aus
WebUntis (Fehlzeiten über alle Fächer, Klassenbuch), siehe
ClassTeacherStudentFacts; bezieht sich auf die/den erste/n Beteiligte/n. -->
<Button Content="+ Aus Vorlage ▾" FontSize="11" Padding="8,3"
IsVisible="{Binding HasDocumentationTemplates}">
<Button.Flyout>
<MenuFlyout>
<MenuItem Header="Fehlzeiten-Stand (WebUntis) festhalten"
Command="{Binding CreateFromTemplateCommand}" CommandParameter="untisabsences"/>
<MenuItem Header="Verspätungs-Stand (WebUntis) festhalten"
Command="{Binding CreateFromTemplateCommand}" CommandParameter="lateness"/>
<MenuItem Header="Klassenbuch-Stand festhalten"
Command="{Binding CreateFromTemplateCommand}" CommandParameter="classregister"/>
<Separator/>
<MenuItem Header="Gespräch mit Schüler*in"
Command="{Binding CreateFromTemplateCommand}" CommandParameter="conversation"/>
<MenuItem Header="Fachlehrkräfte informieren"
Command="{Binding CreateFromTemplateCommand}" CommandParameter="informsubjectteachers"/>
<MenuItem Header="Elternanruf vorbereiten"
Command="{Binding CreateFromTemplateCommand}" CommandParameter="parentcall"/>
<MenuItem Header="Elternbrief entwerfen"
Command="{Binding CreateFromTemplateCommand}" CommandParameter="parentletter"/>
</MenuFlyout>
</Button.Flyout>
</Button>
</StackPanel>
</StackPanel>
<StackPanel Spacing="4">
<TextBlock Text="Vorhandenen Akteneintrag verknüpfen" FontSize="12"
FontWeight="SemiBold" Opacity="0.7"/>
<TextBlock Text="Keine weiteren passenden Akteneinträge vorhanden. Neue Einträge aus der Schülerakte werden beim erneuten Öffnen des Tabs geladen."
FontSize="11" Opacity="0.6" TextWrapping="Wrap"
IsVisible="{Binding !HasAvailableDocumentation}"/>
<ItemsControl ItemsSource="{Binding AvailableDocumentation}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="svm:DocumentationItem">
<Grid ColumnDefinitions="70,*,Auto,Auto,Auto" Margin="0,2">
<TextBlock Grid.Column="0" Text="{Binding DateDisplay}" FontSize="11" Opacity="0.5"/>
<StackPanel Grid.Column="1">
<StackPanel Orientation="Horizontal" Spacing="6">
<TextBlock Text="{Binding StudentName}" FontSize="12" FontWeight="SemiBold"/>
<TextBlock Text="{Binding Model.Title}" FontSize="12" IsVisible="{Binding IsRevealed}"/>
<TextBlock Text="Vertraulich" FontSize="12" Opacity="0.6" IsVisible="{Binding !IsRevealed}"/>
</StackPanel>
<TextBlock Text="{Binding TypeLabel}" FontSize="10" Opacity="0.5"/>
</StackPanel>
<Button Grid.Column="2" Content="Anzeigen" FontSize="10" Padding="6,2" Margin="0,0,4,0"
Command="{Binding RevealCommand}" IsVisible="{Binding !IsRevealed}"/>
<Button Grid.Column="3" Content="Bearbeiten" FontSize="10" Padding="6,2" Margin="0,0,4,0"
IsVisible="{Binding IsRevealed}"
Command="{Binding $parent[ItemsControl].((vm:VorgangItem)DataContext).EditDocumentationCommand}"
CommandParameter="{Binding}"/>
<Button Grid.Column="4" Content="Verknüpfen" FontSize="10" Padding="6,2"
Command="{Binding $parent[ItemsControl].((vm:VorgangItem)DataContext).LinkCommand}"
CommandParameter="{Binding}"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<StackPanel Spacing="4">
<TextBlock Text="Angeheftete Klassenbucheinträge" FontSize="12" FontWeight="SemiBold" Opacity="0.7"/>
<ItemsControl ItemsSource="{Binding ClassRegisterRows}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="vm:VorgangClassRegisterEntryRow">
<Grid ColumnDefinitions="70,*,Auto" Margin="0,2">
<TextBlock Grid.Column="0" Text="{Binding DateLabel}" FontSize="11" Opacity="0.5"/>
<StackPanel Grid.Column="1">
<TextBlock Text="{Binding StudentName}" FontSize="12" FontWeight="SemiBold"/>
<TextBlock Text="{Binding SummaryLabel}" FontSize="11" Opacity="0.7" TextWrapping="Wrap"/>
</StackPanel>
<Button Grid.Column="2" Content="Entfernen" FontSize="10" Padding="6,2"
Command="{Binding $parent[ItemsControl].((vm:VorgangItem)DataContext).RemoveClassRegisterEntryCommand}"
CommandParameter="{Binding}"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Noch keine Klassenbucheinträge angeheftet — im Klassenbuch-Tab über „→ Vorgang&#8220; möglich."
FontSize="11" Opacity="0.5" IsVisible="{Binding !HasClassRegisterRows}" TextWrapping="Wrap"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Keine Vorgänge." Classes="emptyhint" IsVisible="{Binding !HasCases}"/>
</StackPanel>
</ScrollViewer>
</Grid>
</UserControl>