vendor/sonata-project/admin-bundle/src/Resources/views/standard_layout.html.twig line 1

  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.         {% endblock %}
  49.         {% block javascripts %}
  50.             {% block sonata_javascript_config %}
  51.             {% endblock %}
  52.             {% block sonata_javascript_pool %}
  53.                 {% for javascript in sonata_config.getOption('javascripts', []) %}
  54.                     <script src="{{ asset(javascript) }}"></script>
  55.                 {% endfor %}
  56.             {% endblock %}
  57.             {# localize moment #}
  58.             {% set localeForMoment = sonata_form_canonicalize_locale_for_moment() %}
  59.             {% if localeForMoment %}
  60.                 <script src="{{ asset('bundles/sonataform/moment-locale/' ~ localeForMoment ~ '.js') }}"></script>
  61.             {% endif %}
  62.             {# localize select2 #}
  63.             {% if sonata_config.getOption('use_select2') %}
  64.                 {% set localeForSelect2 = canonicalize_locale_for_select2() %}
  65.                 {% if localeForSelect2 %}
  66.                     <script src="{{ asset('bundles/sonataadmin/select2-locale/' ~ localeForSelect2 ~ '.js') }}"></script>
  67.                 {% endif %}
  68.             {% endif %}
  69.         {% endblock %}
  70.         <title>
  71.         {% block sonata_head_title %}
  72.             {{ 'Admin'|trans({}, 'SonataAdminBundle') }}
  73.             {% if _title is not empty %}
  74.                 {{ _title|striptags|raw }}
  75.             {% else %}
  76.                 {% if action is defined %}
  77.                     -
  78.                     {{ render_breadcrumbs_for_title(admin, action) }}
  79.                 {% endif %}
  80.             {% endif %}
  81.         {% endblock %}
  82.         </title>
  83.     </head>
  84.     <body
  85.             {% block body_attributes -%}
  86.                 class="sonata-bc {% block admin_lte_skin_class %}{{ _skin }}{% endblock %} fixed
  87.                 {% if _use_select2 %}sonata-select2{% endif %}
  88.                 {% if _use_icheck %}sonata-icheck{% endif %}
  89.                 {% if app.request.cookies.get('sonata_sidebar_hide') -%}
  90.                     sidebar-collapse
  91.                 {%- endif -%}"
  92.             {%- endblock -%}
  93.     >
  94.     <div class="wrapper">
  95.         {% block sonata_header %}
  96.             <header class="main-header">
  97.                 {% block sonata_header_noscript_warning %}
  98.                     <noscript>
  99.                         <div class="noscript-warning">
  100.                             {{ 'noscript_warning'|trans({}, 'SonataAdminBundle') }}
  101.                         </div>
  102.                     </noscript>
  103.                 {% endblock %}
  104.                 {% block logo %}
  105.                     {% apply spaceless %}
  106.                         <a class="logo" href="{{ path('sonata_admin_dashboard') }}">
  107.                             {% if 'icon' == sonata_config.getOption('logo_content') or 'all' == sonata_config.getOption('logo_content') %}
  108.                                 <img src="{{ asset(sonata_config.logo) }}" alt="{{ sonata_config.title }}">
  109.                             {% endif %}
  110.                             {% if 'text' == sonata_config.getOption('logo_content') or 'all' == sonata_config.getOption('logo_content') %}
  111.                                 <span>{{ sonata_config.title }}</span>
  112.                             {% endif %}
  113.                         </a>
  114.                     {% endapply %}
  115.                 {% endblock %}
  116.                 {% block sonata_nav %}
  117.                     <nav class="navbar navbar-static-top">
  118.                         <a href="#" class="sidebar-toggle fa5" data-toggle="push-menu"
  119.                            role="button" title="{{ 'toggle_navigation'|trans({}, 'SonataAdminBundle') }}">
  120.                             <span class="sr-only">{{ 'toggle_navigation'|trans({}, 'SonataAdminBundle') }}</span>
  121.                         </a>
  122.                         <div class="navbar-left">
  123.                             {% block sonata_breadcrumb %}
  124.                                 <div class="hidden-xs">
  125.                                     {% if _breadcrumb is not empty or action is defined %}
  126.                                         <ol class="nav navbar-top-links breadcrumb">
  127.                                             {% if _breadcrumb is empty %}
  128.                                                 {% if action is defined %}
  129.                                                     {{ render_breadcrumbs(admin, action) }}
  130.                                                 {% endif %}
  131.                                             {% else %}
  132.                                                 {{ _breadcrumb|raw }}
  133.                                             {% endif %}
  134.                                         </ol>
  135.                                     {% endif %}
  136.                                 </div>
  137.                             {% endblock sonata_breadcrumb %}
  138.                         </div>
  139.                         {% block sonata_top_nav_menu %}
  140.                             {% if app.user and is_granted(sonata_config.getOption('role_admin')) %}
  141.                                 <div class="navbar-custom-menu">
  142.                                     <ul class="nav navbar-nav">
  143.                                         {% block sonata_top_nav_menu_add_block %}
  144.                                             {% set addBlock = include(get_global_template('add_block')) %}
  145.                                             {% if addBlock is not empty %}
  146.                                                 <li class="dropdown">
  147.                                                     <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  148.                                                         <i class="fas fa-plus-square fa-fw" aria-hidden="true"></i> <i class="fas fa-caret-down" aria-hidden="true"></i>
  149.                                                     </a>
  150.                                                     {{ addBlock|raw }}
  151.                                                 </li>
  152.                                             {% endif %}
  153.                                         {% endblock %}
  154.                                         {% block sonata_top_nav_menu_user_block %}
  155.                                             {% set userBlock = include(get_global_template('user_block')) %}
  156.                                             {% if userBlock is not empty %}
  157.                                                 <li class="dropdown user-menu">
  158.                                                     <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  159.                                                         <i class="fas fa-user fa-fw" aria-hidden="true"></i> <i class="fas fa-caret-down" aria-hidden="true"></i>
  160.                                                     </a>
  161.                                                     <ul class="dropdown-menu dropdown-user">
  162.                                                         {{ userBlock|raw }}
  163.                                                     </ul>
  164.                                                 </li>
  165.                                             {% endif %}
  166.                                         {% endblock %}
  167.                                     </ul>
  168.                                 </div>
  169.                             {% endif %}
  170.                         {% endblock %}
  171.                     </nav>
  172.                 {% endblock sonata_nav %}
  173.             </header>
  174.         {% endblock sonata_header %}
  175.         {% block sonata_wrapper %}
  176.             {% block sonata_left_side %}
  177.                 <aside class="main-sidebar">
  178.                     <section class="sidebar">
  179.                         {% block sonata_side_nav %}
  180.                             {% block sonata_sidebar_search %}
  181.                                 {% if sonata_config.getOption('search') %}
  182.                                     <form action="{{ path('sonata_admin_search') }}" method="GET" class="sidebar-form" role="search">
  183.                                         <div class="input-group custom-search-form">
  184.                                             <input type="text" name="q" value="{{ app.request.get('q') }}" class="form-control" placeholder="{{ 'search_placeholder'|trans({}, 'SonataAdminBundle') }}">
  185.                                             <span class="input-group-btn">
  186.                                                 <button class="btn btn-flat" type="submit">
  187.                                                     <i class="fas fa-search" aria-hidden="true"></i>
  188.                                                 </button>
  189.                                             </span>
  190.                                         </div>
  191.                                     </form>
  192.                                 {% endif %}
  193.                             {% endblock sonata_sidebar_search %}
  194.                             {% block side_bar_before_nav %} {% endblock %}
  195.                             {% block side_bar_nav %}
  196.                                 {{ knp_menu_render('sonata_admin_sidebar', {template: get_global_template('knp_menu_template')}) }}
  197.                             {% endblock side_bar_nav %}
  198.                             {% block side_bar_after_nav %}
  199.                                 <p class="text-center small" style="border-top: 1px solid #444444; padding-top: 10px">
  200.                                     {% block side_bar_after_nav_content %}
  201.                                     {% endblock %}
  202.                                 </p>
  203.                             {% endblock %}
  204.                         {% endblock sonata_side_nav %}
  205.                     </section>
  206.                 </aside>
  207.             {% endblock sonata_left_side %}
  208.             <div class="content-wrapper">
  209.                 {% block sonata_page_content %}
  210.                     <section class="content-header">
  211.                         {% block sonata_page_content_header %}
  212.                             {% block sonata_page_content_nav %}
  213.                                 {% if _navbar_title is not empty
  214.                                   or _tab_menu is not empty
  215.                                   or _actions is not empty
  216.                                   or _list_filters_actions is not empty
  217.                                  %}
  218.                                     <nav class="navbar navbar-default" role="navigation">
  219.                                         <div class="container-fluid">
  220.                                             {% block tab_menu_navbar_header %}
  221.                                                 {% if _navbar_title is not empty %}
  222.                                                     <div class="navbar-header">
  223.                                                         <a class="navbar-brand" href="#">{{ _navbar_title|raw }}</a>
  224.                                                     </div>
  225.                                                 {% endif %}
  226.                                             {% endblock %}
  227.                                             <div class="navbar-collapse">
  228.                                                 {% if _tab_menu is not empty %}
  229.                                                     <div class="navbar-left">
  230.                                                         {{ _tab_menu|raw }}
  231.                                                     </div>
  232.                                                 {% endif %}
  233.                                                 {% if admin is defined and action is defined and action == 'list' and admin.listModes|length > 1 %}
  234.                                                     <div class="nav navbar-right btn-group">
  235.                                                         {% for mode, settings in admin.listModes %}
  236.                                                             <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 %}">
  237.                                                                 {# NEXT_MAJOR: Remove the if and keep the else part #}
  238.                                                                 {% if settings.icon is not defined and settings.class is defined %}
  239.                                                                     {% deprecated 'Relying on the "class" setting is deprecated since sonata-project/admin-bundle 4.9, use the "icon" setting instead' %}
  240.                                                                     <i class="{{ settings.class }}" aria-hidden="true"></i>
  241.                                                                 {% else %}
  242.                                                                     {{ settings.icon|default('')|parse_icon }}
  243.                                                                 {% endif %}
  244.                                                             </a>
  245.                                                         {% endfor %}
  246.                                                     </div>
  247.                                                 {% endif %}
  248.                                                 {% block sonata_admin_content_actions_wrappers %}
  249.                                                     {% if _actions|replace({ '<li>': '', '</li>': '' })|trim is not empty %}
  250.                                                         <ul class="nav navbar-nav navbar-right">
  251.                                                         {% if _actions|split('</a>')|length > 2 %}
  252.                                                             <li class="dropdown sonata-actions">
  253.                                                                 <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ 'link_actions'|trans({}, 'SonataAdminBundle') }} <b class="caret"></b></a>
  254.                                                                 <ul class="dropdown-menu" role="menu">
  255.                                                                     {{ _actions|raw }}
  256.                                                                 </ul>
  257.                                                             </li>
  258.                                                         {% else %}
  259.                                                             {{ _actions|raw }}
  260.                                                         {% endif %}
  261.                                                         </ul>
  262.                                                     {% endif %}
  263.                                                 {% endblock sonata_admin_content_actions_wrappers %}
  264.                                                 {% if _list_filters_actions is not empty %}
  265.                                                     {{ _list_filters_actions|raw }}
  266.                                                 {% endif %}
  267.                                             </div>
  268.                                         </div>
  269.                                     </nav>
  270.                                 {% endif %}
  271.                             {% endblock sonata_page_content_nav %}
  272.                         {% endblock sonata_page_content_header %}
  273.                     </section>
  274.                     <section class="content">
  275.                         {% block sonata_admin_content %}
  276.                             {% block notice %}
  277.                                 {% include '@SonataTwig/FlashMessage/render.html.twig' %}
  278.                             {% endblock notice %}
  279.                             {% if _preview is not empty %}
  280.                                 <div class="sonata-ba-preview">{{ _preview|raw }}</div>
  281.                             {% endif %}
  282.                             {% if _content is not empty %}
  283.                                 <div class="sonata-ba-content">{{ _content|raw }}</div>
  284.                             {% endif %}
  285.                             {% if _show is not empty %}
  286.                                 <div class="sonata-ba-show">{{ _show|raw }}</div>
  287.                             {% endif %}
  288.                             {% if _form is not empty %}
  289.                                 <div class="sonata-ba-form">{{ _form|raw }}</div>
  290.                             {% endif %}
  291.                             {% if _list_filters is not empty %}
  292.                                 <div class="row">
  293.                                     {{ _list_filters|raw }}
  294.                                 </div>
  295.                             {% endif %}
  296.                             {% if _list_table is not empty %}
  297.                                 <div class="row">
  298.                                     {{ _list_table|raw }}
  299.                                 </div>
  300.                             {% endif %}
  301.                         {% endblock sonata_admin_content %}
  302.                     </section>
  303.                 {% endblock sonata_page_content %}
  304.             </div>
  305.         {% endblock sonata_wrapper %}
  306.     </div>
  307.     {% if sonata_config.getOption('use_bootlint') %}
  308.         {% block bootlint %}
  309.             {# Bootlint - https://github.com/twbs/bootlint#in-the-browser #}
  310.             <script type="text/javascript">
  311.                 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)})();
  312.             </script>
  313.         {% endblock %}
  314.     {% endif %}
  315.     </body>
  316. </html>