templates/AdminBundle/standart_layout.html.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of the Sonata package.
  3. (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  4. For the full copyright and license information, please view the LICENSE
  5. file that was distributed with this source code.
  6. #}
  7. {% set _preview = block('preview') is defined ? block('preview')|trim : null %}
  8. {% set _form = block('form') is defined ? block('form')|trim : null %}
  9. {% set _show = block('show') is defined ? block('show')|trim : null %}
  10. {% set _list_table = block('list_table') is defined ? block('list_table')|trim : null %}
  11. {% set _list_filters = block('list_filters') is defined ? block('list_filters')|trim : null %}
  12. {% set _tab_menu = block('tab_menu') is defined ? block('tab_menu')|trim : null %}
  13. {% set _content = block('content') is defined ? block('content')|trim : null %}
  14. {% set _title = block('title') is defined ? block('title')|trim : null %}
  15. {% set _breadcrumb = block('breadcrumb') is defined ? block('breadcrumb')|trim : null %}
  16. {% set _actions = block('actions') is defined ? block('actions')|trim : null %}
  17. {% set _navbar_title = block('navbar_title') is defined ? block('navbar_title')|trim : null %}
  18. {% set _list_filters_actions = block('list_filters_actions') is defined ? block('list_filters_actions')|trim : null -%}
  19. {% set _skin = sonata_config.getOption('skin') %}
  20. {% set _use_select2 = sonata_config.getOption('use_select2') %}
  21. {% set _use_icheck = sonata_config.getOption('use_icheck') %}
  22. <!DOCTYPE html>
  23. <html {% block html_attributes %}class="no-js"{% endblock %}>
  24. <head>
  25.     {% block meta_tags %}
  26.         <meta http-equiv="X-UA-Compatible" content="IE=edge">
  27.         <meta charset="UTF-8">
  28.         <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
  29.     {% endblock %}
  30.     <meta data-sonata-admin='{{ {
  31.         config: {
  32.             SKIN: _skin,
  33.             CONFIRM_EXIT: sonata_config.getOption('confirm_exit'),
  34.             USE_SELECT2: _use_select2,
  35.             USE_ICHECK: _use_icheck,
  36.             USE_STICKYFORMS: sonata_config.getOption('use_stickyforms'),
  37.             DEBUG: sonata_config.getOption('js_debug'),
  38.         },
  39.         translations: {
  40.             CONFIRM_EXIT: 'confirm_exit'|trans({}, 'SonataAdminBundle'),
  41.         },
  42.     }|json_encode()|raw }}'
  43.     >
  44.     {% block stylesheets %}
  45.         {% for stylesheet in sonata_config.getOption('stylesheets', []) %}
  46.             <link rel="stylesheet" href="{{ asset(stylesheet) }}">
  47.         {% endfor %}
  48.         <link rel="stylesheet" href="{{ asset('build/admin/css/custom.css') }}">
  49.     {% endblock %}
  50.     {% block javascripts %}
  51.         {% block sonata_javascript_config %}
  52.         {% endblock %}
  53.     {% block sonata_javascript_pool %}
  54.         {% for javascript in sonata_config.getOption('javascripts', []) %}
  55.             <script src="{{ asset(javascript) }}"></script>
  56.         {% endfor %}
  57.         {{ encore_entry_script_tags('admin/js/custom') }}
  58.     {% endblock %}
  59.         {# localize moment #}
  60.         {% set localeForMoment = sonata_form_canonicalize_locale_for_moment() %}
  61.         {% if localeForMoment %}
  62.         <script src="{{ asset('bundles/sonataform/moment-locale/' ~ localeForMoment ~ '.js') }}"></script>
  63.         {% endif %}
  64.         {# localize select2 #}
  65.         {% if sonata_config.getOption('use_select2') %}
  66.         {% set localeForSelect2 = canonicalize_locale_for_select2() %}
  67.         {% if localeForSelect2 %}
  68.         <script src="{{ asset('bundles/sonataadmin/select2-locale/' ~ localeForSelect2 ~ '.js') }}"></script>
  69.         {% endif %}
  70.         {% endif %}
  71.     {% endblock %}
  72.     <title>
  73.         {% block sonata_head_title %}
  74.             {{ 'Admin'|trans({}, 'SonataAdminBundle') }}
  75.             {% if _title is not empty %}
  76.                 {{ _title|striptags|raw }}
  77.             {% else %}
  78.                 {% if action is defined %}
  79.                     -
  80.                     {{ render_breadcrumbs_for_title(admin, action) }}
  81.                 {% endif %}
  82.             {% endif %}
  83.         {% endblock %}
  84.     </title>
  85. </head>
  86. <body
  87.         {% block body_attributes -%}
  88.             class="sonata-bc {% block admin_lte_skin_class %}{{ _skin }}{% endblock %} fixed
  89.                 {% if _use_select2 %}sonata-select2{% endif %}
  90.                 {% if _use_icheck %}sonata-icheck{% endif %}
  91.                 {% if app.request.cookies.get('sonata_sidebar_hide') -%}
  92.                     sidebar-collapse
  93.                 {%- endif -%}"
  94.         {%- endblock -%}
  95. >
  96. <div class="wrapper">
  97.     {% block sonata_header %}
  98.         <header class="main-header">
  99.             {% block sonata_header_noscript_warning %}
  100.                 <noscript>
  101.                     <div class="noscript-warning">
  102.                         {{ 'noscript_warning'|trans({}, 'SonataAdminBundle') }}
  103.                     </div>
  104.                 </noscript>
  105.             {% endblock %}
  106.             {% block logo %}
  107.                 {% apply spaceless %}
  108.                 <a class="logo" href="{{ path('sonata_admin_dashboard') }}">
  109.                     {% if 'icon' == sonata_config.getOption('logo_content') or 'all' == sonata_config.getOption('logo_content') %}
  110.                         <img src="{{ asset(sonata_config.logo) }}" alt="{{ sonata_config.title }}">
  111.                     {% endif %}
  112.                     {% if 'text' == sonata_config.getOption('logo_content') or 'all' == sonata_config.getOption('logo_content') %}
  113.                         <span>{{ sonata_config.title }}</span>
  114.                     {% endif %}
  115.                 </a>
  116.                 {% endapply %}
  117.             {% endblock %}
  118.             {% block sonata_nav %}
  119.                 <nav class="navbar navbar-static-top">
  120.                     <a href="#" class="sidebar-toggle fa5" data-toggle="push-menu"
  121.                        role="button" title="{{ 'toggle_navigation'|trans({}, 'SonataAdminBundle') }}">
  122.                         <span class="sr-only">{{ 'toggle_navigation'|trans({}, 'SonataAdminBundle') }}</span>
  123.                     </a>
  124.                     <div class="navbar-left">
  125.                         {% block sonata_breadcrumb %}
  126.                             <div class="hidden-xs">
  127.                                 {% if _breadcrumb is not empty or action is defined %}
  128.                                     <ol class="nav navbar-top-links breadcrumb">
  129.                                         {% if _breadcrumb is empty %}
  130.                                             {% if action is defined %}
  131.                                                 {{ render_breadcrumbs(admin, action) }}
  132.                                             {% endif %}
  133.                                         {% else %}
  134.                                             {{ _breadcrumb|raw }}
  135.                                         {% endif %}
  136.                                     </ol>
  137.                                 {% endif %}
  138.                             </div>
  139.                         {% endblock sonata_breadcrumb %}
  140.                     </div>
  141.                     {% block sonata_top_nav_menu %}
  142.                         {% if app.user and is_granted(sonata_config.getOption('role_admin')) %}
  143.                             <div class="navbar-custom-menu">
  144.                                 <ul class="nav navbar-nav">
  145.                                     {% block sonata_top_nav_menu_add_block %}
  146.                                         {% set addBlock = include(get_global_template('add_block')) %}
  147.                                         {% if addBlock is not empty %}
  148.                                             <li class="dropdown">
  149.                                                 <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  150.                                                     <i class="fas fa-plus-square fa-fw" aria-hidden="true"></i> <i class="fas fa-caret-down" aria-hidden="true"></i>
  151.                                                 </a>
  152.                                                 {{ addBlock|raw }}
  153.                                             </li>
  154.                                         {% endif %}
  155.                                     {% endblock %}
  156.                                     {% block sonata_top_nav_menu_user_block %}
  157.                                         {% set userBlock = include(get_global_template('user_block')) %}
  158.                                         {% if userBlock is not empty %}
  159.                                             <li class="dropdown user-menu">
  160.                                                 <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  161.                                                     <i class="fas fa-user fa-fw" aria-hidden="true"></i> <i class="fas fa-caret-down" aria-hidden="true"></i>
  162.                                                 </a>
  163.                                                 <ul class="dropdown-menu dropdown-user">
  164.                                                     {{ userBlock|raw }}
  165.                                                 </ul>
  166.                                             </li>
  167.                                         {% endif %}
  168.                                     {% endblock %}
  169.                                 </ul>
  170.                             </div>
  171.                         {% endif %}
  172.                     {% endblock %}
  173.                 </nav>
  174.             {% endblock sonata_nav %}
  175.         </header>
  176.     {% endblock sonata_header %}
  177.     {% block sonata_wrapper %}
  178.         {% block sonata_left_side %}
  179.             <aside class="main-sidebar">
  180.                 <section class="sidebar">
  181.                     {% block sonata_side_nav %}
  182.                         {% block sonata_sidebar_search %}
  183.                             {% if sonata_config.getOption('search') %}
  184.                                 <form action="{{ path('sonata_admin_search') }}" method="GET" class="sidebar-form" role="search">
  185.                                     <div class="input-group custom-search-form">
  186.                                         <input type="text" name="q" value="{{ app.request.get('q') }}" class="form-control" placeholder="{{ 'search_placeholder'|trans({}, 'SonataAdminBundle') }}">
  187.                                         <span class="input-group-btn">
  188.                                                 <button class="btn btn-flat" type="submit">
  189.                                                     <i class="fas fa-search" aria-hidden="true"></i>
  190.                                                 </button>
  191.                                             </span>
  192.                                     </div>
  193.                                 </form>
  194.                             {% endif %}
  195.                         {% endblock sonata_sidebar_search %}
  196.                         {% block side_bar_before_nav %} {% endblock %}
  197.                         {% block side_bar_nav %}
  198.                             {{ knp_menu_render('sonata_admin_sidebar', {template: get_global_template('knp_menu_template')}) }}
  199.                         {% endblock side_bar_nav %}
  200.                         {% block side_bar_after_nav %}
  201.                             <p class="text-center small" style="border-top: 1px solid #444444; padding-top: 10px">
  202.                                 {% block side_bar_after_nav_content %}
  203.                                     <a href="https://www.5feedback.com" rel="noreferrer" target="_blank">5Feedback</a>
  204.                                 {% endblock %}
  205.                             </p>
  206.                         {% endblock %}
  207.                     {% endblock sonata_side_nav %}
  208.                 </section>
  209.             </aside>
  210.         {% endblock sonata_left_side %}
  211.         <div class="content-wrapper">
  212.             {% block sonata_page_content %}
  213.                 <section class="content-header">
  214.                     {% block sonata_page_content_header %}
  215.                         {% block sonata_page_content_nav %}
  216.                             {% if _navbar_title is not empty
  217.                             or _tab_menu is not empty
  218.                             or _actions is not empty
  219.                             or _list_filters_actions is not empty
  220.                             %}
  221.                                 <nav class="navbar navbar-default" role="navigation">
  222.                                     <div class="container-fluid">
  223.                                         {% block tab_menu_navbar_header %}
  224.                                             {% if _navbar_title is not empty %}
  225.                                                 <div class="navbar-header">
  226.                                                     <a class="navbar-brand" href="#">{{ _navbar_title|raw }}</a>
  227.                                                 </div>
  228.                                             {% endif %}
  229.                                         {% endblock %}
  230.                                         <div class="navbar-collapse">
  231.                                             {% if _tab_menu is not empty %}
  232.                                                 <div class="navbar-left">
  233.                                                     {{ _tab_menu|raw }}
  234.                                                 </div>
  235.                                             {% endif %}
  236.                                             {% if admin is defined and action is defined and action == 'list' and admin.listModes|length > 1 %}
  237.                                                 <div class="nav navbar-right btn-group">
  238.                                                     {% for mode, settings in admin.listModes %}
  239.                                                         <a href="{{ admin.generateUrl('list', app.request.query.all|merge({_list_mode: mode})) }}" class="btn btn-default navbar-btn btn-sm{% if admin.getListMode() == mode %} active{% endif %}">
  240.                                                             {# NEXT_MAJOR: Remove the if and keep the else part #}
  241.                                                             {% if settings.icon is not defined and settings.class is defined %}
  242.                                                                 {% deprecated 'Relying on the "class" setting is deprecated since sonata-project/admin-bundle 4.9, use the "icon" setting instead' %}
  243.                                                                 <i class="{{ settings.class }}" aria-hidden="true"></i>
  244.                                                             {% else %}
  245.                                                                 {{ settings.icon|default('')|parse_icon }}
  246.                                                             {% endif %}
  247.                                                         </a>
  248.                                                     {% endfor %}
  249.                                                 </div>
  250.                                             {% endif %}
  251.                                             {% block sonata_admin_content_actions_wrappers %}
  252.                                                 {% if _actions|replace({ '<li>': '', '</li>': '' })|trim is not empty %}
  253.                                                     <ul class="nav navbar-nav navbar-right">
  254.                                                         {% if _actions|split('</a>')|length > 2 %}
  255.                                                             <li class="dropdown sonata-actions">
  256.                                                                 <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ 'link_actions'|trans({}, 'SonataAdminBundle') }} <b class="caret"></b></a>
  257.                                                                 <ul class="dropdown-menu" role="menu">
  258.                                                                     {{ _actions|raw }}
  259.                                                                 </ul>
  260.                                                             </li>
  261.                                                         {% else %}
  262.                                                             {{ _actions|raw }}
  263.                                                         {% endif %}
  264.                                                     </ul>
  265.                                                 {% endif %}
  266.                                             {% endblock sonata_admin_content_actions_wrappers %}
  267.                                             {% if _list_filters_actions is not empty %}
  268.                                                 {{ _list_filters_actions|raw }}
  269.                                             {% endif %}
  270.                                         </div>
  271.                                     </div>
  272.                                 </nav>
  273.                             {% endif %}
  274.                         {% endblock sonata_page_content_nav %}
  275.                     {% endblock sonata_page_content_header %}
  276.                 </section>
  277.                 <section class="content">
  278.                     {% block sonata_admin_content %}
  279.                         {% block notice %}
  280.                             {% include '@SonataTwig/FlashMessage/render.html.twig' %}
  281.                         {% endblock notice %}
  282.                         {% if _preview is not empty %}
  283.                             <div class="sonata-ba-preview">{{ _preview|raw }}</div>
  284.                         {% endif %}
  285.                         {% if _content is not empty %}
  286.                             <div class="sonata-ba-content">{{ _content|raw }}</div>
  287.                         {% endif %}
  288.                         {% if _show is not empty %}
  289.                             <div class="sonata-ba-show">{{ _show|raw }}</div>
  290.                         {% endif %}
  291.                         {% if _form is not empty %}
  292.                             <div class="sonata-ba-form">{{ _form|raw }}</div>
  293.                         {% endif %}
  294.                         {% if _list_filters is not empty %}
  295.                             <div class="row">
  296.                                 {{ _list_filters|raw }}
  297.                             </div>
  298.                         {% endif %}
  299.                         {% if _list_table is not empty %}
  300.                             <div class="row">
  301.                                 {{ _list_table|raw }}
  302.                             </div>
  303.                         {% endif %}
  304.                     {% endblock sonata_admin_content %}
  305.                 </section>
  306.             {% endblock sonata_page_content %}
  307.         </div>
  308.     {% endblock sonata_wrapper %}
  309. </div>
  310. {% if sonata_config.getOption('use_bootlint') %}
  311.     {% block bootlint %}
  312.         {# Bootlint - https://github.com/twbs/bootlint#in-the-browser #}
  313.         <script type="text/javascript">
  314.             javascript:(function(){var s=document.createElement("script");s.onload=function(){bootlint.showLintReportForCurrentDocument([], {hasProblems: false, problemFree: false});};s.src="https://maxcdn.bootstrapcdn.com/bootlint/latest/bootlint.min.js";document.body.appendChild(s)})();
  315.         </script>
  316.     {% endblock %}
  317. {% endif %}
  318. </body>
  319. </html>