feat(11.1-05): add the walkthrough's admin controller, publish command and published_at migration

- make:admin-controller, make:command and make:migration output, finished:
  the Posts controller serves models.Post behind acme.blog.access_posts,
  WinterCMS-style form and list YAML embedded through pact.AdminAssets,
  blog:publish sets published_at by slug with a bound parameter
- the posts route lists published posts only, newest first
- Docker tests migrate an ICU pl-PL database, roll back published_at, serve
  the route and run blog:publish with a published and an opened database
- the page gains the admin controller, console command and added-column
  sections
This commit is contained in:
Jakub Zych
2026-09-30 23:35:44 +02:00
parent 41a3190956
commit dd82b8a2ad
17 changed files with 1223 additions and 59 deletions

View File

@@ -3,6 +3,7 @@
package blog
import (
"git.golem15.com/golem15/summercms/docs/examples/blog/controllers"
"git.golem15.com/golem15/summercms/docs/examples/blog/models"
"git.golem15.com/golem15/summercms/docs/examples/blog/updates"
"git.golem15.com/golem15/summercms/modules/bonfire"
@@ -19,6 +20,7 @@ func generatedModels() []any {
func generatedMigrations() []*gormigrate.Migration {
return []*gormigrate.Migration{
updates.CreatePosts(),
updates.AddPublishedAt(),
}
}
@@ -31,5 +33,7 @@ func generatedJobs() []pact.Job {
}
func generatedAdminControllers() []pact.AdminController {
return nil
return []pact.AdminController{
controllers.PostsController(),
}
}