Schülerdokumentation: Einträge, Fehlzeitenbilanz, Datenschutz (Kapitel 5)
Dokumentationseinträge mit Typwahl (Gespräch, Vorkommnis, Förderplan, Fehlzeit, Elternanruf, Elternbrief), vertrauliche Einträge nur nach Bestätigung sichtbar, weiche Löschung mit Nachvollziehbarkeit. Fehlzeiten als Auswertung des bestehenden Anwesenheits-Trackings statt zweiter Erfassung, mit Schwellenwert-Warnung im Schülerdetail und Dashboard. Förderplan-Wiedervorlage als Dashboard-Karte. Datenschutz: Löschfristen mit manueller Bereinigung und DSGVO-Art.-15-Datenauskunft als Export. Auf Nutzer-Feedback hin ergänzt: Elternanruf mit begleitendem Gesprächsprotokoll-Dialog (Punkte abhaken, Eindrücke festhalten), Elternbrief mit Versand-/Rückmeldungs-Tracking, Datei-Anhänge über LiteDBs Dateispeicher, frei vergebbare Labels zur Nachverfolgung mit Dringlichkeits-Farbcodierung, sowie eine sichtbare Farblegende für das bestehende Notenentwicklungs-Diagramm. Dabei einen Absturz behoben: leere Textfelder lieferten über das Binding null statt "", was beim Speichern eine NullReferenceException auslöste. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,235 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Students"
|
||||
x:Class="LehrerApp.Desktop.Views.Students.DocumentationDialog"
|
||||
x:DataType="vm:DocumentationDialogViewModel"
|
||||
Title="{Binding DialogTitle}"
|
||||
Width="480" SizeToContent="Height" MinHeight="360"
|
||||
CanResize="True" WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Grid RowDefinitions="*,Auto" Margin="24">
|
||||
<ScrollViewer Grid.Row="0">
|
||||
<StackPanel Spacing="12">
|
||||
<TextBlock Text="{Binding DialogTitle}" Classes="dialogtitle"/>
|
||||
|
||||
<Grid ColumnDefinitions="*,12,140">
|
||||
<StackPanel Grid.Column="0" Spacing="4">
|
||||
<TextBlock Text="Titel *" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding Title}"/>
|
||||
<TextBlock Text="{Binding TitleError}" Foreground="Red" FontSize="11"
|
||||
IsVisible="{Binding TitleError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Spacing="4">
|
||||
<TextBlock Text="Datum *" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding DateText}" PlaceholderText="TT.MM.JJJJ"/>
|
||||
<TextBlock Text="{Binding DateTextError}" Foreground="Red" FontSize="11"
|
||||
IsVisible="{Binding DateTextError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Typ *" FontSize="12" Opacity="0.7"/>
|
||||
<ComboBox ItemsSource="{Binding TypeOptions}" SelectedItem="{Binding TypeName}"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Beschreibung" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding Content}" AcceptsReturn="True" Height="80" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Gespräch: Teilnehmer (5.1.2) -->
|
||||
<StackPanel Spacing="6" IsVisible="{Binding IsConversation}">
|
||||
<TextBlock Text="Teilnehmer" FontSize="12" Opacity="0.7"/>
|
||||
<ItemsControl ItemsSource="{Binding Participants}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid ColumnDefinitions="*,Auto" Margin="0,2">
|
||||
<TextBlock Grid.Column="0" Text="{Binding}" VerticalAlignment="Center" FontSize="13"/>
|
||||
<Button Grid.Column="1" Content="×" Padding="7,2" FontSize="13"
|
||||
Command="{Binding $parent[ItemsControl].((vm:DocumentationDialogViewModel)DataContext).RemoveParticipantCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<Grid ColumnDefinitions="*,8,Auto">
|
||||
<TextBox Grid.Column="0" Text="{Binding NewParticipant}" PlaceholderText="Name"/>
|
||||
<Button Grid.Column="2" Content="+" Command="{Binding AddParticipantCommand}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Fehlzeit: Aktenvermerk (5.1.1) -->
|
||||
<StackPanel Spacing="8" IsVisible="{Binding IsAbsence}">
|
||||
<TextBlock Text="Freier Aktenvermerk zu einer Abwesenheit (z.B. Krankschreibung eingereicht). Ersetzt nicht die Anwesenheits-Erfassung in der Mitarbeit-Ansicht und fließt nicht in die Fehlzeitenbilanz ein."
|
||||
FontSize="11" Opacity="0.55" TextWrapping="Wrap"/>
|
||||
<Grid ColumnDefinitions="120,12,*">
|
||||
<StackPanel Grid.Column="0" Spacing="4">
|
||||
<TextBlock Text="Stunden" FontSize="12" Opacity="0.7"/>
|
||||
<NumericUpDown Value="{Binding LessonCount}" Minimum="0" FormatString="0"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Spacing="4" VerticalAlignment="Bottom">
|
||||
<CheckBox Content="Entschuldigt" IsChecked="{Binding AbsenceExcused}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Grund" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding AbsenceReason}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Förderplan (5.3.1) -->
|
||||
<StackPanel Spacing="8" IsVisible="{Binding IsSupportPlan}">
|
||||
<TextBlock Text="Maßnahmen" FontSize="12" Opacity="0.7"/>
|
||||
<ItemsControl ItemsSource="{Binding Measures}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid ColumnDefinitions="*,Auto" Margin="0,2">
|
||||
<TextBlock Grid.Column="0" Text="{Binding}" VerticalAlignment="Center" FontSize="13"/>
|
||||
<Button Grid.Column="1" Content="×" Padding="7,2" FontSize="13"
|
||||
Command="{Binding $parent[ItemsControl].((vm:DocumentationDialogViewModel)DataContext).RemoveMeasureCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<Grid ColumnDefinitions="*,8,Auto">
|
||||
<TextBox Grid.Column="0" Text="{Binding NewMeasure}" PlaceholderText="Maßnahme"/>
|
||||
<Button Grid.Column="2" Content="+" Command="{Binding AddMeasureCommand}"/>
|
||||
</Grid>
|
||||
<Grid ColumnDefinitions="*,12,*">
|
||||
<StackPanel Grid.Column="0" Spacing="4">
|
||||
<TextBlock Text="Überprüfung am" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding ReviewDateText}" PlaceholderText="TT.MM.JJJJ"/>
|
||||
<TextBlock Text="{Binding ReviewDateTextError}" Foreground="Red" FontSize="11"
|
||||
IsVisible="{Binding ReviewDateTextError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Spacing="4">
|
||||
<TextBlock Text="Status" FontSize="12" Opacity="0.7"/>
|
||||
<ComboBox ItemsSource="{Binding SupportStatusOptions}" SelectedItem="{Binding SupportStatusName}"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Elternanruf: Planung (Abhaken/Protokoll läuft separat über "Gespräch begleiten") -->
|
||||
<StackPanel Spacing="6" IsVisible="{Binding IsParentCall}">
|
||||
<TextBlock Text="Gesprächspunkte planen. Abgehakt und protokolliert wird während des Anrufs über den Button 'Gespräch begleiten' in der Übersicht."
|
||||
FontSize="11" Opacity="0.55" TextWrapping="Wrap"/>
|
||||
<ItemsControl ItemsSource="{Binding CallPoints}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid ColumnDefinitions="*,Auto" Margin="0,2">
|
||||
<TextBlock Grid.Column="0" Text="{Binding}" VerticalAlignment="Center" FontSize="13"/>
|
||||
<Button Grid.Column="1" Content="×" Padding="7,2" FontSize="13"
|
||||
Command="{Binding $parent[ItemsControl].((vm:DocumentationDialogViewModel)DataContext).RemoveCallPointCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<Grid ColumnDefinitions="*,8,Auto">
|
||||
<TextBox Grid.Column="0" Text="{Binding NewCallPoint}" PlaceholderText="Gesprächspunkt"/>
|
||||
<Button Grid.Column="2" Content="+" Command="{Binding AddCallPointCommand}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Elternbrief (5.1) -->
|
||||
<StackPanel Spacing="8" IsVisible="{Binding IsParentLetter}">
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Entwurf / Inhalt" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding LetterDraftContent}" AcceptsReturn="True" Height="70" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
<Grid ColumnDefinitions="*,12,*">
|
||||
<StackPanel Grid.Column="0" Spacing="4">
|
||||
<TextBlock Text="Versendet am" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding LetterSentDateText}" PlaceholderText="TT.MM.JJJJ"/>
|
||||
<TextBlock Text="{Binding LetterSentDateError}" Foreground="Red" FontSize="11"
|
||||
IsVisible="{Binding LetterSentDateError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Spacing="4" VerticalAlignment="Bottom">
|
||||
<CheckBox Content="Rückmeldung erhalten" IsChecked="{Binding LetterResponseReceived}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Grid ColumnDefinitions="*,12,*">
|
||||
<StackPanel Grid.Column="0" Spacing="4">
|
||||
<TextBlock Text="Rückmeldung am" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding LetterResponseDateText}" PlaceholderText="TT.MM.JJJJ"/>
|
||||
<TextBlock Text="{Binding LetterResponseDateError}" Foreground="Red" FontSize="11"
|
||||
IsVisible="{Binding LetterResponseDateError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Spacing="4">
|
||||
<TextBlock Text="Rückmeldung (Notiz)" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding LetterResponseNote}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Anhänge (alle Typen) -->
|
||||
<StackPanel Spacing="6">
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<TextBlock Grid.Column="0" Text="Anhänge" FontSize="12" Opacity="0.7" VerticalAlignment="Center"/>
|
||||
<Button Grid.Column="1" Content="+ Datei" FontSize="12" Padding="8,4" Click="OnAddAttachment"/>
|
||||
</Grid>
|
||||
<ItemsControl ItemsSource="{Binding Attachments}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:AttachmentItem">
|
||||
<Grid ColumnDefinitions="*,Auto,Auto,Auto" Margin="0,2">
|
||||
<TextBlock Grid.Column="0" Text="{Binding FileName}" VerticalAlignment="Center" FontSize="13"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding SizeDisplay}" VerticalAlignment="Center"
|
||||
FontSize="11" Opacity="0.5" Margin="6,0"/>
|
||||
<Button Grid.Column="2" Content="Speichern" FontSize="11" Padding="7,2" Margin="0,0,4,0"
|
||||
Click="OnOpenAttachment" Tag="{Binding}"/>
|
||||
<Button Grid.Column="3" Content="×" FontSize="13" Padding="7,2"
|
||||
Command="{Binding $parent[ItemsControl].((vm:DocumentationDialogViewModel)DataContext).RemoveAttachmentCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<TextBlock Text="{Binding AttachmentError}" Foreground="Red" FontSize="11"
|
||||
IsVisible="{Binding AttachmentError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Labels zur Nachverfolgung (alle Typen) -->
|
||||
<StackPanel Spacing="6">
|
||||
<TextBlock Text="Labels" FontSize="12" Opacity="0.7"/>
|
||||
<ItemsControl ItemsSource="{Binding Tags}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate><WrapPanel ItemSpacing="6" LineSpacing="6"/></ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border Background="{DynamicResource SystemControlBackgroundBaseMediumBrush}"
|
||||
CornerRadius="10" Padding="8,3">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<TextBlock Text="{Binding}" FontSize="11"/>
|
||||
<Button Content="×" FontSize="11" Padding="0" Background="Transparent"
|
||||
Command="{Binding $parent[ItemsControl].((vm:DocumentationDialogViewModel)DataContext).RemoveTagCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<Grid ColumnDefinitions="*,8,Auto">
|
||||
<AutoCompleteBox Grid.Column="0" Text="{Binding NewTag}"
|
||||
ItemsSource="{Binding TagSuggestions}"
|
||||
FilterMode="Contains" MinimumPrefixLength="0"
|
||||
PlaceholderText="Label (z.B. Kritisch, Nacharbeiten)"/>
|
||||
<Button Grid.Column="2" Content="+" Command="{Binding AddTagCommand}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<CheckBox Content="Vertraulich" IsChecked="{Binding IsConfidential}"
|
||||
ToolTip.Tip="Blendet den Inhalt in der Übersicht standardmäßig aus; erst nach Klick auf 'Anzeigen' sichtbar."/>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid Grid.Row="1" ColumnDefinitions="*,8,*" Margin="0,20,0,0">
|
||||
<Button Grid.Column="0" Content="Abbrechen" HorizontalAlignment="Stretch" Click="OnCancel"/>
|
||||
<Button Grid.Column="2" Content="Speichern" HorizontalAlignment="Stretch" Click="OnSave"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,58 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Platform.Storage;
|
||||
using LehrerApp.Desktop.ViewModels.Students;
|
||||
|
||||
namespace LehrerApp.Desktop.Views.Students;
|
||||
|
||||
public partial class DocumentationDialog : Window
|
||||
{
|
||||
public DocumentationDialog() => InitializeComponent();
|
||||
|
||||
private void OnSave(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is DocumentationDialogViewModel vm)
|
||||
{
|
||||
vm.SaveCommand.Execute(null);
|
||||
if (vm.Result is not null) Close(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCancel(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is DocumentationDialogViewModel vm) vm.DiscardUnsavedAttachments();
|
||||
Close(false);
|
||||
}
|
||||
|
||||
private async void OnAddAttachment(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is not DocumentationDialogViewModel vm) return;
|
||||
|
||||
var files = await StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||
{
|
||||
Title = "Anhang auswählen", AllowMultiple = false,
|
||||
});
|
||||
if (files.Count == 0) return;
|
||||
|
||||
await using var stream = await files[0].OpenReadAsync();
|
||||
vm.AddAttachment(files[0].Name, stream);
|
||||
}
|
||||
|
||||
private async void OnOpenAttachment(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is not DocumentationDialogViewModel vm) return;
|
||||
if (sender is not Button { Tag: AttachmentItem item }) return;
|
||||
|
||||
using var source = vm.OpenAttachment(item);
|
||||
if (source is null) return;
|
||||
|
||||
var file = await StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions
|
||||
{
|
||||
Title = "Anhang speichern unter", SuggestedFileName = item.FileName,
|
||||
});
|
||||
if (file is null) return;
|
||||
|
||||
await using var target = await file.OpenWriteAsync();
|
||||
await source.CopyToAsync(target);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Students"
|
||||
x:Class="LehrerApp.Desktop.Views.Students.ParentCallSessionDialog"
|
||||
x:DataType="vm:ParentCallSessionViewModel"
|
||||
Title="Elternanruf begleiten"
|
||||
Width="440" SizeToContent="Height" MinHeight="300"
|
||||
CanResize="True" WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Grid RowDefinitions="*,Auto" Margin="24">
|
||||
<ScrollViewer Grid.Row="0">
|
||||
<StackPanel Spacing="14">
|
||||
<TextBlock Text="Elternanruf begleiten" Classes="dialogtitle"/>
|
||||
<TextBlock Text="{Binding StudentTitle}" FontSize="13" Opacity="0.6"/>
|
||||
|
||||
<StackPanel Spacing="6">
|
||||
<TextBlock Text="Gesprächspunkte" FontSize="12" FontWeight="SemiBold" Opacity="0.7"/>
|
||||
<ItemsControl ItemsSource="{Binding Points}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:ParentCallPointItem">
|
||||
<CheckBox Content="{Binding Text}" IsChecked="{Binding IsDone}" Margin="0,3"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<TextBlock Text="Keine Gesprächspunkte geplant." Classes="emptyhint"
|
||||
IsVisible="{Binding !Points.Count}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Eindrücke / Ergänzungen" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding Impressions}" AcceptsReturn="True" Height="100" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid Grid.Row="1" ColumnDefinitions="*,8,*" Margin="0,20,0,0">
|
||||
<Button Grid.Column="0" Content="Abbrechen" HorizontalAlignment="Stretch" Click="OnCancel"/>
|
||||
<Button Grid.Column="2" Content="Protokoll speichern" HorizontalAlignment="Stretch" Click="OnSave"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,21 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using LehrerApp.Desktop.ViewModels.Students;
|
||||
|
||||
namespace LehrerApp.Desktop.Views.Students;
|
||||
|
||||
public partial class ParentCallSessionDialog : Window
|
||||
{
|
||||
public ParentCallSessionDialog() => InitializeComponent();
|
||||
|
||||
private void OnSave(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is ParentCallSessionViewModel vm)
|
||||
{
|
||||
vm.SaveProtocol();
|
||||
Close(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCancel(object? sender, RoutedEventArgs e) => Close(false);
|
||||
}
|
||||
@@ -131,6 +131,18 @@
|
||||
<ScrollViewer Padding="20">
|
||||
<StackPanel Spacing="20">
|
||||
<TextBlock Text="Notenentwicklung" FontSize="15" FontWeight="SemiBold"/>
|
||||
<StackPanel Orientation="Horizontal" Spacing="16">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<Border Width="10" Height="10" CornerRadius="2"
|
||||
Background="{DynamicResource SystemControlBackgroundAccentBrush}"/>
|
||||
<TextBlock Text="normal" FontSize="11" Opacity="0.6"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<Border Width="10" Height="10" CornerRadius="2" Background="#E53935"/>
|
||||
<TextBlock Text="Auffälligkeit (Notenabfall ≥ 1 Note oder mangelhaft/ungenügend)"
|
||||
FontSize="11" Opacity="0.6"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<ItemsControl ItemsSource="{Binding GradeHistory}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
@@ -160,6 +172,8 @@
|
||||
Classes.warning="{Binding IsWarning}"/>
|
||||
<TextBlock Text="{Binding Value}" FontSize="11" FontWeight="SemiBold"
|
||||
HorizontalAlignment="Center" Margin="0,3,0,0"/>
|
||||
<TextBlock Text="{Binding Label}" FontSize="9" Opacity="0.6"
|
||||
HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
<TextBlock Text="{Binding DateDisplay}" FontSize="9" Opacity="0.5"
|
||||
HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
@@ -188,27 +202,101 @@
|
||||
|
||||
<ContentPage Header="Dokumentation">
|
||||
<ScrollViewer Padding="20">
|
||||
<StackPanel>
|
||||
<StackPanel Spacing="16">
|
||||
|
||||
<!-- Fehlzeitenbilanz (5.2.2/5.2.3) — Auswertung der Anwesenheitsdaten aus der
|
||||
Mitarbeit-Erfassung, keine eigene Erfassung. -->
|
||||
<Border Background="{DynamicResource SystemControlBackgroundAltHighBrush}"
|
||||
CornerRadius="6" Padding="14,12" IsVisible="{Binding Attendance, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||
<StackPanel Spacing="6">
|
||||
<TextBlock Text="Fehlzeitenbilanz (laufendes Schuljahr)" FontSize="13" FontWeight="SemiBold"/>
|
||||
<TextBlock FontSize="12" Opacity="0.75">
|
||||
<Run Text="{Binding Attendance.TotalChecked}"/>
|
||||
<Run Text=" kontrollierte Stunden · "/>
|
||||
<Run Text="{Binding Attendance.Excused}"/>
|
||||
<Run Text=" entschuldigt · "/>
|
||||
<Run Text="{Binding Attendance.Unexcused}"/>
|
||||
<Run Text=" unentschuldigt · "/>
|
||||
<Run Text="{Binding Attendance.ExcusePending}"/>
|
||||
<Run Text=" Entschuldigung offen"/>
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="12" Foreground="Red" FontWeight="SemiBold"
|
||||
IsVisible="{Binding Attendance.ExceedsThreshold}">
|
||||
<Run Text="Fehlquote "/>
|
||||
<Run Text="{Binding Attendance.AbsenceRatePercent}"/>
|
||||
<Run Text=" % — über dem Schwellenwert von 20 %."/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Grid ColumnDefinitions="*,Auto,Auto">
|
||||
<TextBlock Grid.Column="0" Text="Einträge" FontSize="14" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
<Button Grid.Column="1" Content="Datenauskunft exportieren" FontSize="12" Padding="10,4"
|
||||
Margin="0,0,8,0" Command="{Binding ExportPersonalDataCommand}"
|
||||
ToolTip.Tip="Alle gespeicherten Daten dieses Schülers als JSON-Datei exportieren (Art. 15 DSGVO)"/>
|
||||
<Button Grid.Column="2" Content="+ Eintrag" Command="{Binding AddDocumentationCommand}"/>
|
||||
</Grid>
|
||||
<TextBlock Text="{Binding ExportStatus}" Foreground="Green" FontSize="12"
|
||||
IsVisible="{Binding ExportStatus, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
|
||||
<ItemsControl ItemsSource="{Binding Documentation}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="vm:DocEntry">
|
||||
<DataTemplate DataType="vm:DocumentationItem">
|
||||
<Border Background="{DynamicResource SystemControlBackgroundAltHighBrush}"
|
||||
CornerRadius="6" Padding="12,10" Margin="0,0,0,8">
|
||||
<Grid ColumnDefinitions="80,*,Auto">
|
||||
<TextBlock Grid.Column="0" Text="{Binding Date}" Opacity="0.5" FontSize="12"/>
|
||||
<StackPanel Grid.Column="1" Margin="8,0">
|
||||
<TextBlock Text="{Binding Title}" FontWeight="SemiBold" FontSize="13"/>
|
||||
<TextBlock Text="{Binding TypeLabel}" FontSize="11" Opacity="0.5"/>
|
||||
<StackPanel Spacing="4">
|
||||
<Grid ColumnDefinitions="80,*,Auto,Auto,Auto">
|
||||
<TextBlock Grid.Column="0" Text="{Binding DateDisplay}" Opacity="0.5" FontSize="12"/>
|
||||
<StackPanel Grid.Column="1" Margin="8,0">
|
||||
<TextBlock Text="{Binding Model.Title}" FontWeight="SemiBold" FontSize="13"
|
||||
IsVisible="{Binding IsRevealed}"/>
|
||||
<TextBlock Text="Vertraulich" FontWeight="SemiBold" FontSize="13" Opacity="0.6"
|
||||
IsVisible="{Binding !IsRevealed}"/>
|
||||
<TextBlock Text="{Binding TypeLabel}" FontSize="11" Opacity="0.5"/>
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Column="2" Text="🔒" FontSize="14" VerticalAlignment="Center"
|
||||
IsVisible="{Binding IsConfidential}" ToolTip.Tip="Vertraulich"/>
|
||||
<Button Grid.Column="3" Content="Anzeigen" FontSize="11" Padding="8,3" Margin="6,0,0,0"
|
||||
Command="{Binding RevealCommand}" IsVisible="{Binding !IsRevealed}"/>
|
||||
<StackPanel Grid.Column="4" Orientation="Horizontal" Spacing="4" Margin="6,0,0,0"
|
||||
IsVisible="{Binding IsRevealed}">
|
||||
<Button Content="Gespräch begleiten" FontSize="11" Padding="8,3"
|
||||
IsVisible="{Binding IsParentCall}"
|
||||
Command="{Binding $parent[ItemsControl].((vm:StudentDetailViewModel)DataContext).ConductParentCallCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
<Button Content="Bearbeiten" FontSize="11" Padding="8,3"
|
||||
Command="{Binding $parent[ItemsControl].((vm:StudentDetailViewModel)DataContext).EditDocumentationCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
<Button Content="Löschen" FontSize="11" Padding="8,3"
|
||||
Command="{Binding $parent[ItemsControl].((vm:StudentDetailViewModel)DataContext).DeleteDocumentationCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<TextBlock Text="{Binding Model.Content}" FontSize="12" TextWrapping="Wrap" Opacity="0.8"
|
||||
IsVisible="{Binding IsRevealed}"/>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" IsVisible="{Binding IsRevealed}">
|
||||
<TextBlock Text="{Binding StatusLabel}" FontSize="11" Opacity="0.55"
|
||||
IsVisible="{Binding StatusLabel, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
<TextBlock Text="📎 Anhang" FontSize="11" Opacity="0.55" IsVisible="{Binding HasAttachments}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Column="2" Text="🔒" FontSize="14"
|
||||
IsVisible="{Binding IsConfidential}"
|
||||
ToolTip.Tip="Vertraulich"/>
|
||||
</Grid>
|
||||
<ItemsControl ItemsSource="{Binding TagChips}" IsVisible="{Binding IsRevealed}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate><WrapPanel ItemSpacing="6" LineSpacing="4"/></ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="vm:TagChip">
|
||||
<Border Background="{Binding ColorHex}" CornerRadius="10" Padding="8,2">
|
||||
<TextBlock Text="{Binding Text}" FontSize="10" Foreground="White"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<TextBlock Text="Keine Dokumentation vorhanden." Opacity="0.4"
|
||||
<TextBlock Text="Keine Dokumentation vorhanden." Classes="emptyhint"
|
||||
IsVisible="{Binding !Documentation.Count}"/>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Platform.Storage;
|
||||
using LehrerApp.Core.Interfaces;
|
||||
using LehrerApp.Core.Models;
|
||||
using LehrerApp.Desktop.ViewModels.Students;
|
||||
using LehrerApp.Desktop.Views.Shared;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace LehrerApp.Desktop.Views.Students;
|
||||
|
||||
@@ -15,6 +19,10 @@ public partial class StudentDetailView : UserControl
|
||||
if (DataContext is not StudentDetailViewModel vm) return;
|
||||
vm.OnEditContact = ShowContactDialog;
|
||||
vm.OnViewAddress = ShowAddressViewer;
|
||||
vm.OnEditDocumentation = ShowDocumentationDialog;
|
||||
vm.OnConfirmDeleteDocumentation = ShowDeleteDocumentationDialog;
|
||||
vm.OnSaveExportFile = SaveExportFile;
|
||||
vm.OnConductParentCall = ShowParentCallSessionDialog;
|
||||
}
|
||||
|
||||
private async Task<Contact?> ShowContactDialog(Contact? contact)
|
||||
@@ -45,4 +53,57 @@ public partial class StudentDetailView : UserControl
|
||||
vm.ViewSelectedAddressCommand.CanExecute(null))
|
||||
vm.ViewSelectedAddressCommand.Execute(null);
|
||||
}
|
||||
|
||||
private async Task<Documentation?> ShowDocumentationDialog(Guid studentId, Documentation? editing)
|
||||
{
|
||||
var owner = TopLevel.GetTopLevel(this) as Window;
|
||||
if (owner is null) return null;
|
||||
|
||||
var vm = new DocumentationDialogViewModel(studentId, editing,
|
||||
App.Services.GetRequiredService<IAttachmentStorage>());
|
||||
var dialog = new DocumentationDialog { DataContext = vm };
|
||||
var saved = await dialog.ShowDialog<bool>(owner);
|
||||
if (!saved) vm.DiscardUnsavedAttachments();
|
||||
return saved ? vm.Result : null;
|
||||
}
|
||||
|
||||
private async Task<Documentation?> ShowParentCallSessionDialog(Documentation documentation, string studentTitle)
|
||||
{
|
||||
var owner = TopLevel.GetTopLevel(this) as Window;
|
||||
if (owner is null) return null;
|
||||
|
||||
var vm = new ParentCallSessionViewModel(documentation, studentTitle);
|
||||
var dialog = new ParentCallSessionDialog { DataContext = vm };
|
||||
var saved = await dialog.ShowDialog<bool>(owner);
|
||||
return saved ? vm.Result : null;
|
||||
}
|
||||
|
||||
private async Task<bool> ShowDeleteDocumentationDialog(DocumentationItem item)
|
||||
{
|
||||
var info = new ConfirmDialogInfo
|
||||
{
|
||||
Title = "Eintrag löschen?",
|
||||
Message = $"\"{item.Model.Title}\" wird als gelöscht markiert und nicht mehr angezeigt.",
|
||||
ConfirmText = "Löschen",
|
||||
};
|
||||
var dialog = new ConfirmDialog { DataContext = info };
|
||||
var owner = TopLevel.GetTopLevel(this) as Window;
|
||||
return owner is not null && await dialog.ShowDialog<bool>(owner);
|
||||
}
|
||||
|
||||
private async Task SaveExportFile(string json)
|
||||
{
|
||||
var topLevel = TopLevel.GetTopLevel(this);
|
||||
if (topLevel is null || DataContext is not StudentDetailViewModel vm || vm.Student is null) return;
|
||||
|
||||
var file = await topLevel.StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions
|
||||
{
|
||||
Title = "Datenauskunft exportieren",
|
||||
SuggestedFileName = $"Datenauskunft_{vm.Student.LastName}_{vm.Student.FirstName}.json",
|
||||
FileTypeChoices = [new FilePickerFileType("JSON-Dateien") { Patterns = ["*.json"] }],
|
||||
});
|
||||
|
||||
if (file is null) return;
|
||||
await File.WriteAllTextAsync(file.Path.LocalPath, json);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user