feat: add admin screens, permissions and navigation
Seven admin controllers in a "Studia BM" navigation group, guarded by jz.bm.access_courses, jz.bm.access_schedule and jz.bm.access_materials, with Polish and English labels. Date and time fields are checked by the models before a save and answered as 422 on the field.
This commit is contained in:
32
controllers/meetings.go
Normal file
32
controllers/meetings.go
Normal file
@@ -0,0 +1,32 @@
|
||||
// Code generated by summer make. DO NOT EDIT.
|
||||
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"git.golem15.com/golem15/summercms/modules/pact"
|
||||
"git.golem15.com/jakub/sm-bm-plugin/models"
|
||||
)
|
||||
|
||||
var (
|
||||
_ pact.AdminController = meetingsAdmin{}
|
||||
_ pact.AdminRecordSource = meetingsAdmin{}
|
||||
_ pact.AdminPermissioned = meetingsAdmin{}
|
||||
)
|
||||
|
||||
// meetingsAdmin is the admin controller for meetings (zjazdy).
|
||||
type meetingsAdmin struct{ temporalHooks }
|
||||
|
||||
func (meetingsAdmin) ID() string { return "jz.bm.meetings" }
|
||||
func (meetingsAdmin) ModelName() string { return "Meeting" }
|
||||
func (meetingsAdmin) ConfigDir() string { return "controllers/meetings" }
|
||||
|
||||
// NewRecord returns the model the generic admin handlers query and fill.
|
||||
func (meetingsAdmin) NewRecord() any { return &models.Meeting{} }
|
||||
|
||||
// RequiredPermissions is checked before any schema or record is served.
|
||||
func (meetingsAdmin) RequiredPermissions() []string {
|
||||
return []string{PermSchedule}
|
||||
}
|
||||
|
||||
// MeetingsController returns the jz.bm.meetings admin controller.
|
||||
func MeetingsController() pact.AdminController { return meetingsAdmin{} }
|
||||
Reference in New Issue
Block a user