diff --git a/admin_navigation.go b/admin_navigation.go index 27ccb78..5805ea8 100644 --- a/admin_navigation.go +++ b/admin_navigation.go @@ -41,7 +41,7 @@ func (*Plugin) Navigation() []pact.NavigationItem { { Code: "tags", Label: "golem15.journal::lang.journal.tags", - Icon: "tag", + Icon: "tags", Permissions: []string{controllers.PermissionAccessTags}, Controller: controllers.TagsControllerID, }, diff --git a/models/category/fields.yaml b/models/category/fields.yaml index e52fa82..bd57cb3 100644 --- a/models/category/fields.yaml +++ b/models/category/fields.yaml @@ -9,6 +9,9 @@ fields: type: mltext span: right required: true + preset: + field: name + type: slug parent: label: Parent type: relation @@ -16,6 +19,6 @@ fields: span: full description: label: golem15.journal::lang.category.description - type: mltext + type: mltextarea size: large span: full diff --git a/models/post/fields.yaml b/models/post/fields.yaml index 1b0c40f..9d50f72 100644 --- a/models/post/fields.yaml +++ b/models/post/fields.yaml @@ -11,6 +11,9 @@ fields: span: right tab: golem15.journal::lang.post.tab_edit required: true + preset: + field: title + type: slug content: label: golem15.journal::lang.post.content type: mlmarkdown @@ -19,7 +22,7 @@ fields: required: true excerpt: label: golem15.journal::lang.post.excerpt - type: mltext + type: mltextarea size: small tab: golem15.journal::lang.post.tab_manage categories: diff --git a/plugin_test.go b/plugin_test.go index b87367c..a960544 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -121,7 +121,7 @@ func TestCabanaMarkdownFieldTypes(t *testing.T) { t.Fatalf("read %s: %v", path, err) } src := string(raw) - for _, typ := range []string{`"markdown"`, `"mltext"`, `"mlmarkdown"`} { + for _, typ := range []string{`"markdown"`, `"mltext"`, `"mltextarea"`, `"mlmarkdown"`} { if !strings.Contains(src, typ) { t.Fatalf("form_schema.go missing %s", typ) } diff --git a/posts_admin_smoke_test.go b/posts_admin_smoke_test.go index f7de7ef..4f71173 100644 --- a/posts_admin_smoke_test.go +++ b/posts_admin_smoke_test.go @@ -22,6 +22,12 @@ func TestPostsFormCompiles(t *testing.T) { if !strings.Contains(body, "mltext") { t.Fatalf("form schema missing mltext: %s", body) } + if !strings.Contains(body, "mltextarea") { + t.Fatalf("form schema missing mltextarea: %s", body) + } + if !strings.Contains(body, `"preset":{"field":"title","type":"slug"}`) { + t.Fatalf("form schema missing slug preset: %s", body) + } } func TestPostsAdminCreateSmoke(t *testing.T) {