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

Open in your IDE?
  1. <!DOCTYPE html>
  2. <html lang="{{ app.request.locale|split('_')|first|default('en') }}" dir="{{ easyadmin_config('design.rtl') ? 'rtl' : 'ltr' }}">
  3.     <head>
  4.         <meta charset="utf-8">
  5.         <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6.         <meta name="robots" content="noindex, nofollow, noarchive, nosnippet, noodp, noimageindex, notranslate, nocache" />
  7.         <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  8.         <meta name="generator" content="EasyAdmin" />
  9.         <title>{% block page_title %}{{ block('content_title')|striptags|raw }}{% endblock %}</title>
  10.         {% block head_stylesheets %}
  11.             <link rel="stylesheet" href="{{ asset('bundles/easyadmin/app.css') }}">
  12.         {% endblock %}
  13.         {% block head_custom_stylesheets %}
  14.             {% for css_asset in easyadmin_config('design.assets.css') %}
  15.                 <link rel="stylesheet" href="{{ asset(css_asset) }}">
  16.             {% endfor %}
  17.         {% endblock head_custom_stylesheets %}
  18.         {% if easyadmin_config('design.brand_color') != 'hsl(230, 55%, 60%)' %}
  19.         <style>
  20.             :root { --color-primary: {{ easyadmin_config('design.brand_color') }}; }
  21.         </style>
  22.         {% endif %}
  23.         {% block head_favicon %}
  24.             {% set favicon = easyadmin_config('design.assets.favicon') %}
  25.             <link rel="icon" type="{{ favicon.mime_type }}" href="{{ asset(favicon.path) }}" />
  26.         {% endblock %}
  27.         {% block head_javascript %}
  28.             <script src="{{ asset('bundles/easyadmin/app.js') }}"></script>
  29.         {% endblock head_javascript %}
  30.         {% if easyadmin_config('design.rtl') %}
  31.             <link rel="stylesheet" href="{{ asset('bundles/easyadmin/app.rtl.css') }}">
  32.             <link rel="stylesheet" href="{{ asset('bundles/easyadmin/app-custom-rtl.css') }}">
  33.         {% endif %}
  34.     </head>
  35.     {% block body %}
  36.     <body id="{% block body_id %}{% endblock %}" class="easyadmin {% block body_class %}{% endblock %}">
  37.         <script>
  38.             document.body.classList.add(
  39.                 'easyadmin-content-width-' + (localStorage.getItem('easyadmin/content/width') || 'normal'),
  40.                 'easyadmin-sidebar-width-' + (localStorage.getItem('easyadmin/sidebar/width') || 'normal')
  41.             );
  42.         </script>
  43.         {% block wrapper_wrapper %}
  44.         <div class="wrapper">
  45.         {% block wrapper %}
  46.             <header class="main-header">
  47.                 {% block header %}
  48.                     <nav class="navbar" role="navigation">
  49.                         <button id="navigation-toggler" type="button" aria-label="Toggle navigation">
  50.                             <i class="fa fa-fw fa-bars"></i>
  51.                         </button>
  52.                         <div id="header-logo">
  53.                             {% block header_logo %}
  54.                                 <a class="logo {{ easyadmin_config('site_name')|length > 14 ? 'logo-long' }}" title="{{ easyadmin_config('site_name')|striptags }}" href="{{ path('easyadmin') }}">
  55.                                     {{ easyadmin_config('site_name')|raw }}
  56.                                 </a>
  57.                             {% endblock header_logo %}
  58.                         </div>
  59.                     </nav>
  60.                     {% set _user_name = easyadmin_read_property(app.user, easyadmin_config('user.name_property_path'))|default('user.unnamed'|trans(domain = 'EasyAdminBundle')) %}
  61.                     {% set _logout_path = easyadmin_logout_path() %}
  62.                     {% set _user_has_logout = _logout_path is not empty %}
  63.                     {% set _user_is_impersonated = is_granted('ROLE_PREVIOUS_ADMIN') %}
  64.                     {% set _user_menu_content %}
  65.                         <div class="popover-content-section user-details {{ _user_has_logout or _user_is_impersonated ? 'user-has-actions' }}">
  66.                             <p class="small text-muted mb-0">{{ 'user.logged_in_as'|trans(domain = 'EasyAdminBundle') }}</p>
  67.                             <p class="user-details-name">
  68.                                 {% if app.user|default(false) == false %}
  69.                                     {{ 'user.anonymous'|trans(domain = 'EasyAdminBundle') }}
  70.                                 {% else %}
  71.                                     {{ _user_name }}
  72.                                 {% endif %}
  73.                             </p>
  74.                         </div>
  75.                         {% block user_menu %}
  76.                             {% if _user_has_logout or _user_is_impersonated %}
  77.                                 <div class="popover-content-section user-menu">
  78.                                     {% if _user_has_logout %}
  79.                                         <a class="user-action user-action-logout" href="{{ _logout_path }}">{{ 'user.signout'|trans(domain = 'EasyAdminBundle') }}</a>
  80.                                     {% endif %}
  81.                                     {% if _user_is_impersonated %}
  82.                                         <a class="user-action user-action-exit-impersonation" href="?_switch_user=_exit">{{ 'user.exit_impersonation'|trans(domain = 'EasyAdminBundle') }}</a>
  83.                                     {% endif %}
  84.                                 </div>
  85.                             {% endif %}
  86.                         {% endblock user_menu %}
  87.                     {% endset %}
  88.                     <div class="content-top navbar-custom-menu">
  89.                         {% block header_custom_menu %}
  90.                             <div class="user user-menu-wrapper {{ _user_is_impersonated ? '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 easyadmin_config('user.display_avatar') %}
  92.                                     {% set _avatar_image_path = easyadmin_read_property(app.user, easyadmin_config('user.avatar_property_path')) %}
  93.                                     {% if null == _avatar_image_path %}
  94.                                         <i class="fa fa-fw {{ app.user is not null ? 'fa-user-circle' : 'fa-user-times' }} user-avatar"></i>
  95.                                     {% else %}
  96.                                         <img class="user-avatar" src="{{ _avatar_image_path }}" />
  97.                                     {% endif %}
  98.                                 {% endif %}
  99.                                 {% if easyadmin_config('user.display_name') %}
  100.                                     <span class="user-name">{{ _user_name }}</span>
  101.                                 {% endif %}
  102.                             </div>
  103.                         {% endblock header_custom_menu %}
  104.                     </div>
  105.                 {% endblock header %}
  106.             </header>
  107.             <aside class="main-sidebar">
  108.             {% block sidebar %}
  109.                 <section class="sidebar">
  110.                     {% block main_menu_wrapper %}
  111.                         {{ include([
  112.                             _entity_config is defined ? _entity_config.templates.menu,
  113.                             easyadmin_config('design.templates.menu'),
  114.                             '@EasyAdmin/default/menu.html.twig'
  115.                         ]) }}
  116.                     {% endblock main_menu_wrapper %}
  117.                 </section>
  118.             {% endblock sidebar %}
  119.             </aside>
  120.             <div class="content-wrapper">
  121.                 {% block flash_messages %}
  122.                     {{ include(_entity_config is defined ? _entity_config.templates.flash_messages : '@EasyAdmin/default/flash_messages.html.twig') }}
  123.                 {% endblock flash_messages %}
  124.                 <div id="sidebar-resizer-handler" class="resizer-handler resizer-handler-left"></div>
  125.                 {% block content %}
  126.                     <div class="content">
  127.                         {% block content_header_wrapper %}
  128.                         {% set _has_content_help = _entity_config is defined and _entity_config[app.request.query.get('action')]['help']|default(false) %}
  129.                         <section class="content-header {{ _has_content_help ? 'has-content-help' }}">
  130.                             {% block content_header %}
  131.                                 <div class="d-flex flex-row justify-content-between align-content-center w-100">
  132.                                     <div class="content-header-title">
  133.                                         <h1 class="title">{% block content_title %}{% endblock %}</h1>
  134.                                     </div>
  135.                                     {% block global_actions_wrapper %}
  136.                                         <div class="global-actions">{% block global_actions %}{% endblock %}</div>
  137.                                     {% endblock %}
  138.                                 </div>
  139.                                 {% block content_help %}
  140.                                     {% if _entity_config is defined and _entity_config[app.request.query.get('action')]['help']|default(false) %}
  141.                                         <div class="content-header-help">
  142.                                             {{ _entity_config[app.request.query.get('action')]['help']|trans(domain = _entity_config.translation_domain)|raw }}
  143.                                         </div>
  144.                                     {% endif %}
  145.                                 {% endblock content_help %}
  146.                             {% endblock content_header %}
  147.                         </section>
  148.                         {% endblock content_header_wrapper %}
  149.                         <section id="main" class="content-body">
  150.                             {% block main %}{% endblock %}
  151.                         </section>
  152.                         {% block content_footer_wrapper %}
  153.                             <section class="content-footer">
  154.                                 {% block content_footer %}{% endblock %}
  155.                             </section>
  156.                         {% endblock %}
  157.                     </div>
  158.                 {% endblock content %}
  159.                 <div id="content-resizer-handler" class="resizer-handler resizer-handler-right"></div>
  160.             </div>
  161.         {% endblock wrapper %}
  162.         </div>
  163.         {% endblock wrapper_wrapper %}
  164.         {% block body_javascript %}{% endblock body_javascript %}
  165.         {% block body_custom_javascript %}
  166.             {% for js_asset in easyadmin_config('design.assets.js') %}
  167.                 <script src="{{ asset(js_asset) }}"></script>
  168.             {% endfor %}
  169.         {% endblock body_custom_javascript %}
  170.     </body>
  171.     {% endblock body %}
  172. </html>