- SyncG15Office files each submission as a G15Office task with its screenshot through a fetchguard client limited to the configured host; a River job with 3 attempts, PHP's messages on failure, nothing sent when unconfigured - the replay of PHP's recorded G15Office exchange (classes/testdata) asserts the task JSON, headers and the screenshot part - settings screen (cabana field types only), read-only submissions list, manage_settings permission and navigation - embed.js served byte for byte at /plugins/golem15/feedback/assets/js/embed.js - feedback:import-settings copies the WinterCMS settings row once
37 lines
1.3 KiB
Go
37 lines
1.3 KiB
Go
package controllers
|
|
|
|
import (
|
|
"git.golem15.com/golem15/sm-feedback-plugin/models"
|
|
"git.golem15.com/golem15/summercms/modules/pact"
|
|
)
|
|
|
|
// SubmissionsAdminController is the read-only list of the widget's
|
|
// submissions (golem15.feedback.submissions): no form, no create, no
|
|
// delete. The WinterCMS plugin had no such screen; operators read reports
|
|
// in G15Office, and this list shows what was received and whether it was
|
|
// filed (status, task id).
|
|
type SubmissionsAdminController struct{}
|
|
|
|
var (
|
|
_ pact.AdminController = SubmissionsAdminController{}
|
|
_ pact.AdminPermissioned = SubmissionsAdminController{}
|
|
_ pact.AdminRecordSource = SubmissionsAdminController{}
|
|
)
|
|
|
|
// ID is golem15.feedback.submissions.
|
|
func (SubmissionsAdminController) ID() string { return "golem15.feedback.submissions" }
|
|
|
|
// ModelName is the model's WinterCMS class name.
|
|
func (SubmissionsAdminController) ModelName() string { return models.Submission{}.MorphName() }
|
|
|
|
// ConfigDir holds config_list.yaml.
|
|
func (SubmissionsAdminController) ConfigDir() string { return "controllers/submissions" }
|
|
|
|
// RequiredPermissions is golem15.feedback.manage_settings.
|
|
func (SubmissionsAdminController) RequiredPermissions() []string {
|
|
return []string{PermissionManageSettings}
|
|
}
|
|
|
|
// NewRecord returns an empty submission.
|
|
func (SubmissionsAdminController) NewRecord() any { return &models.Submission{} }
|