-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.html.twig
132 lines (118 loc) · 5.28 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
<!DOCTYPE html>
<html lang="{{ app.request.locale }}" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
<title>
{%- block title %}
{%- block subtitle %}{% endblock -%}
{%- if block('subtitle') is not empty %} | {% endif -%}
{%- block site_title %}Symfony Skeleton{% endblock -%}
{% endblock -%}
</title>
<meta name="description" content="{% block description %}{{ block('subtitle') }}{% endblock %}">
<link rel="canonical" href="{% block canonical %}{{ app.request.uri }}{% endblock %}">
<link rel="apple-touch-icon" href="{{ asset('build/images/logo.png') }}" type="image/png">
<link rel="shortcut icon" href="{{ asset('build/images/logo.png') }}" type="image/x-icon">
{# @see https://ogp.me/ #}
{# required #}
<meta property="og:title" content="{{ block('title') }}">
<meta property="og:type" content="{% block og_type %}website{% endblock %}">
<meta property="og:image" content="{% block og_image %}{{ absolute_url(asset('build/images/logo.png')) }}{% endblock %}">
<meta property="og:url" content="{{ block('canonical') }}">
<meta property="fb:app_id" content="">
{# optional #}
<meta property="og:description" content="{{ block('description') }}">
<meta property="og:site_name" content="{{ block('site_title') }}">
{# @see https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started #}
{# required #}
<meta name="twitter:card" content="summary_large_image">
{# optional #}
<meta name="twitter:site" content="@xxx">
<meta name="twitter:card" content="@xxx">
{% block meta %}{% endblock %}
{{ encore_entry_link_tags('vendors') }}
{% block stylesheets %}
{{ encore_entry_link_tags('app') }}
{% endblock %}
</head>
<body class="bg-light">
{% block body %}
<nav class="navbar navbar-expand-md navbar-light bg-light fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="{{ path('home_index') }}">
<img src="{{ asset('build/images/logo.png') }}" alt="Logo" width="25" height="25" class="mr-1">
<span>{{ block('site_title') }}</span>
</a>
{% if is_granted('ROLE_USER') %}
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-collapse-1">
<i class="fa fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="navbar-collapse-1">
<ul class="navbar-nav mr-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbar-dropdown-1" role="button" data-toggle="dropdown">
{{ 'Menu'|trans }}
</a>
<div class="dropdown-menu" aria-labelledby="navbar-dropdown-1">
<a class="dropdown-item" href="{{ path('user_index') }}">{{ 'User'|trans }}</a>
</div>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbar-dropdown-2" role="button" data-toggle="dropdown">
<i class="fa fa-user"></i> {{ app.user }}
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbar-dropdown-2">
<a class="dropdown-item" href="{{ path('user_profile_show') }}">{{ 'Profile'|trans }}</a>
<div class="dropdown-divider"></div>
{% if is_granted('ROLE_PREVIOUS_ADMIN') %}
<a class="dropdown-item" href="{{ path('home_index', {_switch_user: '_exit'}) }}"><i class="fa fa-sign-out-alt"></i> {{ 'End impersonation'|trans }}</a>
{% else %}
<a class="dropdown-item" href="{{ path('user_logout') }}"><i class="fa fa-sign-out-alt"></i> {{ 'Logout'|trans }}</a>
{% endif %}
</div>
</li>
</ul>
</div>
{% endif %}
</div>
</nav>
<div id="content" class="bg-white">
{% block flashes %}
{% if app.session.flashbag.peekAll|length > 0 %}
<div class="container-fluid">
{% for type, messages in app.session.flashbag.all %}
{% for message in messages %}
<div class="alert alert-{{ type }} alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">×</button>
{{ message|trans }}
</div>
{% endfor %}
{% endfor %}
</div>
{% endif %}
{% endblock %}
{% block content %}
<div class="container-fluid">
{% block content_container %}
{% endblock %}
</div>
{% endblock %}
</div>
<footer id="footer" class="container-fluid">
{% block footer %}
<div class="small text-muted text-right py-3">
<a href="http://ttskch.github.io" target="_blank" class="text-muted"><b>ttskch</b></a> © {{ 'now'|date('Y') }} / <a href="https://github.com/ttskch/xxx" target="_blank" class="text-muted"><i class="fab fa-github"></i></a>
</div>
{% endblock %}
</footer>
{{ encore_entry_script_tags('vendors') }}
{% block javascripts %}
{{ encore_entry_script_tags('app') }}
{% endblock %}
{% endblock body %}
</body>
</html>