Add classrooms section with grade and classroom rosters
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user