feat(09-03): scaffold Winter admin controller layout
- config_form.yaml and config_list.yaml point at models/<name>/fields.yaml and columns.yaml - Duplicate model or controller assets fail before any new file is written
This commit is contained in:
@@ -105,6 +105,27 @@ func ({{.Worker}}) ConfigDir() string { return {{printf "%q" .ConfigDir}} }
|
||||
func {{.Func}}() pact.AdminController { return {{.Worker}}{} }
|
||||
{{end}}
|
||||
|
||||
{{define "config_form.yaml"}}name: {{.Ident}}
|
||||
form: ~/plugins/{{.PluginPath}}/models/{{.Snake}}/fields.yaml
|
||||
modelClass: {{.Ident}}
|
||||
defaultRedirect: {{.PluginPath}}/{{.Snake}}
|
||||
|
||||
create:
|
||||
redirect: {{.PluginPath}}/{{.Snake}}/update/:id
|
||||
redirectClose: {{.PluginPath}}/{{.Snake}}
|
||||
|
||||
update:
|
||||
redirect: {{.PluginPath}}/{{.Snake}}
|
||||
redirectClose: {{.PluginPath}}/{{.Snake}}
|
||||
{{end}}
|
||||
|
||||
{{define "config_list.yaml"}}list: ~/plugins/{{.PluginPath}}/models/{{.Snake}}/columns.yaml
|
||||
modelClass: {{.Ident}}
|
||||
title: {{.Ident}}
|
||||
recordsPerPage: 20
|
||||
showSearch: true
|
||||
{{end}}
|
||||
|
||||
{{define "fields.yaml"}}fields:
|
||||
id:
|
||||
label: ID
|
||||
|
||||
Reference in New Issue
Block a user