feat(build): scaffold working admin controllers with model, AdminFS and delete (quick-261028-pq8)
- make:admin-controller edits the singular of its name (--model overrides):
ModelName, modelClass and the YAML under models/<model>/
- NewRecord returns &models.<Model>{} when the model exists; otherwise the
nil body stays and the command says to run make:model
- config_list.yaml offers create and delete with showCheckboxes
- registry.gen.go embeds controllers/*/*.yaml and models/*/*.yaml once they
exist and exposes generatedAdminFS(); scaffolded plugins implement
pact.AdminAssets through it, and a plugin without AdminFS gets a note
- blog example moves its YAML to models/post; docs and help text follow
This commit is contained in:
10
docs/examples/blog/models/post/columns.yaml
Normal file
10
docs/examples/blog/models/post/columns.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
columns:
|
||||
title:
|
||||
label: acme.blog::lang.posts.title_field
|
||||
searchable: true
|
||||
slug:
|
||||
label: acme.blog::lang.posts.slug
|
||||
searchable: true
|
||||
published_at:
|
||||
label: acme.blog::lang.posts.published_at
|
||||
type: datetime
|
||||
15
docs/examples/blog/models/post/fields.yaml
Normal file
15
docs/examples/blog/models/post/fields.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
fields:
|
||||
title:
|
||||
label: acme.blog::lang.posts.title_field
|
||||
type: text
|
||||
span: left
|
||||
required: true
|
||||
slug:
|
||||
label: acme.blog::lang.posts.slug
|
||||
type: text
|
||||
span: right
|
||||
required: true
|
||||
body:
|
||||
label: acme.blog::lang.posts.body
|
||||
type: textarea
|
||||
size: large
|
||||
Reference in New Issue
Block a user