feat: add page_settings JSON property + ACE JSON mode

- Add property :page_settings (Hash, default {}) to Page model
- JSON.parse string input in setter (form submits as text)
- Add collapsible 'Page Settings (JSON)' section to page form
- Support data-mode='json' attribute for ACE editor
  (html_edit.js.coffee: check textarea data-mode attribute)
This commit is contained in:
BenClaw
2026-05-30 20:33:15 +02:00
parent 37cbb428c6
commit 548a227617
3 changed files with 17 additions and 0 deletions
+7
View File
@@ -21,6 +21,13 @@ module Cmtool
klass.property :active, type: :boolean, default: true
klass.property :layout
klass.property :in_menu, type: :boolean, default: true
klass.property :page_settings, default: {}
# Parse JSON string from form submission
klass.send(:define_method, :page_settings=) do |val|
val = JSON.parse(val) if val.is_a?(String)
super(val)
end
klass.has_ancestry by_property: :locale