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