forked from philiplb/CRUDlex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayout.twig
115 lines (101 loc) · 5.57 KB
/
layout.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
{#
# This file is part of the CRUDlex package.
#
# (c) Philip Lehmann-Böhm <[email protected]>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#}
<!DOCTYPE html>
{% set rtlLanguages = ['ar'] %}
{% set locale = app.session.get('locale', 'en') %}
{% set localeToFlag = {'en': 'gb', 'de': 'de', 'el': 'gr', 'fr': 'fr'} %}
{% set localeDir = locale in rtlLanguages ? ' dir="rtl" ' : '' %}
<html{{ localeDir|raw }}>
<head>
<title>CRUDlex</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% include app.crud.getTemplate(app, 'template', 'header', crudEntity) %}
<style type="text/css">
body {
padding-top: 70px;
}
.btn-crudlex {
margin: 5px 5px 5px 5px;
}
.tooltip-crudlex {
cursor: pointer;
}
.select2-container {
width: 100% !important;
padding: 0;
}
.flag {
background: url('{{ app.url_generator.generate('static', {file: 'images/flags/flags.png'}) }}') no-repeat;
}
@font-face {
font-family: 'Glyphicons Halflings';
src: url('{{ app.url_generator.generate('static', {file: 'fonts/vendor/bootstrap/glyphicons-halflings-regular.eot'}) }}');
src: url('{{ app.url_generator.generate('static', {file: 'fonts/vendor/bootstrap/glyphicons-halflings-regular.eot?'}) }}#iefix') format('embedded-opentype'), url('{{ app.url_generator.generate('static', {file: 'fonts/vendor/bootstrap/glyphicons-halflings-regular.woff'}) }}') format('woff'), url('{{ app.url_generator.generate('static', {file: 'fonts/vendor/bootstrap/glyphicons-halflings-regular.ttf'}) }}') format('truetype'), url('{{ app.url_generator.generate('static', {file: 'fonts/vendor/bootstrap/glyphicons-halflings-regular.svg'}) }}#glyphicons_halflingsregular') format('svg');
}
</style>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="crudPage{{ crudEntity is defined ? crudEntity : '' }}">
{% if app.session.flashBag is defined %}
{% set flashTypeAvailable = [ 'success', 'danger'] %}
{% for flashType in flashTypeAvailable %}
{% for flash in app.session.flashBag.get(flashType) %}
<div class="alert alert-{{ flashType }}" >
<button class="close" data-dismiss="alert">×</button>
{{ flash }}
</div>
{% endfor %}
{% endfor %}
{% endif %}
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
{% for entity in app.crud.getEntities() %}
<li {% if crudEntity == entity %} class="active" {% endif%}><a href="{{ app.url_generator.generate('crudList', {'entity': entity}) }}">{{ app.crud.getData(entity).getDefinition().getLabel() }}</a></li>
{% endfor %}
</ul>
</div>
</div>
</nav>
<div class="container">
{% block content %}{% endblock %}
{% if app.crud.isManagingI18n() %}
<div dir="ltr">
<small{{ localeDir|raw }}>{{ 'crudlex.chooseLanguage'|trans }}</small>
<div class="dropdown">
<a id="drop4" class="dropdown-toggle" aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown" href="#">
<img src="{{ app.url_generator.generate('static', {file: 'images/blank.gif'}) }}" class="flag flag-{{ localeToFlag[locale] }}" alt="{{ locale|languageName }}" /> {{ locale|languageName }}
<span class="caret"></a>
<ul class="dropdown-menu" aria-labelledby="dLabel">
{% for locale in app.crud.getLocales() %}
<li>
<a href="{{ app.url_generator.generate('crudSetLocale', {'locale': locale, 'redirect': app.request_stack.getCurrentRequest().getUri()}) }}">
<img src="{{ app.url_generator.generate('static', {file: 'images/blank.gif'}) }}" class="flag flag-{{ localeToFlag[locale] }}" alt="{{ locale|languageName }}" /> {{ locale|languageName }}
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
</div>
{% include app.crud.getTemplate(app, 'template', 'footer', crudEntity) %}
<script type="text/javascript">
{% block js %}{% endblock %}
</script>
</div>
</body>
</html>