The Pulpit hero lists what to read for the current or next zjazd, so readings and materials get a nullable meeting_id (FK to jz_bm_meetings, ON DELETE SET NULL, indexed). The reading admin form gets a "Na zjazd" picker, the student reading JSON carries meeting_id, and the management /readings records filter and validate it.
42 lines
1.4 KiB
Go
42 lines
1.4 KiB
Go
// Code generated by summer make. DO NOT EDIT.
|
|
|
|
package controllers
|
|
|
|
import (
|
|
"git.golem15.com/golem15/summercms/modules/cabana"
|
|
"git.golem15.com/golem15/summercms/modules/pact"
|
|
"git.golem15.com/jakub/sm-bm-plugin/models"
|
|
)
|
|
|
|
var (
|
|
_ pact.AdminController = classSessionsAdmin{}
|
|
_ pact.AdminRecordSource = classSessionsAdmin{}
|
|
_ pact.AdminPermissioned = classSessionsAdmin{}
|
|
)
|
|
|
|
// classSessionsAdmin is the admin controller for class sessions (zajęcia).
|
|
type classSessionsAdmin struct{ temporalHooks }
|
|
|
|
func (classSessionsAdmin) ID() string { return "jz.bm.class_sessions" }
|
|
func (classSessionsAdmin) ModelName() string { return "ClassSession" }
|
|
func (classSessionsAdmin) ConfigDir() string { return "controllers/class_sessions" }
|
|
|
|
// NewRecord returns the model the generic admin handlers query and fill.
|
|
func (classSessionsAdmin) NewRecord() any { return &models.ClassSession{} }
|
|
|
|
// RequiredPermissions is checked before any schema or record is served.
|
|
func (classSessionsAdmin) RequiredPermissions() []string {
|
|
return []string{PermSchedule}
|
|
}
|
|
|
|
// AdminFieldRelations binds the course and meeting pickers.
|
|
func (classSessionsAdmin) AdminFieldRelations() []cabana.FieldRelationContract {
|
|
return []cabana.FieldRelationContract{
|
|
courseRelation("course_id"),
|
|
meetingRelation(),
|
|
}
|
|
}
|
|
|
|
// ClassSessionsController returns the jz.bm.class_sessions admin controller.
|
|
func ClassSessionsController() pact.AdminController { return classSessionsAdmin{} }
|