added teacher-focused lesson sheet with direct class and teacher timetable links
This commit is contained in:
@@ -188,6 +188,27 @@ class AppModule {
|
||||
return order;
|
||||
}
|
||||
|
||||
/// Modules that are of no use to teachers and start out hidden for them.
|
||||
static const Set<Modules> hiddenForTeachersByDefault = {
|
||||
Modules.absenceReport,
|
||||
};
|
||||
|
||||
/// Hides [hiddenForTeachersByDefault] once for teacher accounts; the teacher
|
||||
/// can re-enable them in the module settings. Returns whether [settings]
|
||||
/// changed.
|
||||
static bool applyTeacherDefaults(
|
||||
ModulesSettings settings, {
|
||||
required bool isTeacher,
|
||||
}) {
|
||||
if (!isTeacher || settings.teacherDefaultsApplied) return false;
|
||||
settings.hiddenModules = {
|
||||
...settings.hiddenModules,
|
||||
...hiddenForTeachersByDefault,
|
||||
}.toList();
|
||||
settings.teacherDefaultsApplied = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// The settings list displays a capability-filtered subset, so reorder
|
||||
// indices refer to that subset; the move is applied there and merged back
|
||||
// into the full order (non-displayed modules keep their relative slots).
|
||||
|
||||
Reference in New Issue
Block a user