Files
LehrerApp/LehrerApp.Desktop/Views/Planning/UntisMappingReviewDialog.axaml
T
adminandClaude Sonnet 5 4eb4d0a946 WIP (unstable): WebUntis-iCal-Abgleich für Vertretungen/Ausfälle
Erkennt Vertretungen, Ausfälle und Zusatzaufsichten aus dem persönlichen
WebUntis-iCal-Feed und schreibt sie automatisch als SubstitutionEntry.
Bekannter offener Bug: es tauchen weiterhin falsche Vertretungen für
Stunden auf, die real unverändert sind — wird in einem Folge-Commit
untersucht, deshalb vorerst auf diesem Branch statt main.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-23 13:30:15 +02:00

89 lines
4.7 KiB
XML

<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Planning"
x:Class="LehrerApp.Desktop.Views.Planning.UntisMappingReviewDialog"
x:DataType="vm:UntisMappingReviewDialogViewModel"
Title="WebUntis-Zuordnung prüfen"
Width="560" Height="620" MinWidth="480" MinHeight="440"
CanResize="True" WindowStartupLocation="CenterOwner">
<Window.Styles>
<Style Selector="TextBlock.hint">
<Setter Property="FontSize" Value="11"/>
<Setter Property="Opacity" Value="0.6"/>
</Style>
</Window.Styles>
<Grid RowDefinitions="*,Auto" Margin="24">
<ScrollViewer Grid.Row="0">
<StackPanel Spacing="14" Margin="0,0,12,0">
<TextBlock Text="WebUntis-Zuordnung prüfen" Classes="dialogtitle"/>
<TextBlock FontSize="12" Opacity="0.6" TextWrapping="Wrap"
Text="Erkannte reguläre Wochenmuster aus dem iCal-Feed — nur bestätigte Zeilen (mit ausgewählter Gruppe) lösen künftig automatisch erkannte Vertretungen/Ausfälle aus."/>
<TextBlock Text="Abgleich läuft…" IsVisible="{Binding IsLoading}" FontSize="13"/>
<TextBlock Text="{Binding ErrorMessage}" Foreground="Red" FontSize="12"
IsVisible="{Binding ErrorMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
<ItemsControl ItemsSource="{Binding Rows}" IsVisible="{Binding !IsLoading}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:UntisMappingRow">
<Border Background="{DynamicResource SystemControlBackgroundAltHighBrush}"
CornerRadius="6" Padding="10,8" Margin="0,0,0,6">
<Grid ColumnDefinitions="Auto,*,Auto">
<StackPanel Grid.Column="0" Width="60">
<TextBlock Text="{Binding WeekdayLabel}" FontWeight="SemiBold" FontSize="13"/>
<TextBlock Text="{Binding TimeLabel}" Classes="hint" TextWrapping="Wrap"/>
</StackPanel>
<StackPanel Grid.Column="1" Margin="8,0" VerticalAlignment="Center">
<TextBlock Text="{Binding PatternLabel}" FontSize="13"/>
<TextBlock Text="Mehrdeutig — bitte Gruppe wählen oder ignorieren" Classes="hint"
Foreground="#F59E0B"
IsVisible="{Binding !IsConfident}"/>
</StackPanel>
<ComboBox Grid.Column="2" Width="190" VerticalAlignment="Center"
IsVisible="{Binding !IsSupervisionCandidate}"
ItemsSource="{Binding $parent[ItemsControl].((vm:UntisMappingReviewDialogViewModel)DataContext).Groups}"
SelectedItem="{Binding SelectedGroup}"
IsEnabled="{Binding CanResolve}"
PlaceholderText="Ignorieren">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="vm:UntisGroupOption">
<TextBlock Text="{Binding DisplayLabel}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<CheckBox Grid.Column="2" Content="Als Aufsicht bestätigen" VerticalAlignment="Center"
IsVisible="{Binding IsSupervisionCandidate}"
IsChecked="{Binding ConfirmAsSupervision}"
IsEnabled="{Binding CanResolve}"/>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Keine regulären Wochenmuster im Feed gefunden." Classes="emptyhint"
IsVisible="{Binding HasNoRows}"/>
<StackPanel Spacing="4" IsVisible="{Binding HasUnmatchedSlots}">
<Separator Margin="0,4"/>
<TextBlock Text="Stundenplan-Einträge ohne passendes WebUntis-Muster:" FontSize="12" FontWeight="SemiBold"/>
<ItemsControl ItemsSource="{Binding UnmatchedSlotLabels}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" FontSize="12" Opacity="0.75" Margin="0,2"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</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="Speichern" HorizontalAlignment="Stretch" Click="OnSave"
IsEnabled="{Binding !IsLoading}"/>
</Grid>
</Grid>
</Window>