diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e6a463e..d1a80d3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ 1. [](#improved) * Set sidebar navigation defaults back to "Tab Activation" and "Auto Width" * Custom logo text is displayed as first letter in small sidebar view [#829](https://github.com/getgrav/grav/issues/829) + * Copied admin-only blueprints from Grav core to the Admin plugin 1. [](#bugfix) * Fixed Togggle field with doubled `checked="checked"` when `toggleable: true` [#579](https://github.com/getgrav/grav-plugin-admin/issues/579) * Strip HTML tags and lowercase username from login/reset forms [#577](https://github.com/getgrav/grav-plugin-admin/issues/577) diff --git a/blueprints/pages/modular_new.yaml b/blueprints/pages/modular_new.yaml new file mode 100644 index 00000000..975c5eec --- /dev/null +++ b/blueprints/pages/modular_new.yaml @@ -0,0 +1,54 @@ +rules: + slug: + pattern: "[a-z][a-z0-9_\-]+" + min: 2 + max: 80 + +form: + validation: loose + fields: + + section: + type: section + title: PLUGIN_ADMIN.ADD_MODULAR_CONTENT + + title: + type: text + label: PLUGIN_ADMIN.PAGE_TITLE + validate: + required: true + + folder: + type: text + label: PLUGIN_ADMIN.FOLDER_NAME + validate: + type: slug + required: true + + route: + type: select + label: PLUGIN_ADMIN.PAGE + classes: fancy + data-options@: '\Grav\Common\Page\Pages::parents' + data-default@: '\Grav\Plugin\admin::route' + validate: + required: true + + name: + type: select + classes: fancy + label: PLUGIN_ADMIN.MODULAR_TEMPLATE + help: PLUGIN_ADMIN.PAGE_FILE_HELP + default: default + data-options@: '\Grav\Common\Page\Pages::modularTypes' + validate: + required: true + + modular: + type: hidden + default: 1 + validate: + type: bool + + blueprint: + type: blueprint diff --git a/blueprints/pages/modular_raw.yaml b/blueprints/pages/modular_raw.yaml new file mode 100644 index 00000000..0dffdf7f --- /dev/null +++ b/blueprints/pages/modular_raw.yaml @@ -0,0 +1,106 @@ +rules: + slug: + pattern: "[a-z][a-z0-9_\-]+" + min: 2 + max: 80 + +form: + validation: loose + fields: + + tabs: + type: tabs + active: 1 + + fields: + content: + type: tab + title: PLUGIN_ADMIN.CONTENT + + fields: + frontmatter: + classes: frontmatter + type: editor + label: PLUGIN_ADMIN.FRONTMATTER + autofocus: true + codemirror: + mode: 'yaml' + indentUnit: 4 + autofocus: true + indentWithTabs: false + lineNumbers: true + styleActiveLine: true + gutters: ['CodeMirror-lint-markers'] + lint: true + + content: + type: markdown + + uploads: + type: pagemedia + label: PLUGIN_ADMIN.PAGE_MEDIA + + + options: + type: tab + title: PLUGIN_ADMIN.OPTIONS + + fields: + + columns: + type: columns + + fields: + column1: + type: column + + fields: + + ordering: + type: toggle + label: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX + help: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX_HELP + highlight: 1 + options: + 1: PLUGIN_ADMIN.ENABLED + 0: PLUGIN_ADMIN.DISABLED + validate: + type: bool + + folder: + type: text + label: PLUGIN_ADMIN.FILENAME + validate: + type: slug + required: true + + route: + type: select + label: PLUGIN_ADMIN.PARENT + classes: fancy + data-options@: '\Grav\Common\Page\Pages::parents' + data-default@: '\Grav\Plugin\admin::route' + options: + '': PLUGIN_ADMIN.DEFAULT_OPTION_SELECT + validate: + required: true + + name: + type: select + classes: fancy + label: PLUGIN_ADMIN.MODULAR_TEMPLATE + default: default + data-options@: '\Grav\Common\Page\Pages::modularTypes' + validate: + required: true + + column2: + type: column + + fields: + order: + type: order + label: PLUGIN_ADMIN.ORDERING + + blueprint: + type: blueprint diff --git a/blueprints/pages/move.yaml b/blueprints/pages/move.yaml new file mode 100644 index 00000000..68a1d746 --- /dev/null +++ b/blueprints/pages/move.yaml @@ -0,0 +1,17 @@ +rules: + slug: + pattern: "[a-z][a-z0-9_\-]+" + min: 2 + max: 80 + +form: + validation: loose + fields: + route: + type: select + label: PLUGIN_ADMIN.PARENT + classes: fancy + data-options@: '\Grav\Common\Page\Pages::parents' + data-default@: '\Grav\Plugin\admin::route' + options: + '/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT diff --git a/blueprints/pages/new.yaml b/blueprints/pages/new.yaml new file mode 100644 index 00000000..62a3adde --- /dev/null +++ b/blueprints/pages/new.yaml @@ -0,0 +1,66 @@ +rules: + slug: + pattern: "[a-z][a-z0-9_\-]+" + min: 2 + max: 80 + +form: + validation: loose + fields: + + section: + type: section + title: PLUGIN_ADMIN.ADD_PAGE + + title: + type: text + label: PLUGIN_ADMIN.PAGE_TITLE + help: PLUGIN_ADMIN.PAGE_TITLE_HELP + validate: + required: true + + folder: + type: text + label: PLUGIN_ADMIN.FOLDER_NAME + help: PLUGIN_ADMIN.FOLDER_NAME_HELP + validate: + type: slug + required: true + + route: + type: select + label: PLUGIN_ADMIN.PARENT_PAGE + classes: fancy + data-options@: '\Grav\Common\Page\Pages::parents' + data-default@: '\Grav\Plugin\admin::getLastPageRoute' + options: + '/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT + validate: + required: true + + name: + type: select + classes: fancy + label: PLUGIN_ADMIN.PAGE_FILE + help: PLUGIN_ADMIN.PAGE_FILE_HELP + data-options@: '\Grav\Common\Page\Pages::types' + data-default@: '\Grav\Plugin\admin::getLastPageName' + validate: + required: true + + visible: + type: toggle + label: PLUGIN_ADMIN.VISIBLE + help: PLUGIN_ADMIN.VISIBLE_HELP + highlight: '' + default: '' + options: + '': Auto + 1: PLUGIN_ADMIN.YES + 0: PLUGIN_ADMIN.NO + validate: + type: bool + required: true + + blueprint: + type: blueprint diff --git a/blueprints/pages/new_folder.yaml b/blueprints/pages/new_folder.yaml new file mode 100644 index 00000000..38b319b3 --- /dev/null +++ b/blueprints/pages/new_folder.yaml @@ -0,0 +1,35 @@ +rules: + slug: + pattern: "[a-z][a-z0-9_\-]+" + min: 2 + max: 80 + +form: + validation: loose + fields: + + section: + type: section + title: PLUGIN_ADMIN.ADD_FOLDER + + folder: + type: text + label: PLUGIN_ADMIN.FOLDER_NAME + help: PLUGIN_ADMIN.FOLDER_NAME_HELP + validate: + type: slug + required: true + + route: + type: select + label: PLUGIN_ADMIN.PARENT_PAGE + classes: fancy + data-options@: '\Grav\Common\Page\Pages::parents' + data-default@: '\Grav\Plugin\admin::getLastPageRoute' + options: + '/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT + validate: + required: true + + blueprint: + type: blueprint diff --git a/blueprints/pages/raw.yaml b/blueprints/pages/raw.yaml new file mode 100644 index 00000000..97d7c8ac --- /dev/null +++ b/blueprints/pages/raw.yaml @@ -0,0 +1,105 @@ +rules: + slug: + pattern: "[a-z][a-z0-9_\-]+" + min: 2 + max: 80 + +form: + validation: loose + fields: + + tabs: + type: tabs + active: 1 + + fields: + content: + type: tab + title: PLUGIN_ADMIN.CONTENT + + fields: + frontmatter: + classes: frontmatter + type: editor + label: PLUGIN_ADMIN.FRONTMATTER + autofocus: true + codemirror: + mode: 'yaml' + indentUnit: 4 + autofocus: true + indentWithTabs: false + lineNumbers: true + styleActiveLine: true + gutters: ['CodeMirror-lint-markers'] + lint: true + + content: + type: markdown + + uploads: + type: pagemedia + label: PLUGIN_ADMIN.PAGE_MEDIA + + options: + type: tab + title: PLUGIN_ADMIN.OPTIONS + + fields: + + columns: + type: columns + + fields: + column1: + type: column + + fields: + + ordering: + type: toggle + label: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX + help: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX_HELP + highlight: 1 + options: + 1: PLUGIN_ADMIN.ENABLED + 0: PLUGIN_ADMIN.DISABLED + validate: + type: bool + + folder: + type: text + label: PLUGIN_ADMIN.FOLDER_NAME + help: PLUGIN_ADMIN.FOLDER_NAME_HELP + validate: + type: slug + required: true + + route: + type: select + label: PLUGIN_ADMIN.PARENT + classes: fancy + data-options@: '\Grav\Common\Page\Pages::parents' + data-default@: '\Grav\Plugin\admin::route' + options: + '/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT + + name: + type: select + classes: fancy + label: PLUGIN_ADMIN.DISPLAY_TEMPLATE + help: PLUGIN_ADMIN.DISPLAY_TEMPLATE_HELP + default: default + data-options@: '\Grav\Common\Page\Pages::types' + validate: + required: true + + column2: + type: column + + fields: + order: + type: order + label: PLUGIN_ADMIN.ORDERING + + blueprint: + type: blueprint