@kohanajs/mod-cms
Advanced tools
Comparing version 9.10.0 to 9.11.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [9.11.0](https://gitlab.com/kohana-js/proposals/level0/mod-cms/compare/v9.10.0...v9.11.0) (2024-01-24) | ||
### Features | ||
* pass blueprint and original to page edit ([4568bb0](https://gitlab.com/kohana-js/proposals/level0/mod-cms/commit/4568bb0bc4efe1996218865e82a7d3e13f9836d5)) | ||
## [9.10.0](https://gitlab.com/kohana-js/proposals/level0/mod-cms/compare/v9.9.0...v9.10.0) (2024-01-21) | ||
@@ -7,0 +14,0 @@ |
@@ -207,4 +207,9 @@ const { ControllerAdmin } = require('@kohanajs/mod-admin'); | ||
templateData.tags = tags; | ||
templateData.blueprint = KohanaJS.config.cms.blueprint[page.page_type]; | ||
templateData.original = page.original; | ||
//assign blueprint | ||
templateData.blueprint = HelperPageText.blueprintKeys( | ||
HelperPageText.blueprint(page.page_type, KohanaJS.config.cms.blueprint, 'default') | ||
); | ||
const tpl = KohanaJS.config.cms.blueprint[editTemplateFolder] ? `templates/admin/page/page_types/${editTemplateFolder}/edit` : `templates/admin/page/page_types/default/edit`; | ||
@@ -211,0 +216,0 @@ this.setTemplate(tpl, templateData); |
@@ -85,2 +85,14 @@ class HelperPageText{ | ||
static blueprintKeys(blueprint){ | ||
const keys = {attributes:[], items:[], values:[]}; | ||
keys.attributes = Object.keys(blueprint.attributes).filter(it => !it.startsWith('_')); | ||
keys.values = Object.keys(blueprint.values.default); | ||
keys.items = Object.keys(blueprint.items || {}) | ||
.map(it => ({ | ||
...this.blueprintKeys(blueprint.items[it][0]), | ||
_name: it, | ||
})); | ||
return keys; | ||
} | ||
static tokenToObject(tokens){ | ||
@@ -87,0 +99,0 @@ Object.keys(tokens).forEach(token => { |
{ | ||
"name": "@kohanajs/mod-cms", | ||
"version": "9.10.0", | ||
"version": "9.11.0", | ||
"description": "The CMS module for KohanaJS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
186278
1582