vendor/easycorp/easyadmin-bundle/src/Resources/views/layout.html.twig line 55

Open in your IDE?
  1. {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
  2. {% trans_default_domain ea.i18n.translationDomain %}
  3. <!DOCTYPE html>
  4. <html lang="{{ ea.i18n.htmlLocale }}" dir="{{ ea.i18n.textDirection }}" data-turbo="false">
  5. <head>
  6.     {% block head_metas %}
  7.         <meta charset="utf-8">
  8.         <meta http-equiv="X-UA-Compatible" content="IE=edge">
  9.         <meta name="robots" content="noindex, nofollow, noarchive, nosnippet, noodp, noimageindex, notranslate, nocache" />
  10.         <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  11.         <meta name="generator" content="EasyAdmin" />
  12.     {% endblock head_metas %}
  13.     {% set page_title_block_output %}{% block page_title %}{{ block('content_title') }}{% endblock %}{% endset %}
  14.     <title>{{ page_title_block_output|striptags|raw }}</title>
  15.     {% block head_stylesheets %}
  16.         <link rel="stylesheet" href="{{ asset('app.css', ea.assets.defaultAssetPackageName) }}">
  17.     {% endblock %}
  18.     {% block configured_stylesheets %}
  19.         {{ include('@EasyAdmin/includes/_css_assets.html.twig', { assets: ea.assets.cssAssets ?? [] }, with_context = false) }}
  20.         {{ include('@EasyAdmin/includes/_encore_link_tags.html.twig', { assets: ea.assets.webpackEncoreAssets ?? [] }, with_context = false) }}
  21.     {% endblock %}
  22.     {% block head_favicon %}
  23.         <link rel="shortcut icon" href="{{ asset(ea.dashboardFaviconPath) }}">
  24.     {% endblock %}
  25.     {% block head_javascript %}
  26.         <script src="{{ asset('app.js', ea.assets.defaultAssetPackageName) }}"></script>
  27.         {% block importmap %}
  28.             {{ include('@EasyAdmin/includes/_importmap.html.twig', { assets: ea.assets.assetMapperAssets ?? [] }, with_context = false) }}
  29.         {% endblock %}
  30.     {% endblock head_javascript %}
  31.     {% block configured_javascripts %}
  32.         {{ include('@EasyAdmin/includes/_js_assets.html.twig', { assets: ea.assets.jsAssets ?? [] }, with_context = false) }}
  33.         {{ include('@EasyAdmin/includes/_encore_script_tags.html.twig', { assets: ea.assets.webpackEncoreAssets ?? [] }, with_context = false) }}
  34.     {% endblock %}
  35.     {% if 'rtl' == ea.i18n.textDirection %}
  36.         <link rel="stylesheet" href="{{ asset('app.rtl.css', ea.assets.defaultAssetPackageName) }}">
  37.     {% endif %}
  38.     {% block configured_head_contents %}
  39.         {% for htmlContent in ea.assets.headContents ?? [] %}
  40.             {{ htmlContent|raw }}
  41.         {% endfor %}
  42.     {% endblock %}
  43. </head>
  44. {% block body %}
  45.     <body {% block body_attr %}{% endblock %}
  46.         id="{% block body_id %}{% endblock %}"
  47.         class="ea {% block body_class %}{% endblock %}"
  48.         data-ea-content-width="{{ ea.crud.contentWidth ?? ea.dashboardContentWidth ?? 'normal' }}"
  49.         data-ea-sidebar-width="{{ ea.crud.sidebarWidth ?? ea.dashboardSidebarWidth ?? 'normal' }}"
  50.         data-ea-dark-scheme-is-enabled="{{ ea.dashboardHasDarkModeEnabled ? 'true' : 'false' }}"
  51.     >
  52.     {% block javascript_page_layout %}
  53.         <script src="{{ asset('page-layout.js', ea.assets.defaultAssetPackageName) }}"></script>
  54.     {% endblock javascript_page_layout %}
  55.     {% block javascript_page_color_scheme %}
  56.         <script src="{{ asset('page-color-scheme.js', ea.assets.defaultAssetPackageName) }}"></script>
  57.     {% endblock javascript_page_color_scheme %}
  58.     {% block wrapper_wrapper %}
  59.         {% block flash_messages %}
  60.             {{ include(ea.templatePath('flash_messages')) }}
  61.         {% endblock flash_messages %}
  62.         {% set user_menu_avatar %}
  63.             {% if null == ea.userMenu.avatarUrl %}
  64.                 <span class="user-avatar">
  65.                     <span class="fa-stack">
  66.                         <i class="user-avatar-icon-background fas fa-square fa-stack-2x"></i>
  67.                         <i class="user-avatar-icon-foreground {{ ea.user is not null ? 'fa fa-user' : 'fas fa-user-slash' }} fa-stack-1x fa-inverse"></i>
  68.                     </span>
  69.                 </span>
  70.             {% else %}
  71.                 <img class="user-avatar" src="{{ ea.userMenu.avatarUrl }}" />
  72.             {% endif %}
  73.         {% endset %}
  74.         {% set impersonator_permission = constant('Symfony\\Component\\Security\\Core\\Authorization\\Voter\\AuthenticatedVoter::IS_IMPERSONATOR') is defined ? 'IS_IMPERSONATOR' : 'ROLE_PREVIOUS_ADMIN' %}
  75.         {% set user_menu_dropdown %}
  76.             <ul class="dropdown-menu dropdown-menu-end">
  77.                 <li class="dropdown-user-details">
  78.                     <div>{{ user_menu_avatar }}</div>
  79.                     <div>
  80.                         <span class="user-label">{{ 'user.logged_in_as'|trans(domain = 'EasyAdminBundle') }}</span>
  81.                         <span class="user-name">{{ ea.user is null ? 'user.anonymous'|trans(domain = 'EasyAdminBundle') : ea.userMenu.name }}</span>
  82.                     </div>
  83.                 </li>
  84.                 {% block user_menu %}
  85.                     {% if ea.userMenu.items|length > 0 %}
  86.                         <li><hr class="dropdown-divider"></li>
  87.                         {% for item in ea.userMenu.items %}
  88.                             <li>
  89.                                 {% if item.isMenuSection and not loop.first %}
  90.                                     <hr class="dropdown-divider">
  91.                                 {% elseif not item.isMenuSection %}
  92.                                     <a href="{{ item.linkUrl }}" class="dropdown-item user-action {{ item.cssClass }}"
  93.                                        target="{{ item.linkTarget }}" rel="{{ item.linkRel }}"
  94.                                        referrerpolicy="origin-when-cross-origin">
  95.                                         {% if item.icon is not empty %}<i class="fa fa-fw {{ item.icon }}"></i>{% endif %}
  96.                                         {{ item.label|trans }}
  97.                                     </a>
  98.                                 {% endif %}
  99.                             </li>
  100.                         {% endfor %}
  101.                     {% endif %}
  102.                 {% endblock user_menu %}
  103.             </ul>
  104.         {% endset %}
  105.         {% set settings_dropdown %}
  106.             {% if ea.dashboardLocales or ea.dashboardHasDarkModeEnabled %}
  107.                 <div class="dropdown dropdown-settings">
  108.                     <a class="dropdown-settings-button" type="button" data-bs-toggle="dropdown" data-bs-offset="0,5" aria-expanded="false">
  109.                         <i class="fas fa-gear"></i>
  110.                     </a>
  111.                     <ul class="dropdown-menu dropdown-menu-end">
  112.                         {% if ea.dashboardLocales %}
  113.                             <li class="dropdown-header dropdown-locales-label">
  114.                                 {{ 'settings.locale'|trans(domain = 'EasyAdminBundle') }}
  115.                             </li>
  116.                             {% for localeDto in ea.dashboardLocales %}
  117.                                 <li>
  118.                                     <a href="{{ ea_url().set('_locale', localeDto.locale) }}" class="dropdown-item{% if app.request.locale == localeDto.locale %} active{% endif %}">
  119.                                         {% if localeDto.icon %}
  120.                                             <i class="{{ localeDto.icon }}"></i>
  121.                                         {% endif %}
  122.                                         {{ localeDto.name }}
  123.                                     </a>
  124.                                 </li>
  125.                             {% endfor %}
  126.                         {% endif %}
  127.                         {% if ea.dashboardHasDarkModeEnabled %}
  128.                             {% if ea.dashboardLocales %}
  129.                                 <div class="dropdown-divider"></div>
  130.                             {% endif %}
  131.                             <li class="dropdown-header dropdown-appearance-label">
  132.                                 {{ 'settings.appearance.label'|trans(domain = 'EasyAdminBundle') }}
  133.                             </li>
  134.                             <li>
  135.                                 <a href="#" class="dropdown-item dropdown-appearance-item" data-ea-color-scheme="light">
  136.                                     <i class="far fa-sun fa-fw"></i>
  137.                                     {{ 'settings.appearance.light'|trans(domain = 'EasyAdminBundle') }}
  138.                                 </a>
  139.                             </li>
  140.                             <li>
  141.                                 <a href="#" class="dropdown-item dropdown-appearance-item" data-ea-color-scheme="dark">
  142.                                     <i class="far fa-moon fa-fw"></i>
  143.                                     {{ 'settings.appearance.dark'|trans(domain = 'EasyAdminBundle') }}
  144.                                 </a>
  145.                             </li>
  146.                             <li>
  147.                                 <a href="#" class="dropdown-item dropdown-appearance-item active" data-ea-color-scheme="auto">
  148.                                     <i class="fas fa-desktop fa-fw"></i>
  149.                                     {{ 'settings.appearance.auto'|trans(domain = 'EasyAdminBundle') }}
  150.                                 </a>
  151.                             </li>
  152.                         {% endif %}
  153.                     </ul>
  154.                 </div>
  155.             {% endif %}
  156.         {% endset %}
  157.         <div class="wrapper">
  158.             {% block wrapper %}
  159.                 <div class="responsive-header">
  160.                     {% block responsive_header %}
  161.                         <button id="navigation-toggler" type="button" aria-label="Toggle navigation">
  162.                             <i class="fa fa-fw fa-bars"></i>
  163.                         </button>
  164.                         <div id="responsive-header-logo" class="text-truncate ms-auto">
  165.                             {% block responsive_header_logo %}
  166.                                 <a class="responsive-logo" title="{{ ea.dashboardTitle|striptags }}" href="{{ path(ea.dashboardRouteName) }}">
  167.                                     {{ ea.dashboardTitle|raw }}
  168.                                 </a>
  169.                             {% endblock responsive_header_logo %}
  170.                         </div>
  171.                         <div class="dropdown user-menu-wrapper {{ is_granted(impersonator_permission) ? 'user-is-impersonated' }} ms-auto">
  172.                             <a class="user-details" type="button" data-bs-toggle="dropdown" data-bs-offset="0,5" aria-expanded="false">
  173.                                 {# to make the site design consistent, always display the user avatar in responsive header
  174.                                    and hide the user name (because there's no space left) regardless of the user config #}
  175.                                 {% if ea.userMenu.avatarDisplayed %}
  176.                                     {{ user_menu_avatar }}
  177.                                 {% else %}
  178.                                     <i class="user-avatar fa fa-fw {{ ea.user is not null ? 'fa-user' : 'fa-user-times' }}"></i>
  179.                                 {% endif %}
  180.                             </a>
  181.                             {{ user_menu_dropdown }}
  182.                         </div>
  183.                         {{ settings_dropdown }}
  184.                     {% endblock responsive_header %}
  185.                 </div>
  186.                 <div class="sidebar-wrapper">
  187.                     <aside class="sidebar">
  188.                         {% block sidebar %}
  189.                             <header class="main-header">
  190.                                 {% block header %}
  191.                                 <nav class="navbar" role="navigation">
  192.                                     {% block header_navbar %}
  193.                                         <div id="header-logo">
  194.                                             {% block header_logo %}
  195.                                                 <a class="logo" title="{{ ea.dashboardTitle|striptags }}" href="{{ path(ea.dashboardRouteName) }}">
  196.                                                     <span class="logo-custom">{{ ea.dashboardTitle|raw }}</span>
  197.                                                     <span class="logo-compact"><i class="fas fa-home"></i></span>
  198.                                                 </a>
  199.                                             {% endblock header_logo %}
  200.                                         </div>
  201.                                     {% endblock header_navbar %}
  202.                                 </nav>
  203.                                 {% endblock header %}
  204.                             </header>
  205.                             {% block main_menu_wrapper %}
  206.                                 {{ include(ea.templatePath('main_menu')) }}
  207.                             {% endblock main_menu_wrapper %}
  208.                         {% endblock sidebar %}
  209.                         <div id="sidebar-resizer-handler" class="resizer-handler resizer-handler-left"></div>
  210.                     </aside>
  211.                 </div>
  212.                 <section class="main-content">
  213.                     {% set has_search = ea.crud is not null and ea.crud.isSearchEnabled %}
  214.                     <aside class="content-top {{ has_search ? 'ea-search-enabled' : 'ea-search-disabled' }}">
  215.                         {% block content_top_header %}
  216.                             {% block search_wrapper %}
  217.                             <div class="content-search">
  218.                                 {% if has_search %}
  219.                                     {% block search %}
  220.                                         <form class="form-action-search" method="get">
  221.                                             {% block search_form %}
  222.                                                 {% block search_form_filters %}
  223.                                                     {% for field, fieldValue in ea.search.appliedFilters %}
  224.                                                         {% if fieldValue is iterable %}
  225.                                                             {% for key, value in fieldValue %}
  226.                                                                 {# This code re-applies your filters on searches, an iterable check is needed in cases we have more than one object for a filter #}
  227.                                                                 {% if value is iterable %}
  228.                                                                     {% for index, iterValue in value %}
  229.                                                                         {# This sub-level iterable check is needed in cases we have more complex filters like the DateTimeFilter cf. issue #5038 #}
  230.                                                                         {% if iterValue is iterable %}
  231.                                                                             {% for subIndex, subIterValue in iterValue %}
  232.                                                                                 <input type="hidden" name="filters[{{ field }}][{{ key }}][{{ index }}][{{ subIndex }}]" value="{{ subIterValue }}">
  233.                                                                             {% endfor %}
  234.                                                                         {% else %}
  235.                                                                             <input type="hidden" name="filters[{{ field }}][{{ key }}][{{ index }}]" value="{{ iterValue }}">
  236.                                                                         {% endif %}
  237.                                                                     {% endfor %}
  238.                                                                 {% else %}
  239.                                                                     <input type="hidden" name="filters[{{ field }}][{{ key }}]" value="{{ value }}">
  240.                                                                 {% endif %}
  241.                                                             {% endfor %}
  242.                                                         {% else %}
  243.                                                             <input type="hidden" name="filters[{{ field }}]" value="{{ fieldValue }}">
  244.                                                         {% endif %}
  245.                                                     {% endfor %}
  246.                                                 {% endblock %}
  247.                                                 <input type="hidden" name="crudAction" value="index">
  248.                                                 <input type="hidden" name="crudControllerFqcn" value="{{ ea.request.query.get('crudControllerFqcn') }}">
  249.                                                 <input type="hidden" name="page" value="1">
  250.                                                 <div class="form-group">
  251.                                                     <div class="form-widget">
  252.                                                         <i class="fas fa-search content-search-icon"></i>
  253.                                                         <label class="content-search-label" data-value="{{ app.request.get('query') }}">
  254.                                                             <input class="form-control {{ app.request.get('query') is null ? 'is-blank' }}" type="search" name="query" value="{{ app.request.get('query') ?? '' }}" placeholder="{{ t('action.search', ea.i18n.translationParameters, 'EasyAdminBundle')|trans }}" spellcheck="false" autocorrect="off" onInput="this.parentNode.dataset.value=this.value"{% if ea.crud.currentAction == 'index' and ea.crud.autofocusSearch == true %} autofocus="autofocus"{% endif %}>
  255.                                                         </label>
  256.                                                         {% if app.request.get('query') %}
  257.                                                             <a href="{{ ea_url().unset('query') }}" class="content-search-reset">
  258.                                                                 <i class="fas fa-fw fa-times"></i>
  259.                                                             </a>
  260.                                                         {% endif %}
  261.                                                     </div>
  262.                                                 </div>
  263.                                             {% endblock %}
  264.                                         </form>
  265.                                     {% endblock search %}
  266.                                 {% endif %}
  267.                             </div>
  268.                             {% endblock search_wrapper %}
  269.                             {% block header_custom_menu_wrapper %}
  270.                             <div class="navbar-custom-menu">
  271.                                 {% block header_custom_menu %}
  272.                                     <div class="dropdown user-menu-wrapper {{ is_granted(impersonator_permission) ? 'user-is-impersonated' }}">
  273.                                         <a class="user-details" type="button" data-bs-toggle="dropdown" data-bs-offset="0,5" aria-expanded="false">
  274.                                             {{ user_menu_avatar }}
  275.                                             {% if ea.userMenu.isNameDisplayed %}
  276.                                                 <span class="user-name">{{ ea.userMenu.name }}</span>
  277.                                             {% endif %}
  278.                                         </a>
  279.                                         {{ user_menu_dropdown }}
  280.                                     </div>
  281.                                 {% endblock header_custom_menu %}
  282.                             </div>
  283.                             {% endblock header_custom_menu_wrapper %}
  284.                             {% block settings_dropdown_wrapper %}
  285.                                 {{ settings_dropdown }}
  286.                             {% endblock settings_dropdown_wrapper %}
  287.                         {% endblock content_top_header %}
  288.                     </aside>
  289.                     <div class="content-wrapper">
  290.                         {% block content %}
  291.                             <article class="content">
  292.                                 {% block content_header_wrapper %}
  293.                                     {% set has_help_message = (ea.crud.helpMessage ?? '') is not empty %}
  294.                                     <section class="content-header">
  295.                                         {% block content_header %}
  296.                                             <div class="content-header-title">
  297.                                                 <h1 class="title">
  298.                                                     {% block content_title %}{% endblock %}
  299.                                                     {% block content_help %}
  300.                                                         {% if has_help_message %}
  301.                                                             <a tabindex="0" class="content-header-help" data-bs-toggle="popover" data-bs-custom-class="ea-content-help-popover" data-bs-animation="true" data-bs-html="true" data-bs-placement="bottom" data-bs-trigger="focus" data-bs-content="{{ ea.crud.helpMessage|trans|e('html_attr') }}">
  302.                                                                 <i class="far fa-question-circle"></i>
  303.                                                             </a>
  304.                                                         {% endif %}
  305.                                                     {% endblock %}
  306.                                                 </h1>
  307.                                             </div>
  308.                                             {% block page_actions_wrapper %}
  309.                                                 <div class="page-actions">{% block page_actions %}{% endblock %}</div>
  310.                                             {% endblock %}
  311.                                         {% endblock content_header %}
  312.                                     </section>
  313.                                 {% endblock content_header_wrapper %}
  314.                                 <section id="main" class="content-body">
  315.                                     {% block main %}{% endblock %}
  316.                                 </section>
  317.                                 {% block content_footer_wrapper %}
  318.                                     {% set content_footer = block('content_footer') is defined ? block('content_footer') : '' %}
  319.                                     {% if content_footer is not empty %}
  320.                                         <section class="content-footer">
  321.                                             {{ content_footer }}
  322.                                         </section>
  323.                                     {% endif %}
  324.                                 {% endblock %}
  325.                             </article>
  326.                         {% endblock content %}
  327.                         <div id="content-resizer-handler" class="resizer-handler resizer-handler-right"></div>
  328.                     </div>
  329.                 </section>
  330.             {% endblock wrapper %}
  331.         </div>
  332.     {% endblock wrapper_wrapper %}
  333.     {% block body_javascript %}{% endblock body_javascript %}
  334.     {% block configured_body_contents %}
  335.         {% for htmlContent in ea.assets.bodyContents ?? [] %}
  336.             {{ htmlContent|raw }}
  337.         {% endfor %}
  338.     {% endblock %}
  339.     </body>
  340. {% endblock body %}
  341. </html>