-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbase.html.twig
162 lines (147 loc) · 8.49 KB
/
base.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
{#
This is the base template used as the application layout which contains the
common elements and decorates all the other templates.
See https://symfony.com/doc/current/templates.html#template-inheritance-and-layouts
#}
<!DOCTYPE html>
<html lang="{{ app.request.locale }}">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>{% block title %}Symfony Demo application{% endblock %}</title>
<link rel="alternate" type="application/rss+xml" title="{{ 'rss.title'|trans }}" href="{{ path('blog_rss') }}">
{% block stylesheets %}
{{ encore_entry_link_tags('app') }}
{% endblock %}
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
</head>
<body id="{% block body_id %}{% endblock %}">
{% block header %}
<header>
<div class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header col-md-3 col-lg-2">
<a class="navbar-brand" href="{{ path('homepage') }}">
Symfony Demo
</a>
<button type="button" class="navbar-toggle"
data-toggle="collapse"
data-target=".navbar-collapse">
<span class="sr-only">{{ 'menu.toggle_nav'|trans }}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
{% block header_navigation_links %}
<li>
<a href="{{ path('blog_index') }}">
<i class="fa fa-home" aria-hidden="true"></i> {{ 'menu.homepage'|trans }}
</a>
</li>
{% if is_granted('ROLE_ADMIN') %}
<li>
<a href="{{ path('admin_post_index') }}">
<i class="fa fa-lock" aria-hidden="true"></i> {{ 'menu.admin'|trans }}
</a>
</li>
{% endif %}
{% endblock %}
<li>
<a href="{{ path('blog_search') }}"> <i class="fa fa-search"></i> {{ 'menu.search'|trans }}</a>
</li>
{% if app.user %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" id="user">
<i class="fa fa-user" aria-hidden="true"></i>
<span class="caret"></span>
<span class="sr-only">{{ app.user.fullname }}</span>
</a>
<ul class="dropdown-menu user" role="menu" aria-labelledby="user">
<li>
<a href="{{ path('user_edit') }}">
<i class="fa fa-edit" aria-hidden="true"></i> {{ 'menu.user'|trans }}
</a>
</li>
<li class="divider"></li>
<li>
<a href="{{ path('security_logout') }}">
<i class="fa fa-sign-out" aria-hidden="true"></i> {{ 'menu.logout'|trans }}
</a>
</li>
</ul>
</li>
{% endif %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" id="locales">
<i class="fa fa-globe" aria-hidden="true"></i>
<span class="caret"></span>
<span class="sr-only">{{ 'menu.choose_language'|trans }}</span>
</a>
<ul class="dropdown-menu locales" role="menu" aria-labelledby="locales">
{% for locale in locales() %}
<li {% if app.request.locale == locale.code %}aria-checked="true" class="active"{% else %}aria-checked="false"{% endif %} role="menuitem"><a href="{{ path(app.request.get('_route', 'blog_index'), app.request.get('_route_params', [])|merge({_locale: locale.code})) }}">{{ locale.name|capitalize }} <small>{{ locale.code[0:2] }}</small></a></li>
{% endfor %}
</ul>
</li>
</ul>
</div>
</div>
</div>
</header>
{% endblock %}
<div class="container body-container">
{% block body %}
<div class="row">
<div id="main" class="col-sm-9">
{{ include('default/_flash_messages.html.twig') }}
{% block main %}{% endblock %}
</div>
<div id="sidebar" class="col-sm-3">
{% block sidebar %}
{{ render_esi(controller('Symfony\\Bundle\\FrameworkBundle\\Controller\\TemplateController::templateAction', {
'template': 'blog/about.html.twig',
'sharedAge': 600,
'_locale': app.request.locale
})) }}
{% endblock %}
</div>
</div>
{% endblock %}
</div>
{% block footer %}
<footer>
<div class="container">
<div class="row">
<div id="footer-copyright" class="col-md-6">
<p>© {{ 'now'|date('Y') }} - The Symfony Project</p>
<p>{{ 'mit_license'|trans }}</p>
</div>
<div id="footer-resources" class="col-md-6">
<p>
<a href="https://twitter.com/symfony" title="Symfony Twitter">
<i class="fa fa-twitter" aria-hidden="true"></i>
</a>
<a href="https://www.facebook.com/SensioLabs" title="SensioLabs Facebook">
<i class="fa fa-facebook" aria-hidden="true"></i>
</a>
<a href="https://symfony.com/blog/" title="Symfony Blog">
<i class="fa fa-rss" aria-hidden="true"></i>
</a>
</p>
</div>
</div>
</div>
</footer>
{% endblock %}
{% block javascripts %}
{{ encore_entry_script_tags('app') }}
{% endblock %}
{# it's not mandatory to set the timezone in localizeddate(). This is done to
avoid errors when the 'intl' PHP extension is not available and the application
is forced to use the limited "intl polyfill", which only supports UTC and GMT #}
<!-- Page rendered on {{ 'now'|format_datetime('long', 'long', '', 'UTC') }} -->
</body>
</html>