pull/2487/head
jmontoyaa 7 years ago
parent 0937485fe2
commit e7d35611fb
  1. 164
      src/AdminBundle/Resources/views/standard_layout.html.twig

@ -8,18 +8,19 @@ For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% set _preview = block('preview') %}
{% set _form = block('form') %}
{% set _show = block('show') %}
{% set _list_table = block('list_table') %}
{% set _list_filters = block('list_filters') %}
{% set _tab_menu = block('tab_menu') %}
{% set _content = block('content') %}
{% set _title = block('title') %}
{% set _breadcrumb = block('breadcrumb') %}
{% set _actions = block('actions') %}
{% set _navbar_title = block('navbar_title') %}
{% set _list_filters_actions = block('list_filters_actions') %}
{% set _preview = block('preview') is defined ? block('preview')|trim : null %}
{% set _form = block('form') is defined ? block('form')|trim : null %}
{% set _show = block('show') is defined ? block('show')|trim : null %}
{% set _list_table = block('list_table') is defined ? block('list_table')|trim : null %}
{% set _list_filters = block('list_filters') is defined ? block('list_filters')|trim : null %}
{% set _tab_menu = block('tab_menu') is defined ? block('tab_menu')|trim : null %}
{% set _content = block('content') is defined ? block('content')|trim : null %}
{% set _title = block('title') is defined ? block('title')|trim : null %}
{% set _breadcrumb = block('breadcrumb') is defined ? block('breadcrumb')|trim : null %}
{% set _actions = block('actions') is defined ? block('actions')|trim : null %}
{% set _navbar_title = block('navbar_title') is defined ? block('navbar_title')|trim : null %}
{% set _list_filters_actions = block('list_filters_actions') is defined ? block('list_filters_actions')|trim : null %}
<!DOCTYPE html>
<html {% block html_attributes %}class="no-js"{% endblock %}>
@ -37,6 +38,7 @@ file that was distributed with this source code.
{% endblock %}
{% block javascripts %}
{% block sonata_javascript_config %}
<script>
window.SONATA_CONFIG = {
CONFIRM_EXIT: {% if sonata_admin.adminPool.getOption('confirm_exit') %}true{% else %}false{% endif %},
@ -45,7 +47,7 @@ file that was distributed with this source code.
USE_STICKYFORMS: {% if sonata_admin.adminPool.getOption('use_stickyforms') %}true{% else %}false{% endif %}
};
window.SONATA_TRANSLATIONS = {
CONFIRM_EXIT: '{{ 'confirm_exit'|trans({}, 'SonataAdminBundle')|escape('js') }}'
CONFIRM_EXIT: '{{ 'confirm_exit'|trans({}, 'SonataAdminBundle')|escape('js') }}'
};
// http://getbootstrap.com/getting-started/#support-ie10-width
@ -55,15 +57,22 @@ file that was distributed with this source code.
document.querySelector('head').appendChild(msViewportStyle);
}
</script>
{% endblock %}
{% block sonata_javascript_pool %}
{% for javascript in sonata_admin.adminPool.getOption('javascripts', []) %}
<script src="{{ asset(javascript) }}"></script>
{% endfor %}
{% endblock %}
{% set locale = app.request.locale %}
{# localize moment #}
{% if locale[:2] != 'en' %}
<script src="{{ asset('bundles/sonatacore/vendor/moment/locale/' ~ locale|replace({'_':'-'}) ~ '.js') }}"></script>
<script src="{{ asset(
'bundles/sonatacore/vendor/moment/locale/' ~
locale|lower|replace({'_':'-'}) ~
'.js'
) }}"></script>
{% endif %}
{# localize select2 #}
@ -82,21 +91,27 @@ file that was distributed with this source code.
{{ 'Admin'|trans({}, 'SonataAdminBundle') }}
{% if _title is not empty %}
{{ _title|raw }}
{{ _title|striptags|raw }}
{% else %}
{% if action is defined %}
-
{% for menu in admin.breadcrumbs(action) %}
{% for menu in breadcrumbs_builder.breadcrumbs(admin, action) %}
{% if not loop.first %}
{% if loop.index != 2 %}
{% if loop.index != 2 %}
&gt;
{% endif %}
{{ menu.label }}
{%- set translation_domain = menu.extra('translation_domain', 'messages') -%}
{%- set label = menu.label -%}
{%- if translation_domain is not same as(false) -%}
{%- set label = label|trans(menu.extra('translation_params', {}), translation_domain) -%}
{%- endif -%}
{{ label }}
{% endif %}
{% endfor %}
{% endif %}
{% endif%}
{% endif %}
{% endblock %}
</title>
</head>
@ -138,17 +153,29 @@ file that was distributed with this source code.
<ol class="nav navbar-top-links breadcrumb">
{% if _breadcrumb is empty %}
{% if action is defined %}
{% for menu in admin.breadcrumbs(action) %}
{% if not loop.last %}
{% for menu in breadcrumbs_builder.breadcrumbs(admin, action) %}
{%- set translation_domain = menu.extra('translation_domain', 'messages') -%}
{%- set label = menu.label -%}
{%- if translation_domain is not same as(false) -%}
{%- set label = label|trans(menu.extra('translation_params', {}), translation_domain) -%}
{%- endif -%}
{% if not loop.last %}
<li>
{% if menu.uri is not empty %}
<a href="{{ menu.uri }}">{{ menu.label|raw }}</a>
<a href="{{ menu.uri }}">
{% if menu.extra('safe_label', true) %}
{{- label|raw -}}
{% else %}
{{- label -}}
{% endif %}
</a>
{% else %}
{{ menu.label }}
<span>{{ label }}</span>
{% endif %}
</li>
{% else %}
<li class="active"><span>{{ menu.label }}</span></li>
<li class="active"><span>{{ label }}</span></li>
{% endif %}
{% endfor %}
{% endif %}
@ -162,24 +189,30 @@ file that was distributed with this source code.
</div>
{% block sonata_top_nav_menu %}
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-plus-square fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
{% include sonata_admin.adminPool.getTemplate('add_block') %}
</li>
<li class="dropdown user-menu">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-user">
{% include sonata_admin.adminPool.getTemplate('user_block') %}
</ul>
</li>
</ul>
</div>
{% if app.user and is_granted('ROLE_SONATA_ADMIN') %}
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
{% block sonata_top_nav_menu_add_block %}
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-plus-square fa-fw" aria-hidden="true"></i> <i class="fa fa-caret-down" aria-hidden="true"></i>
</a>
{% include sonata_admin.adminPool.getTemplate('add_block') %}
</li>
{% endblock %}
{% block sonata_top_nav_menu_user_block %}
<li class="dropdown user-menu">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-user fa-fw" aria-hidden="true"></i> <i class="fa fa-caret-down" aria-hidden="true"></i>
</a>
<ul class="dropdown-menu dropdown-user">
{% include sonata_admin.adminPool.getTemplate('user_block') %}
</ul>
</li>
{% endblock %}
</ul>
</div>
{% endif %}
{% endblock %}
</nav>
{% endblock sonata_nav %}
@ -192,25 +225,21 @@ file that was distributed with this source code.
<section class="sidebar">
{% block sonata_side_nav %}
{% block sonata_sidebar_search %}
{% if app.user and is_granted('ROLE_SONATA_ADMIN') %}
<form action="{{ path('sonata_admin_search') }}" method="GET" class="sidebar-form" role="search">
<div class="input-group custom-search-form">
<input type="text" name="q" value="{{ app.request.get('q') }}" class="form-control" placeholder="{{ 'search_placeholder'|trans({}, 'SonataAdminBundle') }}">
<span class="input-group-btn">
<button class="btn btn-flat" type="submit">
<i class="fa fa-search"></i>
</button>
</span>
</div>
</form>
{% endif %}
<form action="{{ path('sonata_admin_search') }}" method="GET" class="sidebar-form" role="search">
<div class="input-group custom-search-form">
<input type="text" name="q" value="{{ app.request.get('q') }}" class="form-control" placeholder="{{ 'search_placeholder'|trans({}, 'SonataAdminBundle') }}">
<span class="input-group-btn">
<button class="btn btn-flat" type="submit">
<i class="fa fa-search" aria-hidden="true"></i>
</button>
</span>
</div>
</form>
{% endblock sonata_sidebar_search %}
{% block side_bar_before_nav %} {% endblock %}
{% block side_bar_nav %}
{% if app.user and is_granted('ROLE_SONATA_ADMIN') %}
{{ knp_menu_render('sonata_admin_sidebar', {template: sonata_admin.adminPool.getTemplate('knp_menu_template')}) }}
{% endif %}
{{ knp_menu_render('sonata_admin_sidebar', {template: sonata_admin.adminPool.getTemplate('knp_menu_template')}) }}
{% endblock side_bar_nav %}
{% block side_bar_after_nav %}
<p class="text-center small" style="border-top: 1px solid #444444; padding-top: 10px">
@ -242,11 +271,11 @@ file that was distributed with this source code.
{% endblock %}
<div class="navbar-collapse">
<div class="navbar-left">
{% if _tab_menu is not empty %}
{% if _tab_menu is not empty %}
<div class="navbar-left">
{{ _tab_menu|raw }}
{% endif %}
</div>
</div>
{% endif %}
{% if admin is defined and action is defined and action == 'list' and admin.listModes|length > 1 %}
<div class="nav navbar-right btn-group">
@ -307,17 +336,16 @@ file that was distributed with this source code.
<div class="sonata-ba-form">{{ _form|raw }}</div>
{% endif %}
{% if _list_table is not empty or _list_filters is not empty %}
{% if _list_filters|trim %}
<div class="row">
{{ _list_filters|raw }}
</div>
{% endif %}
{% if _list_filters is not empty %}
<div class="row">
{{ _list_filters|raw }}
</div>
{% endif %}
{% if _list_table is not empty %}
<div class="row">
{{ _list_table|raw }}
</div>
{% endif %}
{% endblock sonata_admin_content %}
</section>

Loading…
Cancel
Save