feat(15-01): clone journal plugin with translatable Post tracer

- Register golem15.journal requiring exactly golem15.translate
- Squash golem15_journal_posts DDL with unique slug and JSONB columns
- Persist one en/pl Post through translate helpers on real Postgres

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jakub Zych
2026-10-06 18:22:47 +02:00
commit 54322128fb
11 changed files with 1050 additions and 0 deletions

43
plugin.go Normal file
View File

@@ -0,0 +1,43 @@
package journal
import (
"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/pact"
"git.golem15.com/golem15/summercms/modules/party"
"github.com/go-gormigrate/gormigrate/v2"
)
var (
_ party.Plugin = (*Plugin)(nil)
_ pact.HasMigrations = (*Plugin)(nil)
_ pact.HasModels = (*Plugin)(nil)
)
// Plugin is the golem15.journal plugin.
type Plugin struct {
app *backpack.App
}
func (p *Plugin) ID() string { return "golem15.journal" }
func (p *Plugin) Requires() []string { return []string{"golem15.translate"} }
func (p *Plugin) Register(app *backpack.App) error {
p.app = app
return nil
}
func (p *Plugin) Boot(app *backpack.App) error {
p.app = app
return nil
}
func (p *Plugin) Migrations() []*gormigrate.Migration { return updates.All() }
func (p *Plugin) Models() []any { return models.All() }
func init() {
party.Register(&Plugin{})
}