Add student-level Vorgänge tab and homework/lateness dashboard warnings
CI / build-and-test (push) Canceled after 0s

Dashboard warnings (attendance, and now homework backlog and lateness) apply
across all classes, but the existing Vorgänge case-file tab only works for
the teacher's own class since it resolves the WebUntis classbook roster.
Instead of loosening that coupling, students get their own narrower
Vorgänge tab, and all three cross-class warnings now jump straight there,
offering to open a matching case or create a new one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Sonnet 5 committed 2026-09-25 23:55:54 +02:00
1 parent 4b73d2bea2
commit 3270b48850
16 files changed
+963 -21

No files matched your search

@@ -0,0 +1,77 @@
using Avalonia.Controls;
using LehrerApp.Core.Interfaces;
using LehrerApp.Core.Models;
using LehrerApp.Desktop.Services;
using LehrerApp.Desktop.ViewModels.ClassTeacher;
using LehrerApp.Desktop.ViewModels.Students;
using LehrerApp.Desktop.Views.ClassTeacher;
using LehrerApp.Desktop.Views.Shared;
using Microsoft.Extensions.DependencyInjection;
namespace LehrerApp.Desktop.Views.Students;
public partial class StudentVorgaengeTabView : UserControl
{
public StudentVorgaengeTabView() => InitializeComponent();
protected override void OnDataContextChanged(EventArgs e)
{
base.OnDataContextChanged(e);
if (DataContext is not StudentVorgaengeViewModel vm) return;
vm.OnEditVorgang = ShowVorgangDialog;
vm.OnConfirmDeleteVorgang = ShowDeleteVorgangDialog;
vm.OnEditDocumentation = ShowDocumentationDialog;
vm.OnConfirmCreateForWarning = ShowConfirmCreateDialog;
}
private async Task<Vorgang?> ShowVorgangDialog(List<StudentOption> students, Vorgang? editing)
{
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is null) return null;
var vm = new VorgangDialogViewModel(students, editing);
var dialog = new VorgangDialog { DataContext = vm };
var saved = await dialog.ShowDialog<bool>(owner);
return saved ? vm.Result : null;
}
private async Task<bool> ShowDeleteVorgangDialog(VorgangItem item)
{
var info = new ConfirmDialogInfo
{
Title = "Vorgang löschen?",
Message = $"\"{item.Model.Title}\" wird als gelöscht markiert und nicht mehr angezeigt. " +
"Verknüpfte Dokumentation bleibt erhalten.",
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<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<bool> ShowConfirmCreateDialog(string suggestedTag)
{
var info = new ConfirmDialogInfo
{
Title = "Neuen Vorgang anlegen?",
Message = $"Kein offener Vorgang zu \"{suggestedTag}\" gefunden. Neuen anlegen?",
ConfirmText = "Anlegen",
};
var dialog = new ConfirmDialog { DataContext = info };
var owner = TopLevel.GetTopLevel(this) as Window;
return owner is not null && await dialog.ShowDialog<bool>(owner);
}
}