-
Notifications
You must be signed in to change notification settings - Fork 41
/
layout.html.twig
124 lines (104 loc) · 4.91 KB
/
layout.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{#
This file is part of the Sonata package.
(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% set _preview = block('preview') is defined ? block('preview') : '' %}
{% set _form = block('form') is defined ? block('form') : '' %}
{% set _show = block('show') is defined ? block('show') : '' %}
{% set _list_table = block('list_table') is defined ? block('list_table') : '' %}
{% set _list_filters = block('list_filters') is defined ? block('list_filters') : '' %}
{% set _side_menu = block('side_menu') is defined ? block('side_menu') : '' %}
{% set _content = block('content') is defined ? block('content') : '' %}
{% set _title = block('title') is defined ? block('title') : '' %}
{% set _breadcrumb = block('breadcrumb') is defined ? block('breadcrumb') : '' %}
<!DOCTYPE html>
<html {% block html_attributes %}class="no-js"{% endblock %}>
<head>
{% block meta_tags %}
<meta charset="UTF-8">
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
{% endblock %}
<meta data-sonata-admin='{{ {
config: {
CONFIRM_EXIT: sonata_admin.adminPool.getOption('confirm_exit'),
USE_SELECT2: sonata_admin.adminPool.getOption('use_select2'),
USE_ICHECK: sonata_admin.adminPool.getOption('use_icheck'),
USE_STICKYFORMS: sonata_admin.adminPool.getOption('use_stickyforms'),
DEBUG: sonata_admin.adminPool.getOption('js_debug'),
},
translations: {
CONFIRM_EXIT: 'confirm_exit'|trans({}, 'SonataAdminBundle'),
},
}|json_encode()|raw }}'
>
{% block stylesheets %}
{% for stylesheet in admin_pool.getOption('stylesheets', []) %}
<link rel="stylesheet" type="text/css" href="{{ asset(stylesheet) }}" />
{% endfor %}
{% endblock %}
{% block javascripts %}
{% for javascript in admin_pool.getOption('javascripts', []) %}
<script src="{{ asset(javascript) }}" type="text/javascript"></script>
{% endfor %}
{% endblock %}
<title>
{{ 'Admin'|trans({}, 'SonataAdminBundle') }}
{% if _title is not empty %}
{{ _title|raw }}
{% else %}
{% if action is defined %}
-
{% if admin.breadcrumbs is defined %}
{% for menu in admin.breadcrumbs(action) %}
{% if not loop.first %}
>
{% endif %}
{{ menu.label }}
{% endfor %}
{% endif %}
{% endif %}
{% endif%}
</title>
</head>
<body class="sonata-bc {% if _side_menu is empty %}sonata-ba-no-side-menu{% endif %}">
{# initialize block value #}
<div class="container-fluid">
{% block notice %}
{% for notice_level in ['success','error','info', 'warning'] %}
{% set session_var = 'sonata_flash_' ~ notice_level %}
{% for flash in app.session.flashbag.get(session_var) %}
<div class="alert {{ 'alert-' ~ notice_level }}">
{{ flash|trans([], 'SonataAdminBundle') }}
</div>
{% endfor %}
{% endfor %}
{% endblock %}
<div class="row-fluid">
{% if _side_menu is not empty %}
<div class="sidebar span2">
<div class="well sonata-ba-side-menu" style="padding: 8px 0;">{{ _side_menu|raw }}</div>
</div>
{% endif %}
<div class="content {{ _side_menu is not empty ? ' span10' : 'span12' }}">
{% block sonata_admin_content %}
{% if _preview is not empty %}
<div class="sonata-ba-preview">{{ _preview|raw }}</div>
{% endif %}
{% if _list_table is not empty or _list_filters is not empty %}
<div class="row-fluid">
<div class="sonata-ba-list span10">
{{ _list_table|raw }}
</div>
<div class="sonata-ba-filter span2">
{{ _list_filters|raw }}
</div>
</div>
{% endif %}
{% endblock %}
</div>
</div>
</div>
</body>
</html>