feat(15-02): register journal export/import commands and Posts toolbar

JSON CLI matching PHP ExportPosts/ImportPosts ships as HasCommands, and Posts toolbar actions reuse that logic behind access_import_export.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jakub Zych
2026-10-06 18:47:53 +02:00
parent ab06569641
commit 4ff98f7de8
9 changed files with 770 additions and 5 deletions

View File

@@ -4,9 +4,11 @@ import (
"embed"
"io/fs"
"git.golem15.com/golem15/sm-journal-plugin/console"
"git.golem15.com/golem15/sm-journal-plugin/models"
"git.golem15.com/golem15/sm-journal-plugin/updates"
"git.golem15.com/golem15/summercms/modules/backpack"
"git.golem15.com/golem15/summercms/modules/bonfire"
"git.golem15.com/golem15/summercms/modules/pact"
"git.golem15.com/golem15/summercms/modules/party"
"github.com/go-gormigrate/gormigrate/v2"
@@ -17,6 +19,7 @@ var (
_ pact.HasMigrations = (*Plugin)(nil)
_ pact.HasModels = (*Plugin)(nil)
_ pact.HasLang = (*Plugin)(nil)
_ pact.HasCommands = (*Plugin)(nil)
)
//go:embed lang
@@ -47,6 +50,13 @@ func (p *Plugin) Migrations() []*gormigrate.Migration { return updates.All() }
func (p *Plugin) Models() []any { return models.All() }
func (p *Plugin) Commands() []bonfire.Command {
return []bonfire.Command{
console.ExportPosts(p.app),
console.ImportPosts(p.app),
}
}
func init() {
party.Register(&Plugin{})
}