Neuer Stundenplan mit "Heute"-Standardansicht (Tagesliste unten angedockt, gruppenübergreifendes Wochenraster mit Fach/Klasse/Raum/Thema, Vor-/Zurück- Navigation zwischen Kalenderwochen) und separatem Bearbeiten-Raster für die wöchentliche Zuordnung. Badges für Ferien-/Klausur-Nähe und ausgegraute Ferientage direkt im Plan statt einer separaten Liste. Ferien-/Feiertage- Pflege (Bundesland, Schulferien) sitzt jetzt in den Einstellungen statt im Stundenplan selbst. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using System.Text.Json;
|
|
using LehrerApp.Core.Models;
|
|
|
|
namespace LehrerApp.Core.Services;
|
|
|
|
internal class SchoolCalendarConfig
|
|
{
|
|
public GermanState State { get; set; } = GermanState.NW;
|
|
}
|
|
|
|
/// <summary>Welches Bundesland für die Feiertagsberechnung (4.3.5) gilt.</summary>
|
|
public class SchoolCalendarSettingsService
|
|
{
|
|
private readonly string _configPath;
|
|
private SchoolCalendarConfig _config;
|
|
|
|
public GermanState State => _config.State;
|
|
|
|
public SchoolCalendarSettingsService(string appDataPath)
|
|
{
|
|
_configPath = Path.Combine(appDataPath, "schoolcalendar.json");
|
|
_config = Load();
|
|
}
|
|
|
|
public void SetState(GermanState state)
|
|
{
|
|
_config.State = state;
|
|
File.WriteAllText(_configPath, JsonSerializer.Serialize(_config));
|
|
}
|
|
|
|
private SchoolCalendarConfig Load()
|
|
{
|
|
try
|
|
{
|
|
if (File.Exists(_configPath))
|
|
return JsonSerializer.Deserialize<SchoolCalendarConfig>(File.ReadAllText(_configPath))
|
|
?? new SchoolCalendarConfig();
|
|
}
|
|
catch { /* beschädigte Konfiguration -> Standardwert */ }
|
|
return new SchoolCalendarConfig();
|
|
}
|
|
}
|