Add warning detail popup and quick blocks for Vorgänge
CI / build-and-test (push) Canceled after 0s

Dashboard warnings (attendance, homework, lateness) get a "Details" flyout
with key figures, a list of dates and the compact month calendar from the
class teacher overview, now extracted as a shared control. The calendar
now aligns days under their weekday (Mo-So header, blank leading cells).

Creating Vorgänge and documentation is supported by quick blocks with the
current figures, dated standard phrases (e.g. "Klassenleitung informiert")
and documentation templates (status snapshot, conversation, informing the
class/subject teachers, parent call, parent letter). The class teacher
Vorgänge tab uses WebUntis figures (absences across all subjects, class
register) for the same blocks and templates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5.5 committed 2026-09-26 11:16:13 +02:00
1 parent 0f6cadc9c8
commit aa326cf8b6
25 files changed
+1571 -75

No files matched your search

@@ -126,10 +126,36 @@
</ItemsControl>
<TextBlock Text="Noch keine Dokumentation verknüpft." FontSize="11" Opacity="0.5"
IsVisible="{Binding !HasLinkedDocumentation}"/>
<Button Content="+ Neue Dokumentation anlegen" FontSize="11" Padding="8,3"
HorizontalAlignment="Left"
Command="{Binding $parent[ItemsControl].((vm:ClassTeacherCasesViewModel)DataContext).CreateAndLinkDocumentationCommand}"
CommandParameter="{Binding}"/>
<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" IsVisible="{Binding HasAvailableDocumentation}">
@@ -27,7 +27,10 @@ public partial class ClassTeacherCasesView : UserControl
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is null) return null;
var vm = new VorgangDialogViewModel(rosterStudents, editing);
var cases = DataContext as ClassTeacherCasesViewModel;
var vm = new VorgangDialogViewModel(rosterStudents, editing,
phraseBlocks: VorgangPhraseBlocks.ForClassTeacher(DateOnly.FromDateTime(DateTime.Today)),
studentQuickBlocks: cases is null ? null : cases.QuickBlocksFor);
var dialog = new VorgangDialog { DataContext = vm };
var saved = await dialog.ShowDialog<bool>(owner);
return saved ? vm.Result : null;
@@ -53,8 +56,10 @@ public partial class ClassTeacherCasesView : UserControl
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is null) return null;
var isNewDraft = editing is not null
&& (DataContext as ClassTeacherCasesViewModel)?.IsNewDocumentationDraft(editing) == true;
var vm = new DocumentationDialogViewModel(defaultStudentId, editing,
App.Services.GetRequiredService<IAttachmentStorage>(), studentOptions);
App.Services.GetRequiredService<IAttachmentStorage>(), studentOptions, isNewDraft: isNewDraft);
var dialog = new DocumentationDialog { DataContext = vm };
var saved = await dialog.ShowDialog<bool>(owner);
if (!saved) vm.DiscardUnsavedAttachments();
@@ -2,6 +2,7 @@
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"
xmlns:shared="clr-namespace:LehrerApp.Desktop.Views.Shared"
xmlns:conv="clr-namespace:LehrerApp.Desktop.Converters"
x:Class="LehrerApp.Desktop.Views.ClassTeacher.ClassTeacherOverviewView"
x:DataType="vm:ClassTeacherOverviewViewModel">
@@ -98,19 +99,6 @@
<Style Selector="Border.statusFill.danger">
<Setter Property="Background" Value="{DynamicResource AppStatusDangerBrush}"/>
</Style>
<Style Selector="Border.compactDay">
<Setter Property="Width" Value="28"/>
<Setter Property="Height" Value="28"/>
<Setter Property="CornerRadius" Value="6"/>
<Setter Property="Background" Value="{DynamicResource AppChipBackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource AppCardBorderBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="2"/>
</Style>
<Style Selector="Border.compactDay.today">
<Setter Property="BorderBrush" Value="{DynamicResource AppAccentTextBrush}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
</UserControl.Styles>
<UserControl.Resources>
@@ -424,7 +412,9 @@
<!-- Verdichtete Monatsansicht: exakt eine Zelle je Kalendertag. Ohne Ereignis
bleibt nur die Tageszahl sichtbar; bei Auffälligkeiten ersetzt das stärkste
Statuskürzel die Zahl. Alle Details bleiben per Tooltip und Drill-down erhalten. -->
Statuskürzel die Zahl. Alle Details bleiben per Tooltip und Drill-down erhalten.
Das Widget selbst liegt in Views/Shared/CompactMonthCalendar (auch im
Detail-Popup der Dashboard-Warnungen genutzt). -->
<Border Classes="sidePanel">
<StackPanel Spacing="8">
<Grid ColumnDefinitions="*,Auto">
@@ -441,29 +431,7 @@
DisplayMemberBinding="{Binding DisplayName}"
HorizontalAlignment="Stretch"
AutomationProperties.Name="Schüler für Monatskalender auswählen"/>
<ItemsControl ItemsSource="{Binding CompactMonthDays}" HorizontalAlignment="Center">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate><UniformGrid Columns="7"/></ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:ClassTeacherCompactCalendarDay">
<Border Classes="compactDay" Classes.today="{Binding IsToday}"
ToolTip.Tip="{Binding Tooltip}">
<Grid>
<TextBlock Text="{Binding DayNumber}" FontSize="11" Opacity="0.7"
HorizontalAlignment="Center" VerticalAlignment="Center"
IsVisible="{Binding !HasSignal}"/>
<Border Background="{Binding SignalColorHex}" CornerRadius="5"
IsVisible="{Binding HasSignal}">
<TextBlock Text="{Binding SignalCode}" Foreground="White" FontSize="11"
FontWeight="Bold" HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<shared:CompactMonthCalendar Days="{Binding CompactMonthDays}"/>
<TextBlock Text="U unentsch. · ! Klassenbuch · A abwesend · V verspätet · E entsch."
FontSize="9" Opacity="0.5" TextWrapping="Wrap"/>
</StackPanel>
@@ -1,10 +1,11 @@
<Window 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.VorgangDialog"
x:DataType="vm:VorgangDialogViewModel"
Title="{Binding DialogTitle}"
Width="480" SizeToContent="Height" MinHeight="360"
Width="560" SizeToContent="Height" MinHeight="360" MaxHeight="860"
CanResize="True" WindowStartupLocation="CenterOwner">
<Grid RowDefinitions="*,Auto" Margin="24">
@@ -21,8 +22,44 @@
<StackPanel Spacing="4">
<TextBlock Text="Beschreibung" FontSize="12" Opacity="0.7"/>
<TextBox Text="{Binding Description}" AcceptsReturn="True" Height="90" TextWrapping="Wrap"
<TextBox Text="{Binding Description}" AcceptsReturn="True" Height="120" TextWrapping="Wrap"
PlaceholderText="Worum geht es? Was ist bisher passiert?"/>
<!-- Nutzer-Feedback: Fehlquoten etc. nicht von Hand abtippen — Bausteine mit dem aktuellen
Stand werden an die Beschreibung angehängt (nicht ersetzt). -->
<StackPanel Spacing="4" IsVisible="{Binding HasQuickBlocks}" Margin="0,2,0,0">
<TextBlock Text="Schnellbausteine (aktueller Stand einfügen)" FontSize="11" Opacity="0.6"/>
<ItemsControl ItemsSource="{Binding QuickBlocks}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate><WrapPanel ItemSpacing="6" LineSpacing="6"/></ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="svm:VorgangQuickBlock">
<Button Content="{Binding Label, StringFormat='+ {0}'}" FontSize="11" Padding="8,3"
ToolTip.Tip="{Binding Text}"
Command="{Binding $parent[ItemsControl].((vm:VorgangDialogViewModel)DataContext).InsertQuickBlockCommand}"
CommandParameter="{Binding}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<!-- Nutzer-Feedback: "den Klassenlehrer informiert" & Co. nicht jedes Mal tippen —
datumsgestempelte Verlaufszeile, angehängt statt ersetzt. -->
<StackPanel Spacing="4" IsVisible="{Binding HasPhraseBlocks}" Margin="0,2,0,0">
<TextBlock Text="Standardformulierungen (mit heutigem Datum)" FontSize="11" Opacity="0.6"/>
<ItemsControl ItemsSource="{Binding PhraseBlocks}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate><WrapPanel ItemSpacing="6" LineSpacing="6"/></ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="svm:VorgangQuickBlock">
<Button Content="{Binding Label}" FontSize="11" Padding="8,3"
ToolTip.Tip="{Binding Text}"
Command="{Binding $parent[ItemsControl].((vm:VorgangDialogViewModel)DataContext).InsertPhraseCommand}"
CommandParameter="{Binding}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</StackPanel>
<StackPanel Spacing="6">
@@ -1,6 +1,7 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels"
xmlns:shared="clr-namespace:LehrerApp.Desktop.Views.Shared"
x:Class="LehrerApp.Desktop.Views.Dashboard.DashboardView"
x:DataType="vm:DashboardViewModel">
@@ -544,18 +545,33 @@
</StackPanel>
</Button>
</Grid>
<ItemsControl ItemsSource="{Binding Actions}" Margin="13,4,0,0"
IsVisible="{Binding HasActions}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate><StackPanel Orientation="Horizontal" Spacing="4"/></ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:AttentionAction">
<Button Content="{Binding Label}" FontSize="11" Padding="7,3"
Command="{Binding Command}" CommandParameter="{Binding Parameter}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<StackPanel Orientation="Horizontal" Spacing="4" Margin="13,4,0,0"
IsVisible="{Binding HasFooter}">
<!-- Nutzer-Feedback: im Eintrag mehr erfahren, ohne erst ins Schülerdetail
zu springen. Per Klick (Flyout) statt Hover-Tooltip, weil ein Klick
auf die Zeile selbst bereits in den Vorgänge-Tab navigiert und das
Popup einen blätterbaren Monatskalender enthält. Detail wird erst
beim Öffnen berechnet (siehe AttentionItem.Detail). -->
<Button Content="Details ▾" FontSize="11" Padding="7,3" IsVisible="{Binding HasDetail}"
ToolTip.Tip="Fehlzeiten, Verspätungen bzw. offene Hausaufgaben im Überblick">
<Button.Flyout>
<Flyout Placement="BottomEdgeAlignedLeft">
<shared:StudentWarningDetailView DataContext="{Binding Detail}"/>
</Flyout>
</Button.Flyout>
</Button>
<ItemsControl ItemsSource="{Binding Actions}" IsVisible="{Binding HasActions}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate><StackPanel Orientation="Horizontal" Spacing="4"/></ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:AttentionAction">
<Button Content="{Binding Label}" FontSize="11" Padding="7,3"
Command="{Binding Command}" CommandParameter="{Binding Parameter}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
@@ -0,0 +1,67 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:LehrerApp.Desktop.Views.Shared"
x:Class="LehrerApp.Desktop.Views.Shared.CompactMonthCalendar"
x:Name="Root">
<!-- Verdichtete Monatsansicht: exakt eine Zelle je Kalendertag, nach Wochentag ausgerichtet
(Leerzellen vor dem 1., siehe CompactMonthCalendar.BuildCells). Ohne Ereignis bleibt nur die
Tageszahl sichtbar; bei Auffälligkeiten ersetzt das stärkste Statuskürzel die Zahl. Alle
Details bleiben per Tooltip erhalten. Aus ClassTeacherOverviewView herausgelöst, damit das
Detail-Popup der Dashboard-Warnungen dasselbe Widget wiederverwendet. -->
<UserControl.Styles>
<Style Selector="Border.compactDay">
<Setter Property="Width" Value="28"/>
<Setter Property="Height" Value="28"/>
<Setter Property="CornerRadius" Value="6"/>
<Setter Property="Background" Value="{DynamicResource AppChipBackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource AppCardBorderBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="2"/>
</Style>
<Style Selector="Border.compactDay.today">
<Setter Property="BorderBrush" Value="{DynamicResource AppAccentTextBrush}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
</UserControl.Styles>
<StackPanel HorizontalAlignment="Center">
<ItemsControl ItemsSource="{x:Static local:CompactMonthCalendar.WeekdayHeaders}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate><UniformGrid Columns="7"/></ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" FontSize="9" FontWeight="Bold" Opacity="0.5"
Width="32" TextAlignment="Center"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ItemsControl ItemsSource="{Binding #Root.Cells}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate><UniformGrid Columns="7"/></ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="local:CompactMonthCell">
<Panel Width="32" Height="32">
<Border Classes="compactDay" Classes.today="{Binding Day.IsToday, FallbackValue=False}"
IsVisible="{Binding IsDay}" ToolTip.Tip="{Binding Day.Tooltip}">
<Grid>
<TextBlock Text="{Binding Day.DayNumber}" FontSize="11" Opacity="0.7"
HorizontalAlignment="Center" VerticalAlignment="Center"
IsVisible="{Binding !Day.HasSignal, FallbackValue=False}"/>
<Border Background="{Binding Day.SignalColorHex}" CornerRadius="5"
IsVisible="{Binding Day.HasSignal, FallbackValue=False}">
<TextBlock Text="{Binding Day.SignalCode}" Foreground="White" FontSize="11"
FontWeight="Bold" HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</Grid>
</Border>
</Panel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</UserControl>
@@ -0,0 +1,78 @@
using System.Collections;
using System.Collections.Specialized;
using Avalonia;
using Avalonia.Controls;
using LehrerApp.Desktop.ViewModels.ClassTeacher;
namespace LehrerApp.Desktop.Views.Shared;
/// <summary>Eine Rasterzelle des kompakten Monatskalenders; <see cref="Day"/> ist null für die
/// Leerzellen vor dem Monatsersten.</summary>
public sealed record CompactMonthCell(ClassTeacherCompactCalendarDay? Day)
{
public bool IsPlaceholder => Day is null;
public bool IsDay => Day is not null;
}
/// <summary>Kompakter Monatskalender (eine Zelle je Tag, Statuskürzel statt Tageszahl) — erwartet
/// <see cref="ClassTeacherCompactCalendarDay"/>-Einträge in <see cref="Days"/>, genau einen je
/// Kalendertag ab dem Monatsersten. Genutzt von der Klassenlehrer-Übersicht und dem Detail-Popup der
/// Dashboard-Warnungen.
/// Nutzer-Feedback: vorher begann jeder Monat oben links, der 1. stand also unabhängig vom
/// Wochentag in der Montags-Spalte. Die Ausrichtung passiert bewusst hier in der Anzeige (Leerzellen
/// vor dem Monatsersten + Kopfzeile Mo–So) statt in den beiden Buildern — deren Ergebnis bleibt
/// "ein Eintrag je Kalendertag" und damit für Tests/Aufrufer unverändert.</summary>
public partial class CompactMonthCalendar : UserControl
{
public static readonly StyledProperty<IEnumerable?> DaysProperty =
AvaloniaProperty.Register<CompactMonthCalendar, IEnumerable?>(nameof(Days));
public static readonly DirectProperty<CompactMonthCalendar, IReadOnlyList<CompactMonthCell>> CellsProperty =
AvaloniaProperty.RegisterDirect<CompactMonthCalendar, IReadOnlyList<CompactMonthCell>>(nameof(Cells), c => c.Cells);
public static string[] WeekdayHeaders { get; } = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"];
private IReadOnlyList<CompactMonthCell> _cells = [];
private INotifyCollectionChanged? _observed;
public IEnumerable? Days
{
get => GetValue(DaysProperty);
set => SetValue(DaysProperty, value);
}
public IReadOnlyList<CompactMonthCell> Cells
{
get => _cells;
private set => SetAndRaise(CellsProperty, ref _cells, value);
}
public CompactMonthCalendar() => InitializeComponent();
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
{
base.OnPropertyChanged(change);
if (change.Property != DaysProperty) return;
// Beide Aufrufer befüllen eine ObservableCollection per Clear/Add neu (Monat blättern,
// Schülerauswahl) — deshalb auf Änderungen der Sammlung selbst lauschen, nicht nur auf
// einen neuen Days-Wert.
if (_observed is not null) _observed.CollectionChanged -= OnDaysCollectionChanged;
_observed = Days as INotifyCollectionChanged;
if (_observed is not null) _observed.CollectionChanged += OnDaysCollectionChanged;
RebuildCells();
}
private void OnDaysCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) => RebuildCells();
private void RebuildCells() => Cells = BuildCells(Days?.OfType<ClassTeacherCompactCalendarDay>() ?? []);
public static IReadOnlyList<CompactMonthCell> BuildCells(IEnumerable<ClassTeacherCompactCalendarDay> days)
{
var list = days.ToList();
if (list.Count == 0) return [];
var leading = ((int)list[0].Date.DayOfWeek + 6) % 7; // Montag = 0 … Sonntag = 6
return Enumerable.Repeat(new CompactMonthCell(null), leading)
.Concat(list.Select(d => new CompactMonthCell(d)))
.ToList();
}
}
@@ -0,0 +1,70 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels"
xmlns:svc="clr-namespace:LehrerApp.Desktop.Services"
xmlns:shared="clr-namespace:LehrerApp.Desktop.Views.Shared"
x:Class="LehrerApp.Desktop.Views.Shared.StudentWarningDetailView"
x:DataType="vm:StudentWarningDetailViewModel"
Width="320">
<!-- Inhalt des "Details"-Popups einer Dashboard-Warnung (Fehlzeiten/Hausaufgaben/Verspätungen). -->
<StackPanel Spacing="10">
<StackPanel Spacing="2">
<TextBlock Text="{Binding Header}" FontSize="14" FontWeight="SemiBold"/>
<TextBlock Text="{Binding Summary}" FontSize="11" Opacity="0.65" TextWrapping="Wrap"/>
</StackPanel>
<ItemsControl ItemsSource="{Binding Figures}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate><WrapPanel ItemSpacing="6" LineSpacing="6"/></ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:WarningDetailFigure">
<Border Background="{DynamicResource AppChipBackgroundBrush}" CornerRadius="6" Padding="8,4">
<StackPanel>
<TextBlock Text="{Binding Value}" FontSize="15" FontWeight="SemiBold"/>
<TextBlock Text="{Binding Label}" FontSize="10" Opacity="0.6"/>
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Grid ColumnDefinitions="Auto,*,Auto">
<Button Grid.Column="0" Content="‹" Padding="8,2" Command="{Binding PreviousMonthCommand}"
ToolTip.Tip="Vorheriger Monat" AutomationProperties.Name="Vorheriger Monat"/>
<TextBlock Grid.Column="1" Text="{Binding MonthLabel}" FontSize="12" FontWeight="SemiBold"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Button Grid.Column="2" Content="›" Padding="8,2" Command="{Binding NextMonthCommand}"
ToolTip.Tip="Nächster Monat" AutomationProperties.Name="Nächster Monat"/>
</Grid>
<shared:CompactMonthCalendar Days="{Binding CalendarDays}"/>
<TextBlock Text="{Binding Legend}" FontSize="9" Opacity="0.5" TextWrapping="Wrap"/>
<StackPanel Spacing="3" IsVisible="{Binding HasEvents}">
<TextBlock Text="{Binding ListHeader}" FontSize="11" FontWeight="SemiBold" Opacity="0.7"/>
<ItemsControl ItemsSource="{Binding Events}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="svc:StudentEvidenceEvent">
<Grid ColumnDefinitions="18,62,*" Margin="0,1">
<Border Width="14" Height="14" CornerRadius="7" Background="{Binding ColorHex}"
VerticalAlignment="Center">
<TextBlock Text="{Binding Code}" Foreground="White" FontSize="8" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock Grid.Column="1" Text="{Binding DateLabel}" FontSize="11" Opacity="0.65"
VerticalAlignment="Center"/>
<TextBlock Grid.Column="2" FontSize="11" TextTrimming="CharacterEllipsis" VerticalAlignment="Center"
ToolTip.Tip="{Binding ListLine}">
<Run Text="{Binding GroupName}" FontWeight="SemiBold"/>
<Run Text=" · "/>
<Run Text="{Binding Label}"/>
</TextBlock>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="{Binding MoreEventsHint}" FontSize="10" Opacity="0.55" IsVisible="{Binding HasMoreEvents}"/>
</StackPanel>
</StackPanel>
</UserControl>
@@ -0,0 +1,8 @@
using Avalonia.Controls;
namespace LehrerApp.Desktop.Views.Shared;
public partial class StudentWarningDetailView : UserControl
{
public StudentWarningDetailView() => InitializeComponent();
}
@@ -122,10 +122,36 @@
</ItemsControl>
<TextBlock Text="Noch keine Dokumentation verknüpft." FontSize="11" Opacity="0.5"
IsVisible="{Binding !HasLinkedDocumentation}"/>
<Button Content="+ Neue Dokumentation anlegen" FontSize="11" Padding="8,3"
HorizontalAlignment="Left"
Command="{Binding $parent[ItemsControl].((svm:StudentVorgaengeViewModel)DataContext).CreateAndLinkDocumentationCommand}"
CommandParameter="{Binding}"/>
<StackPanel Orientation="Horizontal" Spacing="6">
<Button Content="+ Neue Dokumentation anlegen" FontSize="11" Padding="8,3"
Command="{Binding $parent[ItemsControl].((svm:StudentVorgaengeViewModel)DataContext).CreateAndLinkDocumentationCommand}"
CommandParameter="{Binding}"/>
<!-- Nutzer-Feedback: standardisierte Einträge statt alles von Hand — jede
Vorlage öffnet den normalen Dokumentations-Dialog vorbefüllt mit dem
aktuellen Stand (Zahlen, Termine), gespeichert wird erst dort. -->
<Button Content="+ Aus Vorlage ▾" FontSize="11" Padding="8,3"
IsVisible="{Binding HasDocumentationTemplates}">
<Button.Flyout>
<MenuFlyout>
<MenuItem Header="Fehlzeiten-Stand festhalten"
Command="{Binding CreateFromTemplateCommand}" CommandParameter="attendance"/>
<MenuItem Header="Hausaufgaben-Stand festhalten"
Command="{Binding CreateFromTemplateCommand}" CommandParameter="homework"/>
<MenuItem Header="Verspätungs-Stand festhalten"
Command="{Binding CreateFromTemplateCommand}" CommandParameter="lateness"/>
<Separator/>
<MenuItem Header="Gespräch mit Schüler*in"
Command="{Binding CreateFromTemplateCommand}" CommandParameter="conversation"/>
<MenuItem Header="Klassenleitung informieren"
Command="{Binding CreateFromTemplateCommand}" CommandParameter="informclassteacher"/>
<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" IsVisible="{Binding HasAvailableDocumentation}">
@@ -29,7 +29,10 @@ public partial class StudentVorgaengeTabView : UserControl
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is null) return null;
var vm = new VorgangDialogViewModel(students, editing);
var tab = DataContext as StudentVorgaengeViewModel;
var vm = new VorgangDialogViewModel(students, editing, tab?.BuildQuickBlocks(),
isNewDraft: editing is not null && tab?.IsPersisted(editing) == false,
phraseBlocks: VorgangPhraseBlocks.ForStudent(DateOnly.FromDateTime(DateTime.Today)));
var dialog = new VorgangDialog { DataContext = vm };
var saved = await dialog.ShowDialog<bool>(owner);
return saved ? vm.Result : null;
@@ -54,8 +57,10 @@ public partial class StudentVorgaengeTabView : UserControl
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is null) return null;
var isNewDraft = editing is not null
&& (DataContext as StudentVorgaengeViewModel)?.IsNewDocumentationDraft(editing) == true;
var vm = new DocumentationDialogViewModel(studentId, editing,
App.Services.GetRequiredService<IAttachmentStorage>());
App.Services.GetRequiredService<IAttachmentStorage>(), isNewDraft: isNewDraft);
var dialog = new DocumentationDialog { DataContext = vm };
var saved = await dialog.ShowDialog<bool>(owner);
if (!saved) vm.DiscardUnsavedAttachments();