forked from sonata-project/SonataPageBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase_layout.html.twig
134 lines (114 loc) · 7.02 KB
/
base_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
125
126
127
128
129
130
131
132
133
134
{#
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.
#}
{%- block sonata_page_html_tag -%}
<!DOCTYPE html>
<html {{ sonata_seo_html_attributes() }}>
{% endblock %}
{% block sonata_page_head %}
<head {{ sonata_seo_head_attributes() }}>
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
{{ sonata_seo_title() }}
{{ sonata_seo_metadatas() }}
{% block sonata_page_stylesheets %}
{% block page_stylesheets %} {# Deprecated block #}
<link rel="stylesheet" href="{{ asset('bundles/sonatapage/frontend.css') }}" media="all">
{% endblock %}
{% endblock %}
{% block sonata_page_javascripts %}
{% block page_javascripts %} {# Deprecated block #}
{% endblock %}
{% endblock %}
</head>
{% endblock %}
{% block sonata_page_body_tag %}
<body class="sonata-bc">
{% endblock %}
{% block sonata_page_top_bar %}
{% block page_top_bar %} {# Deprecated block #}
{% if sonata_page.isEditor or ( app.user and is_granted('ROLE_PREVIOUS_ADMIN') ) %}
<header class="sonata-bc sonata-page-top-bar navbar navbar-inverse navbar-fixed-top" role="banner">
<div class="container">
<ul class="nav navbar-nav">
{% if app.user and is_granted('ROLE_SONATA_ADMIN') %}
<li><a href="{{ path('sonata_admin_dashboard') }}">{{ "header.sonata_admin_dashboard"|trans({}, 'SonataPageBundle') }}</a></li>
{% endif %}
{% if sonata_page.isEditor %}
{% set sites = sonata_page.siteavailables %}
{% if sites|length > 1 and site is defined %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ site.name }} <span class="caret"></span></a>
<ul class="dropdown-menu">
{% for site in sites %}
<li><a href="{{ site.url }}">{{ site.name }}</a></li>
{% endfor %}
</ul>
</li>
{% endif %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Page <span class="caret"></span></a>
<ul class="dropdown-menu">
{% if page is defined %}
<li><a href="{{ sonata_page_admin.generateUrl('edit', {(sonata_page_admin.idParameter): page.id}) }}" target="_blank">{{ "header.edit_page"|trans({}, 'SonataPageBundle') }}</a></li>
<li><a href="{{ sonata_page_admin.generateUrl('sonata.page.admin.page|sonata.page.admin.snapshot.list', {(sonata_page_admin.idParameter): page.id}) }}" target="_blank">{{ "header.create_snapshot"|trans({}, 'SonataPageBundle') }}</a></li>
<li class="divider"></li>
{% endif %}
<li><a href="{{ sonata_page_admin.generateUrl('list') }}" target="_blank">{{ "header.view_all_pages"|trans({}, 'SonataPageBundle') }}</a></li>
{% if error_codes is defined and error_codes|length %}
<li class="divider"></li>
<li><a href="{{ path('sonata_page_exceptions_list') }}" target="_blank">{{ "header.view_all_exceptions"|trans({}, 'SonataPageBundle') }}</a></li>
{% endif %}
</ul>
</li>
{% if page is defined %}
<li>
<a href="{{ sonata_page_admin.generateUrl('compose', {(sonata_page_admin.idParameter): page.id}) }}">
<i class="fa fa-magic"></i>
{{ 'header.compose_page'|trans({}, 'SonataPageBundle')}}
</a>
</li>
{% endif %}
{% if page is defined and not page.enabled %}
<li><span style="padding-left: 20px; background: red;"><strong><em>{{ 'header.page_is_disabled'|trans([], 'SonataPageBundle') }}</em></strong></span></li>
{% endif %}
{% endif %}
{% if app.user and is_granted('ROLE_PREVIOUS_ADMIN') %}
<li><a href="{{ url('homepage', {'_switch_user': '_exit'}) }}">{{ "header.switch_user_exit"|trans({}, 'SonataPageBundle')}}</a></li>
{% endif %}
</ul>
</div>
</header>
{% endif %}
{% endblock %}
{% endblock %}
{% block sonata_page_container %}
{% block page_container %}{% endblock %} {# Deprecated block #}
{% endblock %}
{% block sonata_page_asset_footer %}
{% block page_asset_footer %} {# Deprecated block #}
{% if page is defined %}
{% if page.javascript is not empty %}
<script>
{{ page.javascript|raw }}
</script>
{% endif %}
{% if page.stylesheet is not empty %}
<style>
{{ page.stylesheet|raw }}
</style>
{% endif %}
{% endif %}
{#
These includes can be done only at this point as all blocks are loaded,
Limition : this does not work if a global page is loaded from an ESI tag inside a container block
#}
{{ sonata_block_include_stylesheets('screen', app.request.basePath) }}
{{ sonata_block_include_javascripts('screen', app.request.basePath) }}
{% endblock %}
{% endblock %}
<!-- monitoring:3e9fda56df2cdd3b039f189693ab7844fbb2d4f6 -->
</body>
</html>