mirror of
https://github.com/jbcr/core.git
synced 2026-04-30 04:03:11 +02:00
118 lines
4.2 KiB
Twig
118 lines
4.2 KiB
Twig
{# Check if aside has value and set hasAside variable #}
|
||
{% set asideblock = block('aside') %}
|
||
{% set hasAside = asideblock|trim is not empty ? true : false %}
|
||
|
||
<!DOCTYPE html>
|
||
<html id="{% block html_id %}{% endblock %}">
|
||
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>{{ block('title')|striptags }}</title>
|
||
{% block stylesheets %}
|
||
{% set theme = 'theme-' ~ user.backendTheme|default('default') %}
|
||
{{ encore_entry_link_tags('bolt') }}
|
||
{{ encore_entry_link_tags(theme) }}
|
||
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32" />
|
||
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16" />
|
||
{% endblock %}
|
||
</head>
|
||
|
||
<body id="{% block body_id %}{% endblock %}">
|
||
<div class="admin has-{{ block('container') }}">
|
||
|
||
{% set admin_menu_json = admin_menu()|json_encode %}
|
||
|
||
<!-- Admin Toolbar -->
|
||
<nav id="toolbar" class="admin__toolbar">
|
||
{% set user_display_name = user.displayName|default('Unknown user') %}
|
||
|
||
{# Setting the labels and their localisations that are used in the sidebar-menu. #}
|
||
{% set labels = {
|
||
'about.bolt_documentation': 'about.bolt_documentation'|trans,
|
||
'action.view_site': 'action.view'|trans ~ ' ' ~ config.get('general/sitename'),
|
||
'action.create_new': 'action.create_new'|trans,
|
||
'general.greeting': 'general.greeting'|trans({'%name%': user_display_name}),
|
||
'action.logout': 'action.logout'|trans,
|
||
'action.edit_profile': 'action.edit_profile'|trans,
|
||
'about.visit_bolt': 'about.visit_bolt'|trans
|
||
}|json_encode %}
|
||
|
||
<admin-toolbar
|
||
site-name="{{ config.get('general/sitename') }}"
|
||
:menu="{{ admin_menu_json }}"
|
||
user="{{ user|default }}"
|
||
:labels="{{ labels }}"
|
||
:backend_prefix="{{ path('bolt_dashboard') }}"
|
||
></admin-toolbar>
|
||
</nav>
|
||
<!-- End Admin Toolbar -->
|
||
|
||
<!-- Admin Header -->
|
||
<header class="admin__header">
|
||
<div class="admin__header--topbar">
|
||
<h1 class="admin__header--title">{{ block('title') }}</h1>
|
||
<button class="admin-sidebar-toggler btn btn-md"><span class="sr-only">{{ 'admin_sidebar_toggler.toggle'|trans }}</span></button>
|
||
</div>
|
||
</header>
|
||
<!-- End Admin Header -->
|
||
|
||
<!-- Admin Sidebar -->
|
||
<div class="admin__sidebar">
|
||
<div id="sidebar" class="sidebar sidebar--sticky">
|
||
<admin-sidebar
|
||
:menu="{{ admin_menu_json }}"
|
||
:version="'{{ constant('Bolt\\Version::VERSION')|replace({'alpha': 'α', 'beta': 'β'}) }}'"
|
||
:about-link="{{ path('bolt_about')|json_encode }}"
|
||
:labels="{{ { 'toggler': 'admin_sidebar.toggler'|trans }|json_encode }}"
|
||
></admin-sidebar >
|
||
</div>
|
||
</div>
|
||
<!-- End Admin Sidebar -->
|
||
|
||
<!-- Admin Main -->
|
||
<div class="admin__body {% block container %}{% endblock %}">
|
||
|
||
{% block topsection %}
|
||
{# insert stuff here that should _not_ be part of the
|
||
Vue components, like `{{ dump() }}` statements #}
|
||
{% endblock %}
|
||
|
||
<div class="admin__body--container{% if hasAside %} admin__body--container--has-sidebar{% endif%}" id="{% block vue_id %}{% endblock %}">
|
||
<main class="admin__body--main">
|
||
{% block main %}
|
||
{% endblock %}
|
||
</main>
|
||
|
||
{% if hasAside %}
|
||
<aside class="admin__body--aside">
|
||
{% block aside %}
|
||
{% endblock %}
|
||
</aside>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<div class="admin__notifications">
|
||
{{ include('@bolt/_partials/_flash_messages.html.twig') }}
|
||
</div>
|
||
</div>
|
||
<!-- End Admin Main -->
|
||
|
||
</div>
|
||
|
||
{% block javascripts %}
|
||
<script>
|
||
var admin = document.querySelector('.admin');
|
||
var slim = JSON.parse(localStorage.getItem('slim-sidebar'));
|
||
if (slim){
|
||
admin.classList.add('is-slim');
|
||
}
|
||
</script>
|
||
{{ encore_entry_script_tags('bolt') }}
|
||
{% endblock %}
|
||
|
||
</body>
|
||
|
||
</html>
|