updated core to 1.7.15
This commit is contained in:
125
system/blueprints/config/backups.yaml
Normal file
125
system/blueprints/config/backups.yaml
Normal file
@@ -0,0 +1,125 @@
|
||||
title: PLUGIN_ADMIN.BACKUPS
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
|
||||
fields:
|
||||
history_title:
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.BACKUPS_HISTORY
|
||||
underline: true
|
||||
|
||||
history:
|
||||
type: backupshistory
|
||||
|
||||
config_title:
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.BACKUPS_PURGE_CONFIG
|
||||
underline: true
|
||||
|
||||
purge.trigger:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.BACKUPS_STORAGE_PURGE_TRIGGER
|
||||
size: medium
|
||||
default: space
|
||||
options:
|
||||
space: Maximum Backup Space
|
||||
number: Maximum Number of Backups
|
||||
time: maximum Retention Time
|
||||
validate:
|
||||
required: true
|
||||
|
||||
purge.max_backups_count:
|
||||
type: number
|
||||
label: PLUGIN_ADMIN.BACKUPS_MAX_COUNT
|
||||
default: 25
|
||||
size: x-small
|
||||
help: PLUGIN_ADMIN.BACKUPS_MAX_COUNT
|
||||
validate:
|
||||
min: 0
|
||||
type: number
|
||||
required: true
|
||||
message: Must be a number 0 or greater
|
||||
|
||||
purge.max_backups_space:
|
||||
type: number
|
||||
label: PLUGIN_ADMIN.BACKUPS_MAX_SPACE
|
||||
append: in GB
|
||||
size: x-small
|
||||
default: 5
|
||||
validate:
|
||||
min: 1
|
||||
type: number
|
||||
required: true
|
||||
message: Space must be 1GB or greater
|
||||
|
||||
purge.max_backups_time:
|
||||
type: number
|
||||
label: PLUGIN_ADMIN.BACKUPS_MAX_RETENTION_TIME
|
||||
append: PLUGIN_ADMIN.BACKUPS_MAX_RETENTION_TIME_APPEND
|
||||
size: x-small
|
||||
default: 365
|
||||
validate:
|
||||
min: 7
|
||||
type: number
|
||||
required: true
|
||||
message: Rentenion days must be 7 or greater
|
||||
|
||||
profiles_title:
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.BACKUPS_PROFILES
|
||||
underline: true
|
||||
|
||||
profiles:
|
||||
type: list
|
||||
style: vertical
|
||||
label:
|
||||
classes: backups-list compact
|
||||
sort: false
|
||||
|
||||
fields:
|
||||
.name:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.NAME
|
||||
placeholder: PLUGIN_ADMIN.BACKUPS_PROFILE_NAME
|
||||
validate:
|
||||
max: 20
|
||||
message: 'Name must be less than 20 characters'
|
||||
required: true
|
||||
.root:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.BACKUPS_PROFILE_ROOT_FOLDER
|
||||
help: PLUGIN_ADMIN.BACKUPS_PROFILE_ROOT_FOLDER_HELP
|
||||
placeholder: '/'
|
||||
default: '/'
|
||||
validate:
|
||||
required: true
|
||||
.exclude_paths:
|
||||
type: textarea
|
||||
label: PLUGIN_ADMIN.BACKUPS_PROFILE_EXCLUDE_PATHS
|
||||
rows: 5
|
||||
placeholder: "/backup\r/cache\r/images\r/logs\r/tmp"
|
||||
help: PLUGIN_ADMIN.BACKUPS_PROFILE_EXCLUDE_PATHS_HELP
|
||||
.exclude_files:
|
||||
type: textarea
|
||||
label: PLUGIN_ADMIN.BACKUPS_PROFILE_EXCLUDE_FILES
|
||||
rows: 5
|
||||
placeholder: ".DS_Store\r.git\r.svn\r.hg\r.idea\r.vscode\rnode_modules"
|
||||
help: PLUGIN_ADMIN.BACKUPS_PROFILE_EXCLUDE_FILES_HELP
|
||||
.schedule:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.BACKUPS_PROFILE_SCHEDULE
|
||||
highlight: 1
|
||||
default: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.YES
|
||||
0: PLUGIN_ADMIN.NO
|
||||
validate:
|
||||
type: bool
|
||||
.schedule_at:
|
||||
type: cron
|
||||
label: PLUGIN_ADMIN.BACKUPS_PROFILE_SCHEDULE_AT
|
||||
default: '* 3 * * *'
|
||||
validate:
|
||||
required: true
|
||||
|
77
system/blueprints/config/scheduler.yaml
Normal file
77
system/blueprints/config/scheduler.yaml
Normal file
@@ -0,0 +1,77 @@
|
||||
title: PLUGIN_ADMIN.SCHEDULER
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
|
||||
fields:
|
||||
|
||||
status_title:
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.SCHEDULER_STATUS
|
||||
underline: true
|
||||
|
||||
status:
|
||||
type: cronstatus
|
||||
validate:
|
||||
type: commalist
|
||||
|
||||
jobs_title:
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.SCHEDULER_JOBS
|
||||
underline: true
|
||||
|
||||
custom_jobs:
|
||||
type: list
|
||||
style: vertical
|
||||
label:
|
||||
classes: cron-job-list compact
|
||||
key: id
|
||||
fields:
|
||||
.id:
|
||||
type: key
|
||||
label: ID
|
||||
placeholder: 'process-name'
|
||||
validate:
|
||||
required: true
|
||||
pattern: '[a-zа-я0-9_\-]+'
|
||||
max: 20
|
||||
message: 'ID must be lowercase with dashes/underscores only and less than 20 characters'
|
||||
.command:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.COMMAND
|
||||
placeholder: 'ls'
|
||||
validate:
|
||||
required: true
|
||||
.args:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.EXTRA_ARGUMENTS
|
||||
placeholder: '-lah'
|
||||
.at:
|
||||
type: cron
|
||||
label: PLUGIN_ADMIN.SCHEDULER_RUNAT
|
||||
help: PLUGIN_ADMIN.SCHEDULER_RUNAT_HELP
|
||||
placeholder: '* * * * *'
|
||||
validate:
|
||||
required: true
|
||||
.output:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.SCHEDULER_OUTPUT
|
||||
help: PLUGIN_ADMIN.SCHEDULER_OUTPUT_HELP
|
||||
placeholder: 'logs/ls-cron.out'
|
||||
.output_mode:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.SCHEDULER_OUTPUT_TYPE
|
||||
help: PLUGIN_ADMIN.SCHEDULER_OUTPUT_TYPE_HELP
|
||||
default: append
|
||||
options:
|
||||
append: Append
|
||||
overwrite: Overwrite
|
||||
.email:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.SCHEDULER_EMAIL
|
||||
help: PLUGIN_ADMIN.SCHEDULER_EMAIL_HELP
|
||||
placeholder: 'notifications@yoursite.com'
|
||||
|
||||
|
||||
|
||||
|
@@ -41,6 +41,14 @@ form:
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
xss_invalid_protocols:
|
||||
type: selectize
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.XSS_INVALID_PROTOCOLS_LIST
|
||||
classes: fancy
|
||||
validate:
|
||||
type: commalist
|
||||
|
||||
xss_enabled.moz_binding:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.XSS_MOZ_BINDINGS
|
||||
@@ -97,3 +105,15 @@ form:
|
||||
validate:
|
||||
type: commalist
|
||||
|
||||
|
||||
sanitize_svg:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.SANITIZE_SVG
|
||||
help: PLUGIN_ADMIN.SANITIZE_SVG_HELP
|
||||
highlight: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.YES
|
||||
0: PLUGIN_ADMIN.NO
|
||||
default: true
|
||||
validate:
|
||||
type: bool
|
||||
|
@@ -65,7 +65,7 @@ form:
|
||||
|
||||
summary.size:
|
||||
type: text
|
||||
size: x-small
|
||||
size: small
|
||||
append: PLUGIN_ADMIN.CHARACTERS
|
||||
label: PLUGIN_ADMIN.SUMMARY_SIZE
|
||||
help: PLUGIN_ADMIN.SUMMARY_SIZE_HELP
|
||||
|
File diff suppressed because it is too large
Load Diff
8
system/blueprints/flex/accounts.yaml
Normal file
8
system/blueprints/flex/accounts.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
title: Flex User Accounts
|
||||
description: Manage your User Accounts in Flex.
|
||||
type: flex-objects
|
||||
|
||||
# Deprecated in Grav 1.7.0-rc.4: file was renamed to user-accounts.yaml
|
||||
extends@:
|
||||
type: user-accounts
|
||||
context: blueprints://flex
|
17
system/blueprints/flex/configure/compat.yaml
Normal file
17
system/blueprints/flex/configure/compat.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
form:
|
||||
compatibility:
|
||||
type: tab
|
||||
title: Compatibility
|
||||
fields:
|
||||
object.compat.events:
|
||||
type: toggle
|
||||
toggleable: true
|
||||
label: Admin event compatibility
|
||||
help: Enables onAdminSave and onAdminAfterSave events for plugins
|
||||
highlight: 1
|
||||
default: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
212
system/blueprints/flex/pages.yaml
Normal file
212
system/blueprints/flex/pages.yaml
Normal file
@@ -0,0 +1,212 @@
|
||||
title: Pages
|
||||
description: Manage your Grav Pages in Flex.
|
||||
type: flex-objects
|
||||
|
||||
# Extends a page (blueprint gets overridden inside the object)
|
||||
extends@:
|
||||
type: default
|
||||
context: blueprints://pages
|
||||
|
||||
#
|
||||
# HIGHLY SPECIALIZED FLEX TYPE, AVOID USING PAGES AS BASE FOR YOUR OWN TYPE.
|
||||
#
|
||||
|
||||
# Flex configuration
|
||||
config:
|
||||
# Administration Configuration (needs Flex Objects plugin)
|
||||
admin:
|
||||
# Admin router
|
||||
router:
|
||||
path: '/pages'
|
||||
|
||||
# Permissions
|
||||
permissions:
|
||||
# Primary permissions
|
||||
admin.pages:
|
||||
type: crudl
|
||||
label: Pages
|
||||
admin.configuration.pages:
|
||||
type: default
|
||||
label: Pages Configuration
|
||||
|
||||
# Admin menu
|
||||
menu:
|
||||
list:
|
||||
route: '/pages'
|
||||
title: PLUGIN_ADMIN.PAGES
|
||||
icon: fa-file-text
|
||||
authorize: ['admin.pages.list', 'admin.super']
|
||||
priority: 5
|
||||
|
||||
# Admin template type (folder)
|
||||
template: pages
|
||||
|
||||
# Allowed admin actions
|
||||
actions:
|
||||
list: true
|
||||
create: true
|
||||
read: true
|
||||
update: true
|
||||
delete: true
|
||||
|
||||
# List view
|
||||
list:
|
||||
# Fields shown in the list view
|
||||
fields:
|
||||
published:
|
||||
width: 8
|
||||
alias: header.published
|
||||
visible:
|
||||
width: 8
|
||||
field:
|
||||
label: Visible
|
||||
type: toggle
|
||||
menu:
|
||||
link: edit
|
||||
alias: header.menu
|
||||
full_route:
|
||||
field:
|
||||
label: Route
|
||||
type: text
|
||||
link: edit
|
||||
sort:
|
||||
field: key
|
||||
name:
|
||||
width: 8
|
||||
field:
|
||||
label: Type
|
||||
type: text
|
||||
translations:
|
||||
width: 8
|
||||
field:
|
||||
label: Translations
|
||||
type: text
|
||||
# updated_date:
|
||||
# alias: header.update_date
|
||||
|
||||
# Extra options
|
||||
options:
|
||||
# Default number of records for pagination
|
||||
per_page: 20
|
||||
# Default ordering
|
||||
order:
|
||||
by: key
|
||||
dir: asc
|
||||
|
||||
# TODO: not used yet
|
||||
buttons:
|
||||
back:
|
||||
icon: reply
|
||||
title: PLUGIN_ADMIN.BACK
|
||||
add:
|
||||
icon: plus
|
||||
label: PLUGIN_ADMIN.ADD
|
||||
|
||||
edit:
|
||||
title:
|
||||
template: "{% if object.root %}Root <small>( <root> ){% else %}{{ (form.value('header.title') ?? form.value('folder'))|e }} <small>( {{ (object.getRoute().toString(false) ?: '/')|e }} )</small>{% endif %}"
|
||||
|
||||
# TODO: not used yet
|
||||
buttons:
|
||||
back:
|
||||
icon: reply
|
||||
title: PLUGIN_ADMIN.BACK
|
||||
preview:
|
||||
icon: eye
|
||||
title: PLUGIN_ADMIN.PREVIEW
|
||||
add:
|
||||
icon: plus
|
||||
label: PLUGIN_ADMIN.ADD
|
||||
copy:
|
||||
icon: copy
|
||||
label: PLUGIN_ADMIN.COPY
|
||||
move:
|
||||
icon: arrows
|
||||
label: PLUGIN_ADMIN.MOVE
|
||||
delete:
|
||||
icon: close
|
||||
label: PLUGIN_ADMIN.DELETE
|
||||
save:
|
||||
icon: check
|
||||
label: PLUGIN_ADMIN.SAVE
|
||||
|
||||
# Preview View
|
||||
preview:
|
||||
enabled: true
|
||||
|
||||
# Configure view
|
||||
configure:
|
||||
authorize: 'admin.configuration.pages'
|
||||
|
||||
# Site Configuration
|
||||
site:
|
||||
# Hide from flex types
|
||||
hidden: true
|
||||
templates:
|
||||
collection:
|
||||
# Lookup for the template layout files for collections of objects
|
||||
paths:
|
||||
- 'flex/{TYPE}/collection/{LAYOUT}{EXT}'
|
||||
object:
|
||||
# Lookup for the template layout files for objects
|
||||
paths:
|
||||
- 'flex/{TYPE}/object/{LAYOUT}{EXT}'
|
||||
defaults:
|
||||
# Default template {TYPE}; overridden by filename of this blueprint if template folder exists
|
||||
type: pages
|
||||
# Default template {LAYOUT}; can be overridden in render calls (usually Twig in templates)
|
||||
layout: default
|
||||
|
||||
# Default filters for frontend.
|
||||
filter:
|
||||
- withPublished
|
||||
|
||||
# Data Configuration
|
||||
data:
|
||||
object: 'Grav\Common\Flex\Types\Pages\PageObject'
|
||||
collection: 'Grav\Common\Flex\Types\Pages\PageCollection'
|
||||
index: 'Grav\Common\Flex\Types\Pages\PageIndex'
|
||||
storage:
|
||||
class: 'Grav\Common\Flex\Types\Pages\Storage\PageStorage'
|
||||
options:
|
||||
formatter:
|
||||
class: 'Grav\Framework\File\Formatter\MarkdownFormatter'
|
||||
folder: 'page://'
|
||||
# Keep index file in filesystem to speed up lookups
|
||||
indexed: true
|
||||
# Set default ordering of the pages
|
||||
ordering:
|
||||
storage_key: ASC
|
||||
search:
|
||||
# Search options
|
||||
options:
|
||||
contains: 1
|
||||
# Fields to be searched
|
||||
fields:
|
||||
- key
|
||||
- menu
|
||||
- title
|
||||
- name
|
||||
|
||||
blueprints:
|
||||
configure:
|
||||
fields:
|
||||
import@:
|
||||
type: configure/compat
|
||||
context: blueprints://flex
|
||||
|
||||
# Regular form definition
|
||||
form:
|
||||
fields:
|
||||
lang:
|
||||
type: hidden
|
||||
value: ''
|
||||
|
||||
tabs:
|
||||
fields:
|
||||
security:
|
||||
type: tab
|
||||
title: PLUGIN_ADMIN.SECURITY
|
||||
import@:
|
||||
type: partials/security
|
||||
context: blueprints://pages
|
70
system/blueprints/flex/shared/configure.yaml
Normal file
70
system/blueprints/flex/shared/configure.yaml
Normal file
@@ -0,0 +1,70 @@
|
||||
form:
|
||||
validation: loose
|
||||
|
||||
fields:
|
||||
tabs:
|
||||
type: tabs
|
||||
fields:
|
||||
cache:
|
||||
type: tab
|
||||
title: Caching
|
||||
fields:
|
||||
object.cache.index.enabled:
|
||||
type: toggle
|
||||
toggleable: true
|
||||
label: PLUGIN_ADMIN.FLEX_INDEX_CACHE_ENABLED
|
||||
highlight: 1
|
||||
config-default@: system.flex.cache.index.enabled
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
object.cache.index.lifetime:
|
||||
type: text
|
||||
toggleable: true
|
||||
label: PLUGIN_ADMIN.FLEX_INDEX_CACHE_LIFETIME
|
||||
config-default@: system.flex.cache.index.lifetime
|
||||
validate:
|
||||
type: int
|
||||
|
||||
object.cache.object.enabled:
|
||||
type: toggle
|
||||
toggleable: true
|
||||
label: PLUGIN_ADMIN.FLEX_OBJECT_CACHE_ENABLED
|
||||
highlight: 1
|
||||
config-default@: system.flex.cache.object.enabled
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
object.cache.object.lifetime:
|
||||
type: text
|
||||
toggleable: true
|
||||
label: PLUGIN_ADMIN.FLEX_OBJECT_CACHE_LIFETIME
|
||||
config-default@: system.flex.cache.object.lifetime
|
||||
validate:
|
||||
type: int
|
||||
|
||||
object.cache.render.enabled:
|
||||
type: toggle
|
||||
toggleable: true
|
||||
label: PLUGIN_ADMIN.FLEX_RENDER_CACHE_ENABLED
|
||||
highlight: 1
|
||||
config-default@: system.flex.cache.render.enabled
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
object.cache.render.lifetime:
|
||||
type: text
|
||||
toggleable: true
|
||||
label: PLUGIN_ADMIN.FLEX_RENDER_CACHE_LIFETIME
|
||||
config-default@: system.flex.cache.render.lifetime
|
||||
validate:
|
||||
type: int
|
142
system/blueprints/flex/user-accounts.yaml
Normal file
142
system/blueprints/flex/user-accounts.yaml
Normal file
@@ -0,0 +1,142 @@
|
||||
title: User Accounts
|
||||
description: Manage your User Accounts in Flex.
|
||||
type: flex-objects
|
||||
|
||||
# Extends user account
|
||||
extends@:
|
||||
type: account
|
||||
context: blueprints://user
|
||||
|
||||
#
|
||||
# HIGHLY SPECIALIZED FLEX TYPE, AVOID USING USER ACCOUNTS AS BASE FOR YOUR OWN TYPE.
|
||||
#
|
||||
|
||||
# Flex configuration
|
||||
config:
|
||||
# Administration Configuration (needs Flex Objects plugin)
|
||||
admin:
|
||||
# Admin router
|
||||
router:
|
||||
path: '/accounts/users'
|
||||
actions:
|
||||
configure:
|
||||
path: '/accounts/configure'
|
||||
redirects:
|
||||
'/user': '/accounts/users'
|
||||
'/accounts': '/accounts/users'
|
||||
|
||||
# Permissions
|
||||
permissions:
|
||||
# Primary permissions
|
||||
admin.users:
|
||||
type: crudl
|
||||
label: User Accounts
|
||||
admin.configuration.users:
|
||||
type: default
|
||||
label: Accounts Configuration
|
||||
|
||||
# Admin menu
|
||||
menu:
|
||||
base:
|
||||
location: '/accounts'
|
||||
route: '/accounts/users'
|
||||
index: 0
|
||||
title: PLUGIN_ADMIN.ACCOUNTS
|
||||
icon: fa-users
|
||||
authorize: ['admin.users.list', 'admin.super']
|
||||
priority: 6
|
||||
|
||||
# Admin template type (folder)
|
||||
template: user-accounts
|
||||
|
||||
# List view
|
||||
list:
|
||||
# Fields shown in the list view
|
||||
fields:
|
||||
username:
|
||||
link: edit
|
||||
search: true
|
||||
field:
|
||||
label: PLUGIN_ADMIN.USERNAME
|
||||
email:
|
||||
search: true
|
||||
fullname:
|
||||
search: true
|
||||
# Extra options
|
||||
options:
|
||||
per_page: 20
|
||||
order:
|
||||
by: username
|
||||
dir: asc
|
||||
|
||||
# Edit view
|
||||
edit:
|
||||
title:
|
||||
template: "{{ form.value('fullname') ?? form.value('username') }} <{{ form.value('email') }}>"
|
||||
|
||||
# Configure view
|
||||
configure:
|
||||
hidden: true
|
||||
authorize: 'admin.configuration.users'
|
||||
form: 'accounts'
|
||||
title:
|
||||
template: "{{ 'PLUGIN_ADMIN.ACCOUNTS'|tu }} {{ 'PLUGIN_ADMIN.CONFIGURATION'|tu }}"
|
||||
|
||||
# Site Configuration
|
||||
site:
|
||||
# Hide from flex types
|
||||
hidden: true
|
||||
templates:
|
||||
collection:
|
||||
# Lookup for the template layout files for collections of objects
|
||||
paths:
|
||||
- 'flex/{TYPE}/collection/{LAYOUT}{EXT}'
|
||||
object:
|
||||
# Lookup for the template layout files for objects
|
||||
paths:
|
||||
- 'flex/{TYPE}/object/{LAYOUT}{EXT}'
|
||||
defaults:
|
||||
# Default template {TYPE}; overridden by filename of this blueprint if template folder exists
|
||||
type: user-accounts
|
||||
# Default template {LAYOUT}; can be overridden in render calls (usually Twig in templates)
|
||||
layout: default
|
||||
|
||||
# Data Configuration
|
||||
data:
|
||||
object: 'Grav\Common\Flex\Types\Users\UserObject'
|
||||
collection: 'Grav\Common\Flex\Types\Users\UserCollection'
|
||||
index: 'Grav\Common\Flex\Types\Users\UserIndex'
|
||||
storage:
|
||||
class: 'Grav\Common\Flex\Types\Users\Storage\UserFileStorage'
|
||||
options:
|
||||
formatter:
|
||||
class: 'Grav\Framework\File\Formatter\YamlFormatter'
|
||||
folder: 'account://'
|
||||
pattern: '{FOLDER}/{KEY}{EXT}'
|
||||
indexed: true
|
||||
key: username
|
||||
case_sensitive: false
|
||||
search:
|
||||
options:
|
||||
contains: 1
|
||||
fields:
|
||||
- key
|
||||
- email
|
||||
|
||||
blueprints:
|
||||
configure:
|
||||
fields:
|
||||
import@:
|
||||
type: configure/compat
|
||||
context: blueprints://flex
|
||||
|
||||
# Regular form definition
|
||||
form:
|
||||
fields:
|
||||
username:
|
||||
flex-disabled@: exists
|
||||
disabled: false
|
||||
flex-readonly@: exists
|
||||
readonly: false
|
||||
validate:
|
||||
required: true
|
123
system/blueprints/flex/user-groups.yaml
Normal file
123
system/blueprints/flex/user-groups.yaml
Normal file
@@ -0,0 +1,123 @@
|
||||
title: User Groups
|
||||
description: Manage your User Groups in Flex.
|
||||
type: flex-objects
|
||||
|
||||
# Extends user group
|
||||
extends@:
|
||||
type: group
|
||||
context: blueprints://user
|
||||
|
||||
# Flex configuration
|
||||
config:
|
||||
# Administration Configuration (needs Flex Objects plugin)
|
||||
admin:
|
||||
# Admin router
|
||||
router:
|
||||
path: '/accounts/groups'
|
||||
actions:
|
||||
configure:
|
||||
path: '/accounts/configure'
|
||||
redirects:
|
||||
'/groups': '/accounts/groups'
|
||||
'/accounts': '/accounts/groups'
|
||||
|
||||
# Permissions
|
||||
permissions:
|
||||
# Primary permissions
|
||||
admin.users:
|
||||
type: crudl
|
||||
label: User Accounts
|
||||
admin.configuration.users:
|
||||
type: default
|
||||
label: Accounts Configuration
|
||||
|
||||
# Admin menu
|
||||
menu:
|
||||
base:
|
||||
location: '/accounts'
|
||||
route: '/accounts/groups'
|
||||
index: 1
|
||||
title: PLUGIN_ADMIN.ACCOUNTS
|
||||
icon: fa-users
|
||||
authorize: ['admin.users.list', 'admin.super']
|
||||
priority: 6
|
||||
|
||||
# Admin template type (folder)
|
||||
template: user-groups
|
||||
|
||||
# List view
|
||||
list:
|
||||
# Fields shown in the list view
|
||||
fields:
|
||||
groupname:
|
||||
link: edit
|
||||
search: true
|
||||
readableName:
|
||||
search: true
|
||||
description:
|
||||
search: true
|
||||
# Extra options
|
||||
options:
|
||||
per_page: 20
|
||||
order:
|
||||
by: groupname
|
||||
dir: asc
|
||||
|
||||
# Edit view
|
||||
edit:
|
||||
title:
|
||||
template: "{{ form.value('readableName') ?? form.value('groupname') }}"
|
||||
|
||||
# Configure view
|
||||
configure:
|
||||
hidden: true
|
||||
authorize: 'admin.configuration.users'
|
||||
form: 'accounts'
|
||||
title:
|
||||
template: "{{ 'PLUGIN_ADMIN.ACCOUNTS'|tu }} {{ 'PLUGIN_ADMIN.CONFIGURATION'|tu }}"
|
||||
|
||||
# Site Configuration
|
||||
site:
|
||||
# Hide from flex types
|
||||
hidden: true
|
||||
templates:
|
||||
collection:
|
||||
# Lookup for the template layout files for collections of objects
|
||||
paths:
|
||||
- 'flex/{TYPE}/collection/{LAYOUT}{EXT}'
|
||||
object:
|
||||
# Lookup for the template layout files for objects
|
||||
paths:
|
||||
- 'flex/{TYPE}/object/{LAYOUT}{EXT}'
|
||||
defaults:
|
||||
# Default template {TYPE}; overridden by filename of this blueprint if template folder exists
|
||||
type: user-groups
|
||||
# Default template {LAYOUT}; can be overridden in render calls (usually Twig in templates)
|
||||
layout: default
|
||||
|
||||
# Data Configuration
|
||||
data:
|
||||
object: 'Grav\Common\Flex\Types\UserGroups\UserGroupObject'
|
||||
collection: 'Grav\Common\Flex\Types\UserGroups\UserGroupCollection'
|
||||
index: 'Grav\Common\Flex\Types\UserGroups\UserGroupIndex'
|
||||
storage:
|
||||
class: 'Grav\Framework\Flex\Storage\SimpleStorage'
|
||||
options:
|
||||
formatter:
|
||||
class: 'Grav\Framework\File\Formatter\YamlFormatter'
|
||||
folder: 'user://config/groups.yaml'
|
||||
key: groupname
|
||||
search:
|
||||
options:
|
||||
contains: 1
|
||||
fields:
|
||||
- key
|
||||
- groupname
|
||||
- description
|
||||
|
||||
blueprints:
|
||||
configure:
|
||||
fields:
|
||||
import@:
|
||||
type: configure/compat
|
||||
context: blueprints://flex
|
@@ -121,7 +121,7 @@ form:
|
||||
underline: true
|
||||
|
||||
folder:
|
||||
type: text
|
||||
type: folder-slug
|
||||
label: PLUGIN_ADMIN.FOLDER_NAME
|
||||
validate:
|
||||
rule: slug
|
||||
|
@@ -1,4 +1,4 @@
|
||||
title: PLUGIN_ADMIN.MODULAR
|
||||
title: PLUGIN_ADMIN.MODULE
|
||||
extends@: default
|
||||
|
||||
form:
|
||||
@@ -13,7 +13,7 @@ form:
|
||||
|
||||
modular_title:
|
||||
type: spacer
|
||||
title: PLUGIN_ADMIN.MODULAR_SETUP
|
||||
title: PLUGIN_ADMIN.MODULE_SETUP
|
||||
|
||||
header.content.items:
|
||||
type: text
|
||||
@@ -34,5 +34,3 @@ form:
|
||||
help: '"desc" or "asc" are valid values'
|
||||
placeholder: desc
|
||||
size: small
|
||||
|
||||
|
||||
|
71
system/blueprints/pages/partials/security.yaml
Normal file
71
system/blueprints/pages/partials/security.yaml
Normal file
@@ -0,0 +1,71 @@
|
||||
form:
|
||||
fields:
|
||||
_site:
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.PAGE_ACCESS
|
||||
underline: true
|
||||
|
||||
fields:
|
||||
|
||||
header.login.visibility_requires_access:
|
||||
type: toggle
|
||||
toggleable: true
|
||||
label: PLUGIN_ADMIN.PAGE_VISIBILITY_REQUIRES_ACCESS
|
||||
help: PLUGIN_ADMIN.PAGE_VISIBILITY_REQUIRES_ACCESS_HELP
|
||||
highlight: 0
|
||||
options:
|
||||
1: PLUGIN_ADMIN.YES
|
||||
0: PLUGIN_ADMIN.NO
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
|
||||
header.access:
|
||||
type: acl_picker
|
||||
label: PLUGIN_ADMIN.PAGE_ACCESS
|
||||
help: PLUGIN_ADMIN.PAGE_ACCESS_HELP
|
||||
ignore_empty: true
|
||||
data_type: access
|
||||
validate:
|
||||
type: array
|
||||
value_type: bool
|
||||
|
||||
_admin:
|
||||
security@: {or: [admin.super, admin.configuration.pages]}
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.PAGE PERMISSIONS
|
||||
underline: true
|
||||
|
||||
fields:
|
||||
|
||||
header.permissions.inherit:
|
||||
type: toggle
|
||||
toggleable: true
|
||||
label: PLUGIN_ADMIN.PAGE_INHERIT_PERMISSIONS
|
||||
help: PLUGIN_ADMIN.PAGE_INHERIT_PERMISSIONS_HELP
|
||||
highlight: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.YES
|
||||
0: PLUGIN_ADMIN.NO
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
header.permissions.authors:
|
||||
type: list
|
||||
toggleable: true
|
||||
label: PLUGIN_ADMIN.PAGE_AUTHORS
|
||||
help: PLUGIN_ADMIN.PAGE_AUTHORS_HELP
|
||||
|
||||
fields:
|
||||
value:
|
||||
type: text
|
||||
placeholder: PLUGIN_ADMIN.USERNAME
|
||||
style: vertical
|
||||
|
||||
header.permissions.groups:
|
||||
ignore@: true
|
||||
type: acl_picker
|
||||
label: PLUGIN_ADMIN.PAGE_GROUPS
|
||||
help: PLUGIN_ADMIN.PAGE_GROUPS_HELP
|
||||
ignore_empty: true
|
||||
data_type: permissions
|
16
system/blueprints/pages/root.yaml
Normal file
16
system/blueprints/pages/root.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
title: PLUGIN_ADMIN.ROOT
|
||||
|
||||
rules:
|
||||
slug:
|
||||
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||
min: 1
|
||||
max: 200
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
|
||||
fields:
|
||||
|
||||
tabs:
|
||||
type: tabs
|
||||
active: 1
|
@@ -4,122 +4,137 @@ form:
|
||||
|
||||
fields:
|
||||
|
||||
info:
|
||||
type: userinfo
|
||||
size: large
|
||||
info:
|
||||
type: userinfo
|
||||
size: large
|
||||
|
||||
avatar:
|
||||
type: file
|
||||
size: large
|
||||
destination: 'user://accounts/avatars'
|
||||
multiple: false
|
||||
random_name: true
|
||||
avatar:
|
||||
type: file
|
||||
size: large
|
||||
destination: 'user://accounts/avatars'
|
||||
multiple: false
|
||||
random_name: true
|
||||
|
||||
content:
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.ACCOUNT
|
||||
underline: true
|
||||
content:
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.ACCOUNT
|
||||
underline: true
|
||||
|
||||
username:
|
||||
type: text
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.USERNAME
|
||||
disabled: true
|
||||
readonly: true
|
||||
username:
|
||||
type: text
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.USERNAME
|
||||
disabled: true
|
||||
readonly: true
|
||||
|
||||
email:
|
||||
type: email
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.EMAIL
|
||||
validate:
|
||||
type: email
|
||||
message: PLUGIN_ADMIN.EMAIL_VALIDATION_MESSAGE
|
||||
required: true
|
||||
email:
|
||||
type: email
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.EMAIL
|
||||
validate:
|
||||
type: email
|
||||
message: PLUGIN_ADMIN.EMAIL_VALIDATION_MESSAGE
|
||||
required: true
|
||||
|
||||
password:
|
||||
type: password
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.PASSWORD
|
||||
autocomplete: new-password
|
||||
validate:
|
||||
required: false
|
||||
message: PLUGIN_ADMIN.PASSWORD_VALIDATION_MESSAGE
|
||||
config-pattern@: system.pwd_regex
|
||||
password:
|
||||
type: password
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.PASSWORD
|
||||
autocomplete: new-password
|
||||
validate:
|
||||
required: false
|
||||
message: PLUGIN_ADMIN.PASSWORD_VALIDATION_MESSAGE
|
||||
config-pattern@: system.pwd_regex
|
||||
|
||||
fullname:
|
||||
type: text
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.FULL_NAME
|
||||
validate:
|
||||
required: true
|
||||
fullname:
|
||||
type: text
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.FULL_NAME
|
||||
validate:
|
||||
required: true
|
||||
|
||||
title:
|
||||
type: text
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.TITLE
|
||||
title:
|
||||
type: text
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.TITLE
|
||||
|
||||
language:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.LANGUAGE
|
||||
size: medium
|
||||
classes: fancy
|
||||
data-options@: '\Grav\Plugin\Admin\Admin::adminLanguages'
|
||||
default: 'en'
|
||||
help: PLUGIN_ADMIN.LANGUAGE_HELP
|
||||
language:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.LANGUAGE
|
||||
size: medium
|
||||
classes: fancy
|
||||
data-options@: '\Grav\Plugin\Admin\Admin::adminLanguages'
|
||||
default: 'en'
|
||||
help: PLUGIN_ADMIN.LANGUAGE_HELP
|
||||
|
||||
twofa_check:
|
||||
type: conditional
|
||||
condition: config.plugins.admin.twofa_enabled
|
||||
content_editor:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.CONTENT_EDITOR
|
||||
size: medium
|
||||
classes: fancy
|
||||
data-options@: 'Grav\Plugin\Admin\Admin::contentEditor'
|
||||
default: 'default'
|
||||
help: PLUGIN_ADMIN.CONTENT_EDITOR_HELP
|
||||
|
||||
fields:
|
||||
twofa_check:
|
||||
type: conditional
|
||||
condition: config.plugins.admin.twofa_enabled
|
||||
|
||||
twofa:
|
||||
title: PLUGIN_ADMIN.2FA_TITLE
|
||||
type: section
|
||||
underline: true
|
||||
fields:
|
||||
|
||||
twofa_enabled:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.2FA_ENABLED
|
||||
classes: twofa-toggle
|
||||
highlight: 1
|
||||
default: 0
|
||||
options:
|
||||
1: PLUGIN_ADMIN.YES
|
||||
0: PLUGIN_ADMIN.NO
|
||||
validate:
|
||||
type: bool
|
||||
twofa:
|
||||
title: PLUGIN_ADMIN.2FA_TITLE
|
||||
type: section
|
||||
underline: true
|
||||
|
||||
twofa_enabled:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.2FA_ENABLED
|
||||
classes: twofa-toggle
|
||||
highlight: 1
|
||||
default: 0
|
||||
options:
|
||||
1: PLUGIN_ADMIN.YES
|
||||
0: PLUGIN_ADMIN.NO
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
|
||||
twofa_secret:
|
||||
type: 2fa_secret
|
||||
outerclasses: 'twofa-secret'
|
||||
markdown: true
|
||||
label: PLUGIN_ADMIN.2FA_SECRET
|
||||
sublabel: PLUGIN_ADMIN.2FA_SECRET_HELP
|
||||
twofa_secret:
|
||||
type: 2fa_secret
|
||||
outerclasses: 'twofa-secret'
|
||||
markdown: true
|
||||
label: PLUGIN_ADMIN.2FA_SECRET
|
||||
sublabel: PLUGIN_ADMIN.2FA_SECRET_HELP
|
||||
|
||||
|
||||
security:
|
||||
title: PLUGIN_ADMIN.ACCESS_LEVELS
|
||||
type: section
|
||||
security: admin.super
|
||||
underline: true
|
||||
|
||||
fields:
|
||||
groups:
|
||||
type: select
|
||||
multiple: true
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.GROUPS
|
||||
data-options@: '\Grav\Common\User\Group::groupNames'
|
||||
classes: fancy
|
||||
help: PLUGIN_ADMIN.GROUPS_HELP
|
||||
validate:
|
||||
type: commalist
|
||||
|
||||
access:
|
||||
type: permissions
|
||||
label: PLUGIN_ADMIN.PERMISSIONS
|
||||
ignore_empty: true
|
||||
validate:
|
||||
type: array
|
||||
security:
|
||||
security@: admin.super
|
||||
title: PLUGIN_ADMIN.ACCESS_LEVELS
|
||||
type: section
|
||||
underline: true
|
||||
|
||||
fields:
|
||||
groups:
|
||||
security@: admin.super
|
||||
type: select
|
||||
multiple: true
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.GROUPS
|
||||
data-options@: '\Grav\Common\User\Group::groupNames'
|
||||
classes: fancy
|
||||
help: PLUGIN_ADMIN.GROUPS_HELP
|
||||
validate:
|
||||
type: commalist
|
||||
|
||||
access:
|
||||
security@: admin.super
|
||||
type: permissions
|
||||
check_authorize: true
|
||||
label: PLUGIN_ADMIN.PERMISSIONS
|
||||
ignore_empty: true
|
||||
validate:
|
||||
type: array
|
||||
value_type: bool
|
||||
|
@@ -12,5 +12,7 @@ form:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.USERNAME
|
||||
help: PLUGIN_ADMIN.USERNAME_HELP
|
||||
unset-disabled@: true
|
||||
unset-readonly@: true
|
||||
validate:
|
||||
required: true
|
||||
|
@@ -1,37 +1,55 @@
|
||||
title: Group
|
||||
rules:
|
||||
slug:
|
||||
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||
min: 1
|
||||
max: 200
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
validation: loose
|
||||
|
||||
fields:
|
||||
spacer:
|
||||
type: spacer
|
||||
text: '<br>'
|
||||
fields:
|
||||
groupname:
|
||||
type: text
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.GROUP_NAME
|
||||
flex-disabled@: exists
|
||||
flex-readonly@: exists
|
||||
validate:
|
||||
required: true
|
||||
rule: slug
|
||||
|
||||
groupname:
|
||||
type: text
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.NAME
|
||||
disabled: true
|
||||
readonly: true
|
||||
readableName:
|
||||
type: text
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.DISPLAY_NAME
|
||||
|
||||
readableName:
|
||||
type: text
|
||||
size: large
|
||||
label: PLUGIN_ADMIN_PRO.READABLE_NAME
|
||||
description:
|
||||
type: text
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.DESCRIPTION
|
||||
|
||||
description:
|
||||
type: text
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.DESCRIPTION
|
||||
icon:
|
||||
type: text
|
||||
size: small
|
||||
label: PLUGIN_ADMIN.ICON
|
||||
|
||||
icon:
|
||||
type: text
|
||||
size: small
|
||||
label: PLUGIN_ADMIN_PRO.ICON
|
||||
enabled:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.ENABLED
|
||||
highlight: 1
|
||||
default: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.YES
|
||||
0: PLUGIN_ADMIN.NO
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
access:
|
||||
type: permissions
|
||||
label: PLUGIN_ADMIN.PERMISSIONS
|
||||
ignore_empty: true
|
||||
validate:
|
||||
type: array
|
||||
access:
|
||||
type: permissions
|
||||
check_authorize: false
|
||||
label: PLUGIN_ADMIN.PERMISSIONS
|
||||
ignore_empty: true
|
||||
validate:
|
||||
type: array
|
||||
value_type: bool
|
||||
|
@@ -1,5 +1,11 @@
|
||||
title: PLUGIN_ADMIN_PRO.ADD_GROUP
|
||||
|
||||
rules:
|
||||
slug:
|
||||
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||
min: 1
|
||||
max: 200
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
@@ -14,3 +20,4 @@ form:
|
||||
help: PLUGIN_ADMIN_PRO.GROUP_NAME_HELP
|
||||
validate:
|
||||
required: true
|
||||
rule: slug
|
||||
|
Reference in New Issue
Block a user