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

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. <!DOCTYPE html>
  20. <html {% block html_attributes %}class="no-js"{% endblock %}>
  21.     <head>
  22.         {% block meta_tags %}
  23.             <meta http-equiv="X-UA-Compatible" content="IE=edge">
  24.             <meta charset="UTF-8">
  25.             <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
  26.         {% endblock %}
  27.         <meta data-sonata-admin='{{ {
  28.             config: {
  29.                 CONFIRM_EXIT: sonata_admin.adminPool.getOption('confirm_exit'),
  30.                 USE_SELECT2: sonata_admin.adminPool.getOption('use_select2'),
  31.                 USE_ICHECK: sonata_admin.adminPool.getOption('use_icheck'),
  32.                 USE_STICKYFORMS: sonata_admin.adminPool.getOption('use_stickyforms'),
  33.                 DEBUG: sonata_admin.adminPool.getOption('js_debug'),
  34.             },
  35.             translations: {
  36.                 CONFIRM_EXIT: 'confirm_exit'|trans({}, 'SonataAdminBundle'),
  37.             },
  38.         }|json_encode()|raw }}'
  39.         >
  40.         {% block stylesheets %}
  41.             {% for stylesheet in sonata_admin.adminPool.getOption('stylesheets', []) %}
  42.                 <link rel="stylesheet" href="{{ asset(stylesheet) }}">
  43.             {% endfor %}
  44.         {% endblock %}
  45.         {% block javascripts %}
  46.             {% block sonata_javascript_config %}
  47.             {% endblock %}
  48.             {% block sonata_javascript_pool %}
  49.                 {% for javascript in sonata_admin.adminPool.getOption('javascripts', []) %}
  50.                     <script src="{{ asset(javascript) }}"></script>
  51.                 {% endfor %}
  52.             {% endblock %}
  53.             {# localize moment #}
  54.             {% set localeForMoment = canonicalize_locale_for_moment() %}
  55.             {% if localeForMoment %}
  56.                 <script src="{{ asset(
  57.                     'bundles/sonatacore/vendor/moment/locale/' ~
  58.                     localeForMoment ~
  59.                     '.js'
  60.                 ) }}"></script>
  61.             {% endif %}
  62.             {# localize select2 #}
  63.             {% if sonata_admin.adminPool.getOption('use_select2') %}
  64.                 {% set localeForSelect2 = canonicalize_locale_for_select2() %}
  65.                 {% if localeForSelect2 %}
  66.                     <script src="{{ asset('bundles/sonatacore/vendor/select2/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.                     {% for menu in breadcrumbs_builder.breadcrumbs(admin, action) %}
  79.                         {% if not loop.first %}
  80.                             {% if loop.index != 2 %}
  81.                                 &gt;
  82.                             {% endif %}
  83.                             {%- set translation_domain = menu.extra('translation_domain', 'messages') -%}
  84.                             {%- set label = menu.label -%}
  85.                             {%- if translation_domain is not same as(false) -%}
  86.                                 {%- set label = label|trans(menu.extra('translation_params', {}), translation_domain) -%}
  87.                             {%- endif -%}
  88.                             {{ label }}
  89.                         {% endif %}
  90.                     {% endfor %}
  91.                 {% endif %}
  92.             {% endif %}
  93.         {% endblock %}
  94.         </title>
  95.     </head>
  96.     <body
  97.             {% block body_attributes -%}
  98.                 class="sonata-bc skin-black fixed
  99.                 {% if app.request.cookies.get('sonata_sidebar_hide') -%}
  100.                     sidebar-collapse
  101.                 {%- endif -%}"
  102.             {%- endblock -%}
  103.     >
  104.     <div class="wrapper">
  105.         {% block sonata_header %}
  106.             <header class="main-header">
  107.                 {% block sonata_header_noscript_warning %}
  108.                     <noscript>
  109.                         <div class="noscript-warning">
  110.                             {{ 'noscript_warning'|trans({}, 'SonataAdminBundle') }}
  111.                         </div>
  112.                     </noscript>
  113.                 {% endblock %}
  114.                 {% block logo %}
  115.                     {% apply spaceless %}
  116.                         <a class="logo" href="{{ path('sonata_admin_dashboard') }}">
  117.                             {% if 'single_image' == sonata_admin.adminPool.getOption('title_mode') or 'both' == sonata_admin.adminPool.getOption('title_mode') %}
  118.                                 <img src="{{ asset(sonata_admin.adminPool.titlelogo) }}" alt="{{ sonata_admin.adminPool.title }}">
  119.                             {% endif %}
  120.                             {% if 'single_text' == sonata_admin.adminPool.getOption('title_mode') or 'both' == sonata_admin.adminPool.getOption('title_mode') %}
  121.                                 <span>{{ sonata_admin.adminPool.title }}</span>
  122.                             {% endif %}
  123.                         </a>
  124.                     {% endapply %}
  125.                 {% endblock %}
  126.                 {% block sonata_nav %}
  127.                     <nav class="navbar navbar-static-top" role="navigation">
  128.                         <a href="#" class="sidebar-toggle" data-toggle="offcanvas"
  129.                            role="button" title="{{ 'toggle_navigation'|trans({}, 'SonataAdminBundle') }}">
  130.                             <span class="sr-only">{{ 'toggle_navigation'|trans({}, 'SonataAdminBundle') }}</span>
  131.                         </a>
  132.                         <div class="navbar-left">
  133.                             {% block sonata_breadcrumb %}
  134.                                 <div class="hidden-xs">
  135.                                     {% if _breadcrumb is not empty or action is defined %}
  136.                                         <ol class="nav navbar-top-links breadcrumb">
  137.                                             {% if _breadcrumb is empty %}
  138.                                                 {% if action is defined %}
  139.                                                     {% for menu in breadcrumbs_builder.breadcrumbs(admin, action) %}
  140.                                                         {%- set translation_domain = menu.extra('translation_domain', 'messages') -%}
  141.                                                         {%- set label = menu.label -%}
  142.                                                         {%- if translation_domain is not same as(false) -%}
  143.                                                             {%- set label = label|trans(menu.extra('translation_params', {}), translation_domain) -%}
  144.                                                         {%- endif -%}
  145.                                                         {% if not loop.last %}
  146.                                                             <li>
  147.                                                                 {% if menu.uri is not empty %}
  148.                                                                     <a href="{{ menu.uri }}">
  149.                                                                         {% if menu.extra('safe_label', true) %}
  150.                                                                             {{- label|raw -}}
  151.                                                                         {% else %}
  152.                                                                             {{- label|truncate(100) -}}
  153.                                                                         {% endif %}
  154.                                                                     </a>
  155.                                                                 {% else %}
  156.                                                                     <span>{{ label|truncate(100) }}</span>
  157.                                                                 {% endif %}
  158.                                                             </li>
  159.                                                         {% else %}
  160.                                                             <li class="active"><span>{{ label|truncate(100) }}</span></li>
  161.                                                         {% endif %}
  162.                                                     {% endfor %}
  163.                                                 {% endif %}
  164.                                             {% else %}
  165.                                                 {{ _breadcrumb|raw }}
  166.                                             {% endif %}
  167.                                         </ol>
  168.                                     {% endif %}
  169.                                 </div>
  170.                             {% endblock sonata_breadcrumb %}
  171.                         </div>
  172.                         {% block sonata_top_nav_menu %}
  173.                             {% if app.user and is_granted(sonata_admin.adminPool.getOption('role_admin')) %}
  174.                                 <div class="navbar-custom-menu">
  175.                                     <ul class="nav navbar-nav">
  176.                                         {% block sonata_top_nav_menu_add_block %}
  177.                                             <li class="dropdown">
  178.                                                 <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  179.                                                     <i class="fa fa-plus-square fa-fw" aria-hidden="true"></i> <i class="fa fa-caret-down" aria-hidden="true"></i>
  180.                                                 </a>
  181.                                                 {% include get_global_template('add_block') %}
  182.                                             </li>
  183.                                         {% endblock %}
  184.                                         {% block sonata_top_nav_menu_user_block %}
  185.                                             <li class="dropdown user-menu">
  186.                                                 <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  187.                                                     <i class="fa fa-user fa-fw" aria-hidden="true"></i> <i class="fa fa-caret-down" aria-hidden="true"></i>
  188.                                                 </a>
  189.                                                 <ul class="dropdown-menu dropdown-user">
  190.                                                     {% include get_global_template('user_block') %}
  191.                                                 </ul>
  192.                                             </li>
  193.                                         {% endblock %}
  194.                                     </ul>
  195.                                 </div>
  196.                             {% endif %}
  197.                         {% endblock %}
  198.                     </nav>
  199.                 {% endblock sonata_nav %}
  200.             </header>
  201.         {% endblock sonata_header %}
  202.         {% block sonata_wrapper %}
  203.             {% block sonata_left_side %}
  204.                 <aside class="main-sidebar">
  205.                     <section class="sidebar">
  206.                         {% block sonata_side_nav %}
  207.                             {% block sonata_sidebar_search %}
  208.                                 {% if sonata_admin.adminPool.getOption('search') %}
  209.                                     <form action="{{ path('sonata_admin_search') }}" method="GET" class="sidebar-form" role="search">
  210.                                         <div class="input-group custom-search-form">
  211.                                             <input type="text" name="q" value="{{ app.request.get('q') }}" class="form-control" placeholder="{{ 'search_placeholder'|trans({}, 'SonataAdminBundle') }}">
  212.                                             <span class="input-group-btn">
  213.                                                 <button class="btn btn-flat" type="submit">
  214.                                                     <i class="fa fa-search" aria-hidden="true"></i>
  215.                                                 </button>
  216.                                             </span>
  217.                                         </div>
  218.                                     </form>
  219.                                 {% endif %}
  220.                             {% endblock sonata_sidebar_search %}
  221.                             {% block side_bar_before_nav %} {% endblock %}
  222.                             {% block side_bar_nav %}
  223.                                 {{ knp_menu_render('sonata_admin_sidebar', {template: get_global_template('knp_menu_template')}) }}
  224.                             {% endblock side_bar_nav %}
  225.                             {% block side_bar_after_nav %}
  226.                                 <p class="text-center small" style="border-top: 1px solid #444444; padding-top: 10px">
  227.                                     {% block side_bar_after_nav_content %}
  228.                                     {% endblock %}
  229.                                 </p>
  230.                             {% endblock %}
  231.                         {% endblock sonata_side_nav %}
  232.                     </section>
  233.                 </aside>
  234.             {% endblock sonata_left_side %}
  235.             <div class="content-wrapper">
  236.                 {% block sonata_page_content %}
  237.                     <section class="content-header">
  238.                         {% block sonata_page_content_header %}
  239.                             {% block sonata_page_content_nav %}
  240.                                 {% if _navbar_title is not empty
  241.                                   or _tab_menu is not empty
  242.                                   or _actions is not empty
  243.                                   or _list_filters_actions is not empty
  244.                                  %}
  245.                                     <nav class="navbar navbar-default" role="navigation">
  246.                                         <div class="container-fluid">
  247.                                             {% block tab_menu_navbar_header %}
  248.                                                 {% if _navbar_title is not empty %}
  249.                                                     <div class="navbar-header">
  250.                                                         <a class="navbar-brand" href="#">{{ _navbar_title|raw }}</a>
  251.                                                     </div>
  252.                                                 {% endif %}
  253.                                             {% endblock %}
  254.                                             <div class="navbar-collapse">
  255.                                                 {% if _tab_menu is not empty %}
  256.                                                     <div class="navbar-left">
  257.                                                         {{ _tab_menu|raw }}
  258.                                                     </div>
  259.                                                 {% endif %}
  260.                                                 {% if admin is defined and action is defined and action == 'list' and admin.listModes|length > 1 %}
  261.                                                     <div class="nav navbar-right btn-group">
  262.                                                         {% for mode, settings in admin.listModes %}
  263.                                                             <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 %}"><i class="{{ settings.class }}"></i></a>
  264.                                                         {% endfor %}
  265.                                                     </div>
  266.                                                 {% endif %}
  267.                                                 {% block sonata_admin_content_actions_wrappers %}
  268.                                                     {% if _actions|replace({ '<li>': '', '</li>': '' })|trim is not empty %}
  269.                                                         <ul class="nav navbar-nav navbar-right">
  270.                                                         {% if _actions|split('</a>')|length > 2 %}
  271.                                                             <li class="dropdown sonata-actions">
  272.                                                                 <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ 'link_actions'|trans({}, 'SonataAdminBundle') }} <b class="caret"></b></a>
  273.                                                                 <ul class="dropdown-menu" role="menu">
  274.                                                                     {{ _actions|raw }}
  275.                                                                 </ul>
  276.                                                             </li>
  277.                                                         {% else %}
  278.                                                             {{ _actions|raw }}
  279.                                                         {% endif %}
  280.                                                         </ul>
  281.                                                     {% endif %}
  282.                                                 {% endblock sonata_admin_content_actions_wrappers %}
  283.                                                 {% if _list_filters_actions is not empty %}
  284.                                                     {{ _list_filters_actions|raw }}
  285.                                                 {% endif %}
  286.                                             </div>
  287.                                         </div>
  288.                                     </nav>
  289.                                 {% endif %}
  290.                             {% endblock sonata_page_content_nav %}
  291.                         {% endblock sonata_page_content_header %}
  292.                     </section>
  293.                     <section class="content">
  294.                         {% block sonata_admin_content %}
  295.                             {% block notice %}
  296.                                 {% include '@SonataCore/FlashMessage/render.html.twig' %}
  297.                             {% endblock notice %}
  298.                             {% if _preview is not empty %}
  299.                                 <div class="sonata-ba-preview">{{ _preview|raw }}</div>
  300.                             {% endif %}
  301.                             {% if _content is not empty %}
  302.                                 <div class="sonata-ba-content">{{ _content|raw }}</div>
  303.                             {% endif %}
  304.                             {% if _show is not empty %}
  305.                                 <div class="sonata-ba-show">{{ _show|raw }}</div>
  306.                             {% endif %}
  307.                             {% if _form is not empty %}
  308.                                 <div class="sonata-ba-form">{{ _form|raw }}</div>
  309.                             {% endif %}
  310.                             {% if _list_filters is not empty %}
  311.                                 <div class="row">
  312.                                     {{ _list_filters|raw }}
  313.                                 </div>
  314.                             {% endif %}
  315.                             {% if _list_table is not empty %}
  316.                                 <div class="row">
  317.                                     {{ _list_table|raw }}
  318.                                 </div>
  319.                             {% endif %}
  320.                         {% endblock sonata_admin_content %}
  321.                     </section>
  322.                 {% endblock sonata_page_content %}
  323.             </div>
  324.         {% endblock sonata_wrapper %}
  325.     </div>
  326.     {% if sonata_admin.adminPool.getOption('use_bootlint') %}
  327.         {% block bootlint %}
  328.             {# Bootlint - https://github.com/twbs/bootlint#in-the-browser #}
  329.             <script type="text/javascript">
  330.                 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)})();
  331.             </script>
  332.         {% endblock %}
  333.     {% endif %}
  334.     </body>
  335. </html>