This commit is contained in:
Loïc Guibert
2022-09-30 20:02:02 +01:00
commit 66dafc36c3
2561 changed files with 454489 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
type: flex-objects
form:
fields:
# Don't mess with this stuff below unless you know what you are doing
tools_section:
type: section
field_classes: overlay bottom
fields:
_post_entries_save:
label: PLUGIN_FLEX_OBJECTS.AFTER_SAVE
type: save-redirect
default: create-new

View File

@@ -0,0 +1,158 @@
title: Contacts
description: Simple contact directory with tags.
type: flex-objects
# Flex Configuration
config:
# Administration Configuration
admin:
# Admin router (optional)
router:
path: '/contacts'
# Admin menu (optional)
menu:
list:
route: '/contacts'
title: Contacts
icon: fa-address-card-o
# Authorization to collection admin
authorize: ['admin.contacts.list', 'admin.super']
# Priority -10 .. 10 (highest goes up)
priority: 2
# Admin template type / folder
template: default
# Permissions
permissions:
# Primary permissions
admin.contacts:
type: crudpl
label: Contacts
# List view
list:
title: name
fields:
published:
field:
type: toggle
label: Publ
width: 8
last_name:
link: edit
first_name:
link: edit
email:
website:
tags:
# Edit View
edit:
title:
template: '{{ object.last_name ?? ''Last'' }}, {{ object.first_name ?? ''First Name'' }}'
# Preview View
preview:
enabled: false
route:
#template: '/plugins/flex-objects/directory:contacts'
# Data Export
export:
enabled: true
method: 'jsonSerialize'
formatter:
class: 'Grav\Framework\File\Formatter\YamlFormatter'
filename: 'contacts'
# Site Configuration
site:
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: contacts
# Default template {LAYOUT}; can be overridden in render calls (usually Twig in templates)
layout: default
# Data Configuration
data:
# Object class to be used, allowing custom methods for the object
object: 'Grav\Common\Flex\Types\Generic\GenericObject'
# Collection class to be used, allowing custom methods for the collections
collection: 'Grav\Common\Flex\Types\Generic\GenericCollection'
# Index class to be used, works as a quick database-like lookup index
index: 'Grav\Common\Flex\Types\Generic\GenericIndex'
storage:
# Storage class, use single file storage (does not support images and assets)
class: 'Grav\Framework\Flex\Storage\SimpleStorage'
options:
formatter:
# File formatter class, in this case the file is stored in markdown
class: 'Grav\Framework\File\Formatter\JsonFormatter'
# JSON file where all the objects will be stored
folder: user-data://flex-objects/contacts.json
search:
# Search options
options:
contains: 1
# Fields to be searched
fields:
- last_name
- first_name
- email
form:
validation: loose
fields:
published:
type: toggle
label: Published
highlight: 1
default: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
required: true
last_name:
type: text
label: Last Name
validate:
required: true
first_name:
type: text
label: First Name
validate:
required: true
email:
type: email
label: Email Address
validate:
required: true
website:
type: url
label: Website URL
tags:
type: selectize
size: large
label: Tags
classes: fancy
validate:
type: commalist

View File

@@ -0,0 +1,22 @@
title: Pages (Admin)
description: Manage your Grav Pages in the new Flex Pages admin. This allows you to use Flex Pages only in Admin plugin, while still using the old pages in the frontend.
type: flex-objects
extends@:
type: pages
context: blueprints://flex
form:
fields:
lang:
type: hidden
value: ''
tabs:
fields:
security:
type: tab
title: PLUGIN_ADMIN.SECURITY
import@:
type: partials/security
context: blueprints://pages

View File

@@ -0,0 +1,7 @@
title: User Accounts (Admin)
description: Manage your User Accounts in the new Flex Accounts admin. This allows you to use Flex Accounts only in Admin plugin, while still using the old users in the frontend.
type: flex-objects
extends@:
type: user-accounts
context: blueprints://flex

View File

@@ -0,0 +1,7 @@
title: User Groups (Admin)
description: Manage your User Groups in the new Flex admin.
type: flex-objects
extends@:
type: user-groups
context: blueprints://flex

View File

@@ -0,0 +1,21 @@
title: Flex Directory
extends@: default
form:
fields:
tabs:
type: tabs
active: 1
fields:
content:
fields:
header.flex.directory:
ordering@: 2
type: select
label: Flex Directory
style: vertical
data-options@: 'Grav\Plugin\FlexObjectsPlugin::directoryOptions'
options:
'': 'Directory List'