Adopt SummerCMS v0.1.1 admin features

Datepickers on native time.Time / lagoon.Date fields, file uploads on
materials, readings and class sessions managed from the course form
(course_id made nullable).
This commit is contained in:
Jakub Zych
2026-10-03 06:03:34 +02:00
parent ac2e2ddd7b
commit 71b848a376
39 changed files with 475 additions and 373 deletions

View File

@@ -32,8 +32,11 @@ func bounds(in map[string]any, lower time.Time) (time.Time, *time.Time) {
return lower, nil
}
// preloadSession queries the class sessions students see, with their course
// and meeting. A session without a course is still pending on an unsaved
// course form and is left out.
func preloadSession(q *gorm.DB) *gorm.DB {
return q.Preload("Course").Preload("Meeting")
return q.Preload("Course").Preload("Meeting").Where("jz_bm_class_sessions.course_id IS NOT NULL")
}
// Schedule answers GET /schedule?from=YYYY-MM-DD&to=YYYY-MM-DD: the class