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