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