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

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 }}">
  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.     <title>{% block page_title %}{{ block('content_title')|striptags|raw }}{% endblock %}</title>
  14.     {% block head_stylesheets %}
  15.         <link rel="stylesheet" href="{{ asset('bundles/easyadmin/app.css') }}">
  16.     {% endblock %}
  17.     {% block configured_stylesheets %}
  18.         {% for css_asset in ea.assets.cssFiles ?? [] %}
  19.             <link rel="stylesheet" href="{{ asset(css_asset) }}">
  20.         {% endfor %}
  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('bundles/easyadmin/app.js') }}"></script>
  27.     {% endblock head_javascript %}
  28.     {% if 'rtl' == ea.i18n.textDirection %}
  29.         <link rel="stylesheet" href="{{ asset('bundles/easyadmin/app.rtl.css') }}">
  30.         <link rel="stylesheet" href="{{ asset('bundles/easyadmin/app-custom-rtl.css') }}">
  31.     {% endif %}
  32.     {% block configured_head_contents %}
  33.         {% for htmlContent in ea.assets.headContents ?? [] %}
  34.             {{ htmlContent|raw }}
  35.         {% endfor %}
  36.     {% endblock %}
  37. </head>
  38. {% block body %}
  39.     <body id="{% block body_id %}{% endblock %}" class="ea {% block body_class %}{% endblock %}">
  40.     {% block javascript_page_layout %}
  41.         <script>
  42.             document.body.classList.add(
  43.                 'ea-content-width-' + (localStorage.getItem('ea/content/width') || '{{ ea.crud.contentWidth ?? ea.dashboardContentWidth ?? 'normal' }}'),
  44.                 'ea-sidebar-width-' + (localStorage.getItem('ea/sidebar/width') || '{{ ea.crud.sidebarWidth ?? ea.dashboardSidebarWidth ?? 'normal' }}')
  45.             );
  46.         </script>
  47.     {% endblock javascript_page_layout %}
  48.     {% block wrapper_wrapper %}
  49.         {% block flash_messages %}
  50.             {{ include(ea.templatePath('flash_messages')) }}
  51.         {% endblock flash_messages %}
  52.         <div class="wrapper">
  53.             {% block wrapper %}
  54.                 <header class="main-header">
  55.                     {% block header %}
  56.                         <nav class="navbar" role="navigation">
  57.                             {% block header_navbar %}
  58.                                 <button id="navigation-toggler" type="button" aria-label="Toggle navigation">
  59.                                     <i class="fa fa-fw fa-bars"></i>
  60.                                 </button>
  61.                                 <div id="header-logo">
  62.                                     {% block header_logo %}
  63.                                         <a class="logo {{ ea.dashboardTitle|length > 14 ? 'logo-long' }}" title="{{ ea.dashboardTitle|striptags }}" href="{{ path(ea.dashboardRouteName) }}">
  64.                                             {{ ea.dashboardTitle|raw }}
  65.                                         </a>
  66.                                     {% endblock header_logo %}
  67.                                 </div>
  68.                             {% endblock header_navbar %}
  69.                         </nav>
  70.                         {% set _user_menu_content %}
  71.                             <div class="popover-content-section user-details {{ ea.userMenu.items|length > 0 ? 'user-has-actions' }}">
  72.                                 <p class="small text-muted mb-0">{{ 'user.logged_in_as'|trans(domain = 'EasyAdminBundle') }}</p>
  73.                                 <p class="user-details-name">
  74.                                     {{ ea.user is null ? 'user.anonymous'|trans(domain = 'EasyAdminBundle') : ea.userMenu.name }}
  75.                                 </p>
  76.                             </div>
  77.                             {% block user_menu %}
  78.                                 {% if ea.userMenu.items|length > 0 %}
  79.                                     <div class="popover-content-section user-menu">
  80.                                         {% for item in ea.userMenu.items %}
  81.                                             <a href="{{ item.linkUrl }}" class="user-action {{ item.cssClass }}" target="{{ item.linkTarget }}" rel="{{ item.linkRel }}" referrerpolicy="origin-when-cross-origin">
  82.                                                 {% if item.icon is not empty %}<i class="fa fa-fw {{ item.icon }}"></i>{% endif %}
  83.                                                 <span>{{ item.label }}</span>
  84.                                             </a>
  85.                                         {% endfor %}
  86.                                     </div>
  87.                                 {% endif %}
  88.                             {% endblock user_menu %}
  89.                         {% endset %}
  90.                         <div class="content-top navbar-custom-menu">
  91.                             {% block header_custom_menu %}
  92.                                 {% if constant('Symfony\\Component\\Security\\Core\\Authorization\\Voter\\AuthenticatedVoter::IS_IMPERSONATOR') is defined %}
  93.                                     {% set impersonator_permission = 'IS_IMPERSONATOR' %}
  94.                                 {% else %}
  95.                                     {% set impersonator_permission = 'ROLE_PREVIOUS_ADMIN' %}
  96.                                 {% endif %}
  97.                                 <div class="user user-menu-wrapper {{ is_granted(impersonator_permission) ? 'user-is-impersonated' }}" data-toggle="popover" data-placement="bottom" data-container=".user-menu-wrapper" data-content="{{ _user_menu_content|e('html_attr') }}" data-html="true">
  98.                                     {% if ea.userMenu.isAvatarDisplayed %}
  99.                                         {% if null == ea.userMenu.avatarUrl %}
  100.                                             <i class="fa fa-fw {{ ea.user is not null ? 'fa-user-circle' : 'fa-user-times' }} user-avatar"></i>
  101.                                         {% else %}
  102.                                             <img class="user-avatar" src="{{ ea.userMenu.avatarUrl }}" />
  103.                                         {% endif %}
  104.                                     {% endif %}
  105.                                     {% if ea.userMenu.isNameDisplayed %}
  106.                                         <span class="user-name">{{ ea.userMenu.name }}</span>
  107.                                     {% endif %}
  108.                                 </div>
  109.                             {% endblock header_custom_menu %}
  110.                         </div>
  111.                     {% endblock header %}
  112.                 </header>
  113.                 <aside class="main-sidebar">
  114.                     {% block sidebar %}
  115.                         <section class="sidebar">
  116.                             {% block main_menu_wrapper %}
  117.                                 {{ include(ea.templatePath('main_menu')) }}
  118.                             {% endblock main_menu_wrapper %}
  119.                         </section>
  120.                     {% endblock sidebar %}
  121.                 </aside>
  122.                 <div class="content-wrapper">
  123.                     <div id="sidebar-resizer-handler" class="resizer-handler resizer-handler-left"></div>
  124.                     {% block content %}
  125.                         <div class="content">
  126.                             {% block content_header_wrapper %}
  127.                                 {% set has_help_message = (ea.crud.helpMessage ?? '') is not empty %}
  128.                                 <section class="content-header">
  129.                                     {% block content_header %}
  130.                                         <div class="d-flex flex-row justify-content-between align-content-center w-100">
  131.                                             <div class="content-header-title">
  132.                                                 <h1 class="title">
  133.                                                     {% block content_title %}{% endblock %}
  134.                                                     {% block content_help %}
  135.                                                         {% if has_help_message %}
  136.                                                             <span class="content-header-help">
  137.                                                                 <i class="far fa-question-circle" data-toggle="tooltip" title="{{ ea.crud.helpMessage|e('html_attr') }}"></i>
  138.                                                             </span>
  139.                                                         {% endif %}
  140.                                                     {% endblock %}
  141.                                                 </h1>
  142.                                             </div>
  143.                                             {% block page_actions_wrapper %}
  144.                                                 <div class="page-actions">{% block page_actions %}{% endblock %}</div>
  145.                                             {% endblock %}
  146.                                         </div>
  147.                                     {% endblock content_header %}
  148.                                 </section>
  149.                             {% endblock content_header_wrapper %}
  150.                             <section id="main" class="content-body">
  151.                                 {% block main %}{% endblock %}
  152.                             </section>
  153.                             {% block content_footer_wrapper %}
  154.                                 {% set content_footer = block('content_footer') is defined ? block('content_footer') : '' %}
  155.                                 {% if content_footer is not empty %}
  156.                                     <section class="content-footer">
  157.                                         {{ content_footer }}
  158.                                     </section>
  159.                                 {% endif %}
  160.                             {% endblock %}
  161.                         </div>
  162.                     {% endblock content %}
  163.                     <div id="content-resizer-handler" class="resizer-handler resizer-handler-right"></div>
  164.                 </div>
  165.             {% endblock wrapper %}
  166.         </div>
  167.     {% endblock wrapper_wrapper %}
  168.     {% block body_javascript %}{% endblock body_javascript %}
  169.     {% block configured_javascripts %}
  170.         {% for js_asset in ea.assets.jsFiles ?? [] %}
  171.             <script src="{{ asset(js_asset) }}"></script>
  172.         {% endfor %}
  173.     {% endblock %}
  174.     {% block configured_body_contents %}
  175.         {% for htmlContent in ea.assets.bodyContents ?? [] %}
  176.             {{ htmlContent|raw }}
  177.         {% endfor %}
  178.     {% endblock %}
  179.     </body>
  180. {% endblock body %}
  181. </html>