user-groups.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. title: User Groups
  2. description: Manage your User Groups in Flex.
  3. type: flex-objects
  4. # Extends user group
  5. extends@:
  6. type: group
  7. context: blueprints://user
  8. # Flex configuration
  9. config:
  10. # Administration Configuration (needs Flex Objects plugin)
  11. admin:
  12. # Admin router
  13. router:
  14. path: '/accounts/groups'
  15. actions:
  16. configure:
  17. path: '/accounts/configure'
  18. redirects:
  19. '/groups': '/accounts/groups'
  20. '/accounts': '/accounts/groups'
  21. # Permissions
  22. permissions:
  23. # Primary permissions
  24. admin.users:
  25. type: crudl
  26. label: User Accounts
  27. admin.configuration.users:
  28. type: default
  29. label: Accounts Configuration
  30. # Admin menu
  31. menu:
  32. base:
  33. location: '/accounts'
  34. route: '/accounts/groups'
  35. index: 1
  36. title: PLUGIN_ADMIN.ACCOUNTS
  37. icon: fa-users
  38. authorize: ['admin.users.list', 'admin.super']
  39. priority: 6
  40. # Admin template type (folder)
  41. template: user-groups
  42. # List view
  43. list:
  44. # Fields shown in the list view
  45. fields:
  46. groupname:
  47. link: edit
  48. search: true
  49. readableName:
  50. search: true
  51. description:
  52. search: true
  53. # Extra options
  54. options:
  55. per_page: 20
  56. order:
  57. by: groupname
  58. dir: asc
  59. # Edit view
  60. edit:
  61. title:
  62. template: "{{ form.value('readableName') ?? form.value('groupname') }}"
  63. # Configure view
  64. configure:
  65. hidden: true
  66. authorize: 'admin.configuration.users'
  67. form: 'accounts'
  68. title:
  69. template: "{{ 'PLUGIN_ADMIN.ACCOUNTS'|tu }} {{ 'PLUGIN_ADMIN.CONFIGURATION'|tu }}"
  70. # Site Configuration
  71. site:
  72. # Hide from flex types
  73. hidden: true
  74. templates:
  75. collection:
  76. # Lookup for the template layout files for collections of objects
  77. paths:
  78. - 'flex/{TYPE}/collection/{LAYOUT}{EXT}'
  79. object:
  80. # Lookup for the template layout files for objects
  81. paths:
  82. - 'flex/{TYPE}/object/{LAYOUT}{EXT}'
  83. defaults:
  84. # Default template {TYPE}; overridden by filename of this blueprint if template folder exists
  85. type: user-groups
  86. # Default template {LAYOUT}; can be overridden in render calls (usually Twig in templates)
  87. layout: default
  88. # Data Configuration
  89. data:
  90. object: 'Grav\Common\Flex\Types\UserGroups\UserGroupObject'
  91. collection: 'Grav\Common\Flex\Types\UserGroups\UserGroupCollection'
  92. index: 'Grav\Common\Flex\Types\UserGroups\UserGroupIndex'
  93. storage:
  94. class: 'Grav\Framework\Flex\Storage\SimpleStorage'
  95. options:
  96. formatter:
  97. class: 'Grav\Framework\File\Formatter\YamlFormatter'
  98. folder: 'user://config/groups.yaml'
  99. key: groupname
  100. search:
  101. options:
  102. contains: 1
  103. fields:
  104. - key
  105. - groupname
  106. - description
  107. blueprints:
  108. configure:
  109. fields:
  110. import@:
  111. type: configure/compat
  112. context: blueprints://flex