Add classrooms section with grade and classroom rosters

This commit is contained in:
Ian Gulliver
2026-08-15 21:58:21 -07:00
parent 877c989539
commit bee67d5d04
22 changed files with 508 additions and 4 deletions
+2
View File
@@ -36,6 +36,8 @@ func Register(mux *http.ServeMux, cache *Cache) {
}
mux.HandleFunc("GET /people/{email}", a.page)
mux.HandleFunc("GET /families/{key}", a.page)
mux.HandleFunc("GET /classrooms/{name}", a.page)
mux.HandleFunc("GET /grades/{name}", a.page)
mux.HandleFunc("GET /dl/", a.legacyRedirect)
mux.HandleFunc("GET /api/directory/model", a.model)
}
+5 -1
View File
@@ -125,9 +125,13 @@ func LoadModel(source data.Source) (*Model, error) {
if row["Class"] == "" {
continue
}
imageURL := ""
if row["Classroom Image"] != "" {
imageURL = "/static/brand/classrooms/classroom-" + strings.ToLower(row["Class"]) + ".jpg"
}
model.Classrooms = append(model.Classrooms, Classroom{
Name: row["Class"],
ImageURL: row["Classroom Image"],
ImageURL: imageURL,
HasSections: row["Has Sections"] == "TRUE",
})
}