38 lines
1.3 KiB
Go
38 lines
1.3 KiB
Go
// Code generated by summer make. DO NOT EDIT.
|
|
|
|
package controllers
|
|
|
|
import (
|
|
"git.golem15.com/golem15/sm-quizzes-plugin/models"
|
|
"git.golem15.com/golem15/summercms/modules/pact"
|
|
)
|
|
|
|
var (
|
|
_ pact.AdminController = quizzesAdmin{}
|
|
_ pact.AdminRecordSource = quizzesAdmin{}
|
|
_ pact.AdminPermissioned = quizzesAdmin{}
|
|
)
|
|
|
|
// quizzesAdmin lists and edits quizzes. Questions have their own controller
|
|
// filtered by quiz.
|
|
//
|
|
// TODO: requires SummerCMS change. cabana's relation manager only links and
|
|
// unlinks belongsToMany records through a pivot; it cannot create or edit
|
|
// hasMany children inline, so the quiz form cannot embed its questions.
|
|
type quizzesAdmin struct{}
|
|
|
|
func (quizzesAdmin) ID() string { return "golem15.quizzes.quizzes" }
|
|
func (quizzesAdmin) ModelName() string { return "Quiz" }
|
|
func (quizzesAdmin) ConfigDir() string { return "controllers/quizzes" }
|
|
|
|
// NewRecord returns the model the generic admin handlers query and fill.
|
|
func (quizzesAdmin) NewRecord() any { return &models.Quiz{} }
|
|
|
|
// RequiredPermissions is checked before any schema or record is served.
|
|
func (quizzesAdmin) RequiredPermissions() []string {
|
|
return []string{"golem15.quizzes.access_quizzes"}
|
|
}
|
|
|
|
// QuizzesController returns the golem15.quizzes.quizzes admin controller.
|
|
func QuizzesController() pact.AdminController { return quizzesAdmin{} }
|