flex-objects.html.twig 977 B

123456789101112131415161718192021222324252627282930
  1. {%- set user = admin.user -%}
  2. {%- set route = controller.route -%}
  3. {%- set type = directory.config('admin.template') ?? target -%}
  4. {# Set action from ?preview=1 #}
  5. {%- if key and uri.currentUri().queryParam('preview') %}
  6. {% set action = 'preview' %}
  7. {% endif -%}
  8. {%- set template -%}
  9. {%- if action == 'add' -%}
  10. edit
  11. {%- elseif action == 'delete' -%}
  12. list
  13. {%- else -%}
  14. {{- action ?: task ?: 'types' -}}
  15. {%- endif -%}
  16. {%- endset -%}
  17. {%- set separator = config.system.param_sep -%}
  18. {%- set view_config = directory.config('admin.views.' ~ template) ?? directory.config('admin.' ~ template) ?? [] -%}
  19. {%- include target ? [
  20. 'flex-objects/types/' ~ type ~ '/' ~ template ~ '.html.twig',
  21. 'flex-objects/types/default/' ~ template ~ '.html.twig',
  22. 'flex-objects/layouts/404.html.twig'
  23. ] : [
  24. 'flex-objects/types/default/' ~ template ~ '.html.twig',
  25. 'flex-objects/layouts/404.html.twig'
  26. ] -%}