BackofficeBundle/Resources/views/layout.html.twig
<!DOCTYPE html>
<html>
<head>
<title>{% block title %}OpenOrchestra{% endblock %}</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% block stylesheets %}
{% if app.debug %}
<link rel="stylesheet" type="text/css" media="screen" href="{{ asset('css/all.css') }}" />
{% else %}
<link rel="stylesheet" type="text/css" media="screen" href="{{ asset('css/all.min.css') }}" />
{% endif %}
{% endblock %}
</head>
<body>
{% block body %}
<header class="header-region">
</header>
<div class="inner">
<div id="left-column">
</div>
<div id="central-column">
<div class="top-central-column breadcrumb-region"></div>
<div class="content-region"></div>
</div>
</div>
<div class="modal-region"></div>
{% set siteIdKey = constant('OpenOrchestra\\UserBundle\\Document\\User::SITE_ID_PREFIX') ~ context.siteId %}
<script>
var config = {{ clientConfiguration|json_encode()|raw }}
var context = {
routing: {
baseUrl: '{{ app.request.baseUrl }}',
scheme: '{{ app.request.scheme }}',
host: '{{ app.request.host }}'
},
siteId: '{{ context.siteId }}',
siteLanguages: {{ context.siteLanguages|json_encode()|raw }},
language: '{{ context.backOfficeLanguage }}',
user: {
id : '{{ app.user.id }}',
username : '{{ app.user.username }}',
firstName : '{{ app.user.firstName }}',
lastName : '{{ app.user.lastName }}',
language : {
contribution: {% if app.user.languageBySites[siteIdKey] is defined %} '{{ app.user.languageBySites[siteIdKey] }}' {% else %} '{{context.siteDefaultLanguage}}' {% endif %}
},
roles : {{ app.user.roles|json_encode()|raw }},
access_section: {
'dashboard' : true,
'contribution' : true,
'user' : {{ ('ROLE_DEVELOPER' in app.user.roles or 'ROLE_PLATFORM_ADMIN' in app.user.roles or 'ROLE_SITE_ADMIN' in app.user.roles)|json_encode()|raw }},
'configuration': {{ ('ROLE_DEVELOPER' in app.user.roles or 'ROLE_PLATFORM_ADMIN' in app.user.roles or 'ROLE_SITE_ADMIN' in app.user.roles)|json_encode()|raw }},
'platform' : {{ ('ROLE_DEVELOPER' in app.user.roles or 'ROLE_PLATFORM_ADMIN' in app.user.roles)|json_encode()|raw }},
'developer' : {{ ('ROLE_DEVELOPER' in app.user.roles)|json_encode()|raw }},
'trashcan' : {{ ('ROLE_DEVELOPER' in app.user.roles or 'ROLE_PLATFORM_ADMIN' in app.user.roles or 'EDITORIAL_TRASH_RESTORER' in app.user.roles)|json_encode()|raw }},
'content' : {{ ('ROLE_DEVELOPER' in app.user.roles or 'ROLE_PLATFORM_ADMIN' in app.user.roles or 'EDITORIAL_CONTENT_CONTRIBUTOR' in app.user.roles)|json_encode()|raw }}
}
}
};
</script>
{% if app.debug %}
<script type="text/javascript" src="{{ asset('js/all.js') }}"></script>
{% else %}
<script type="text/javascript" src="{{ asset('js/all.min.js') }}"></script>
{% endif %}
{% endblock %}
</body>
</html>