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:
Jakub Zych
2026-09-24 18:25:20 +02:00
parent af8e58a038
commit 68715fc260
3 changed files with 67 additions and 24 deletions

View File

@@ -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