feat(admin): post content on the Blog Editor field type

- blogeditor and mlblogeditor field types (classes.BlogEditorTypes) on the
  plugin; post content is mlblogeditor with htmlColumn content_html
- Decode stores SanitizeHTMLReport output per locale with notices naming
  what was removed; clean HTML is stored byte for byte, nothing is refused
  because of markup
- Load serves HTML as stored and markdown posts as their content_html
- the admin hooks copy written content to content_html per locale without
  goldmark; untouched content leaves both columns as they are
- editor lang keys (en, pl plural notices), tracer smoke test, updated
  Postgres admin tests
This commit is contained in:
2026-10-10 12:02:55 +02:00
parent cbf4891703
commit fbd1c85168
9 changed files with 805 additions and 30 deletions

21
field_types.go Normal file
View File

@@ -0,0 +1,21 @@
package journal
import (
"git.golem15.com/golem15/sm-journal-plugin/classes"
"git.golem15.com/golem15/summercms/modules/backpack"
"git.golem15.com/golem15/summercms/modules/pact"
)
// FormFieldTypes registers the Blog Editor field types, blogeditor and
// mlblogeditor (classes.BlogEditorTypes), with a lazy accessor of the booted
// app.
func (p *Plugin) FormFieldTypes() []pact.FormFieldType {
return classes.BlogEditorTypes(func() *backpack.App {
if p == nil {
return nil
}
return p.app
})
}
var _ pact.HasFormFieldTypes = (*Plugin)(nil)