feat(17-03): sitemap admin, permissions, lang and README

- definitions singleton controller (theme default, first or create) with a
  repeater on data: type dropdown (url plus registry types), reference
  dependsOn type through signpost.ReferenceOptions
- Settings page entries: Sitemap (link to the controller) and Sitemap
  settings (form), both behind golem15.sitemap.access_definitions
- en and pl phrasebooks with the PHP keys
- README with the PHP parity rules, tiers, hooks, commands and the Winter
  YAML adaptations
- TestSitemapAdminSmoke: singleton, PHP-keyed rows, 422 on a foreign
  reference, settings save, 403 without the permission
This commit is contained in:
2026-10-12 17:14:04 +02:00
parent 4a82240429
commit 7d937e3cf5
12 changed files with 904 additions and 0 deletions

View File

@@ -31,6 +31,10 @@ func (Definition) MorphName() string { return `Golem15\Sitemap\Models\Definition
// (MassAssignmentTest).
func (Definition) Fillable() []string { return []string{"theme", "data"} }
// Rules is empty: the PHP model validated nothing. The admin form checks
// each item row's reference against its type.
func (Definition) Rules() map[string]string { return map[string]string{} }
// Items returns the stored items.
func (d Definition) Items() []DefinitionItem { return d.Data.Get() }

View File

@@ -0,0 +1,69 @@
# ===================================
# Form Field Definitions
# ===================================
#
# The WinterCMS form was one tab holding the SitemapItems widget. Here the
# items are a repeater on data; each row is one DefinitionItem. The CMS page
# field is not ported: items are URLs or registry types.
fields:
data:
label: golem15.sitemap::lang.item.definition
type: repeater
prompt: golem15.sitemap::lang.item.add_item
titleFrom: url
form:
fields:
type:
label: golem15.sitemap::lang.item.type
type: dropdown
options: getTypeOptions
span: left
reference:
label: golem15.sitemap::lang.item.reference
type: dropdown
dependsOn: type
emptyOption: backend::lang.form.none
span: right
url:
label: golem15.sitemap::lang.item.url
type: text
span: left
urlPattern:
label: golem15.sitemap::lang.item.url_pattern
comment: golem15.sitemap::lang.item.url_pattern_comment
type: text
span: right
priority:
label: golem15.sitemap::lang.item.priority
type: dropdown
span: left
options:
'0.1': '0.1'
'0.2': '0.2'
'0.3': '0.3'
'0.4': '0.4'
'0.5': '0.5'
'0.6': '0.6'
'0.7': '0.7'
'0.8': '0.8'
'0.9': '0.9'
'1.0': '1.0'
changefreq:
label: golem15.sitemap::lang.item.changefreq
type: dropdown
span: right
options:
always: golem15.sitemap::lang.item.always
hourly: golem15.sitemap::lang.item.hourly
daily: golem15.sitemap::lang.item.daily
weekly: golem15.sitemap::lang.item.weekly
monthly: golem15.sitemap::lang.item.monthly
yearly: golem15.sitemap::lang.item.yearly
never: golem15.sitemap::lang.item.never
nesting:
label: golem15.sitemap::lang.item.allow_nested_items
comment: golem15.sitemap::lang.item.allow_nested_items_comment
type: checkbox
default: true
span: full

View File

@@ -0,0 +1,68 @@
# ===================================
# Form Field Definitions
# ===================================
#
# The WinterCMS form's nginx hint and Priority Tiers section are field
# comments and README text here, and the tier fields always show (the
# trigger on enable_priority_tiers is not ported).
fields:
frontend_url:
label: golem15.sitemap::lang.settings.frontend_url
comment: golem15.sitemap::lang.settings.frontend_url_comment
type: text
span: left
frontend_default_locale:
label: golem15.sitemap::lang.settings.frontend_default_locale
comment: golem15.sitemap::lang.settings.frontend_default_locale_comment
type: text
span: right
updates_manifest_path:
label: golem15.sitemap::lang.settings.updates_manifest_path
comment: golem15.sitemap::lang.settings.updates_manifest_path_comment
type: text
span: full
enable_priority_tiers:
label: golem15.sitemap::lang.settings.enable_priority_tiers
comment: golem15.sitemap::lang.settings.enable_priority_tiers_comment
type: checkbox
default: true
span: full
priority_homepage:
label: golem15.sitemap::lang.settings.priority_homepage
comment: golem15.sitemap::lang.settings.priority_homepage_comment
type: text
default: '1.0'
span: auto
priority_services:
label: golem15.sitemap::lang.settings.priority_services
comment: golem15.sitemap::lang.settings.priority_services_comment
type: text
default: '0.8'
span: auto
priority_blog:
label: golem15.sitemap::lang.settings.priority_blog
comment: golem15.sitemap::lang.settings.priority_blog_comment
type: text
default: '0.6'
span: auto
priority_categories:
label: golem15.sitemap::lang.settings.priority_categories
comment: golem15.sitemap::lang.settings.priority_categories_comment
type: text
default: '0.4'
span: auto
priority_legal:
label: golem15.sitemap::lang.settings.priority_legal
comment: golem15.sitemap::lang.settings.priority_legal_comment
type: text
default: '0.2'
span: auto