feat(15-02): add Categories, Tags, and journal settings admin
Register the remaining YAML admin screens and the settings singleton so a host can boot Posts, Categories, Tags, and Code journal. Posts update and delete refuse other authors without access_other_posts. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -31,6 +31,13 @@ func (Category) Fillable() []string {
|
||||
return []string{"name", "slug", "code", "description", "parent_id"}
|
||||
}
|
||||
|
||||
func (Category) Rules() map[string]string {
|
||||
return map[string]string{
|
||||
"name": "required",
|
||||
"slug": "required",
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
Register(Category{})
|
||||
}
|
||||
|
||||
7
models/category/columns.yaml
Normal file
7
models/category/columns.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
columns:
|
||||
name:
|
||||
label: golem15.journal::lang.category.name
|
||||
searchable: true
|
||||
slug:
|
||||
label: golem15.journal::lang.category.slug
|
||||
searchable: true
|
||||
21
models/category/fields.yaml
Normal file
21
models/category/fields.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
fields:
|
||||
name:
|
||||
label: golem15.journal::lang.category.name
|
||||
type: mltext
|
||||
span: left
|
||||
required: true
|
||||
slug:
|
||||
label: golem15.journal::lang.category.slug
|
||||
type: mltext
|
||||
span: right
|
||||
required: true
|
||||
parent:
|
||||
label: Parent
|
||||
type: relation
|
||||
nameFrom: name
|
||||
span: full
|
||||
description:
|
||||
label: golem15.journal::lang.category.description
|
||||
type: mltext
|
||||
size: large
|
||||
span: full
|
||||
96
models/settings/fields.yaml
Normal file
96
models/settings/fields.yaml
Normal file
@@ -0,0 +1,96 @@
|
||||
fields:
|
||||
show_all_posts:
|
||||
span: left
|
||||
label: golem15.journal::lang.journal.show_all_posts_label
|
||||
comment: golem15.journal::lang.journal.show_all_posts_comment
|
||||
type: switch
|
||||
default: true
|
||||
tab: golem15.journal::lang.journal.tab_general
|
||||
use_rich_editor:
|
||||
span: left
|
||||
label: golem15.journal::lang.journal.use_rich_editor_label
|
||||
comment: golem15.journal::lang.journal.use_rich_editor_comment
|
||||
type: switch
|
||||
default: false
|
||||
tab: golem15.journal::lang.journal.tab_general
|
||||
search_use_typesense:
|
||||
span: left
|
||||
label: golem15.journal::lang.journal.search_use_typesense_label
|
||||
comment: golem15.journal::lang.journal.search_use_typesense_comment
|
||||
type: switch
|
||||
default: false
|
||||
tab: golem15.journal::lang.journal.tab_search
|
||||
search_title_weight:
|
||||
span: left
|
||||
label: golem15.journal::lang.journal.search_title_weight_label
|
||||
comment: golem15.journal::lang.journal.search_title_weight_comment
|
||||
type: number
|
||||
default: 5
|
||||
tab: golem15.journal::lang.journal.tab_search
|
||||
search_excerpt_weight:
|
||||
span: left
|
||||
label: golem15.journal::lang.journal.search_excerpt_weight_label
|
||||
comment: golem15.journal::lang.journal.search_excerpt_weight_comment
|
||||
type: number
|
||||
default: 3
|
||||
tab: golem15.journal::lang.journal.tab_search
|
||||
search_content_weight:
|
||||
span: left
|
||||
label: golem15.journal::lang.journal.search_content_weight_label
|
||||
comment: golem15.journal::lang.journal.search_content_weight_comment
|
||||
type: number
|
||||
default: 1
|
||||
tab: golem15.journal::lang.journal.tab_search
|
||||
rss_enabled:
|
||||
span: left
|
||||
label: golem15.journal::lang.journal.rss_enabled_label
|
||||
comment: golem15.journal::lang.journal.rss_enabled_comment
|
||||
type: switch
|
||||
default: true
|
||||
tab: golem15.journal::lang.journal.tab_rss
|
||||
rss_include_content:
|
||||
span: right
|
||||
label: golem15.journal::lang.journal.rss_include_content_label
|
||||
comment: golem15.journal::lang.journal.rss_include_content_comment
|
||||
type: switch
|
||||
default: false
|
||||
tab: golem15.journal::lang.journal.tab_rss
|
||||
rss_title:
|
||||
span: left
|
||||
label: golem15.journal::lang.journal.rss_title_label
|
||||
comment: golem15.journal::lang.journal.rss_title_comment
|
||||
type: text
|
||||
tab: golem15.journal::lang.journal.tab_rss
|
||||
rss_description:
|
||||
span: right
|
||||
label: golem15.journal::lang.journal.rss_description_label
|
||||
comment: golem15.journal::lang.journal.rss_description_comment
|
||||
type: textarea
|
||||
size: small
|
||||
tab: golem15.journal::lang.journal.tab_rss
|
||||
rss_language:
|
||||
span: left
|
||||
label: golem15.journal::lang.journal.rss_language_label
|
||||
comment: golem15.journal::lang.journal.rss_language_comment
|
||||
type: text
|
||||
default: en-us
|
||||
tab: golem15.journal::lang.journal.tab_rss
|
||||
rss_copyright:
|
||||
span: right
|
||||
label: golem15.journal::lang.journal.rss_copyright_label
|
||||
comment: golem15.journal::lang.journal.rss_copyright_comment
|
||||
type: text
|
||||
tab: golem15.journal::lang.journal.tab_rss
|
||||
rss_image_url:
|
||||
span: left
|
||||
label: golem15.journal::lang.journal.rss_image_url_label
|
||||
comment: golem15.journal::lang.journal.rss_image_url_comment
|
||||
type: text
|
||||
tab: golem15.journal::lang.journal.tab_rss
|
||||
rss_posts_per_feed:
|
||||
span: right
|
||||
label: golem15.journal::lang.journal.rss_posts_per_feed_label
|
||||
comment: golem15.journal::lang.journal.rss_posts_per_feed_comment
|
||||
type: number
|
||||
default: 20
|
||||
tab: golem15.journal::lang.journal.tab_rss
|
||||
@@ -21,6 +21,13 @@ func (Tag) Fillable() []string {
|
||||
return []string{"name", "slug", "description"}
|
||||
}
|
||||
|
||||
func (Tag) Rules() map[string]string {
|
||||
return map[string]string{
|
||||
"name": "required",
|
||||
"slug": "required|between:3,64",
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
Register(Tag{})
|
||||
}
|
||||
|
||||
7
models/tag/columns.yaml
Normal file
7
models/tag/columns.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
columns:
|
||||
name:
|
||||
label: golem15.journal::lang.tag.name
|
||||
searchable: true
|
||||
slug:
|
||||
label: golem15.journal::lang.tag.slug
|
||||
searchable: true
|
||||
19
models/tag/fields.yaml
Normal file
19
models/tag/fields.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
fields:
|
||||
name:
|
||||
label: golem15.journal::lang.tag.name
|
||||
type: text
|
||||
span: left
|
||||
required: true
|
||||
slug:
|
||||
label: golem15.journal::lang.tag.slug
|
||||
type: text
|
||||
span: right
|
||||
required: true
|
||||
preset:
|
||||
field: name
|
||||
type: slug
|
||||
description:
|
||||
label: golem15.journal::lang.tag.description
|
||||
type: textarea
|
||||
size: large
|
||||
span: full
|
||||
Reference in New Issue
Block a user