wiki-grav/plugins/flex-objects/admin/templates/flex-objects.html.twig

31 lines
977 B
Twig
Raw Normal View History

{%- set user = admin.user -%}
{%- set route = controller.route -%}
{%- set type = directory.config('admin.template') ?? target -%}
{# Set action from ?preview=1 #}
{%- if key and uri.currentUri().queryParam('preview') %}
{% set action = 'preview' %}
{% endif -%}
{%- set template -%}
{%- if action == 'add' -%}
edit
{%- elseif action == 'delete' -%}
list
{%- else -%}
{{- action ?: task ?: 'types' -}}
{%- endif -%}
{%- endset -%}
{%- set separator = config.system.param_sep -%}
{%- set view_config = directory.config('admin.views.' ~ template) ?? directory.config('admin.' ~ template) ?? [] -%}
{%- include target ? [
'flex-objects/types/' ~ type ~ '/' ~ template ~ '.html.twig',
'flex-objects/types/default/' ~ template ~ '.html.twig',
'flex-objects/layouts/404.html.twig'
] : [
'flex-objects/types/default/' ~ template ~ '.html.twig',
'flex-objects/layouts/404.html.twig'
] -%}