{%- if app.user.preferedColorScheme|default('auto') == 'auto' -%}
{% set preferred_color_scheme = "auto" %}
{%- elseif app.user.preferedColorScheme == 'dark' -%}
{% set preferred_color_scheme = "dark" %}
{%- else -%}
{% set preferred_color_scheme = "light" %}
{%- endif -%}
<!DOCTYPE html>
<html lang="{{ app.request.locale|replace({'_': '-'}) }}" data-color-scheme="{{ preferred_color_scheme }}">
<head>
<title>{% block title %}{{ ('titles.' ~ app.request.get('_route'))|trans }}{% endblock %} - {{ 'eckinox_admin_ui.app.name'|trans }}</title>
{% include '@EckinoxAdminUi/base/_head.html.twig' %}
{% block head %}{% endblock %}
{{ generate_stacked_css() }}
{% block stylesheets %}{% endblock %}
{%- if preferred_color_scheme == "auto" -%}
<script type="module">
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
document.documentElement.setAttribute("data-color-scheme", prefersDark ? "dark" : "light");
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
document.documentElement.setAttribute("data-color-scheme", event.matches ? "dark" : "light");
});
</script>
{%- endif -%}
</head>
<body data-theme="default" data-layout="fluid" data-sidebar-position="left" data-sidebar-behavior="sticky">
{% block body %}
{% set is_app_user = (app.user is defined ? (app.user is instance_of('App\\Entity\\Security\\AppUser') ? true : false) : false) %}
<div class="wrapper">
{% include '@EckinoxAdminUi/base/_sidebar.html.twig' with {'is_app_user' : is_app_user } %}
<div class="main">
{% include '@EckinoxAdminUi/base/_navbar.html.twig' with {'is_app_user' : is_app_user } %}
<main class="content">
{% block body_content %}
<div class="container-fluid p-0">
<div class="actions float-end mt-n1">
{% block actions %}{% endblock %}
</div>
<h1 class="h3 mb-3">
{% block page_name %}{{ block('title') }}{% endblock %}
</h1>
{% block content %}
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Section name</h5>
</div>
<div class="card-body">
<p>Section content</p>
</div>
</div>
</div>
</div>
{% endblock %}
</div>
{% endblock %}
</main>
{% include '@EckinoxAdminUi/base/_footer.html.twig' %}
</div>
</div>
{% endblock %}
{# FOSJsRoutingBundle #}
<script src="{{ asset('bundles/fosjsrouting/js/router.js') }}"></script>
<script src="{{ path('fos_js_routing_js', {callback: 'fos.Router.setData'}) }}"></script>
{# BazingaJsTranslationBundle #}
{% if app.user and is_granted('IS_AUTHENTICATED_REMEMBERED') %}
{% set locales = [app.request.locale] %}
{% if '_' in app.request.locale %}
{% set locales = locales|merge([app.request.locale|split('_')|first]) %}
{% endif %}
<script src="{{ asset('bundles/bazingajstranslation/js/translator.min.js') }}"></script>
<script src="{{ url('bazinga_jstranslation_js', {'locales': locales|join(',')}) }}"></script>
<script>Translator.locale = '{{ app.request.locale }}';</script>
{% endif %}
{# JQuery #}
<script src="{{ asset('bundles/eckinoxadminui/js/library/jquery.min.js') }}"></script>
{# DropZone #}
<script src="{{ asset('bundles/eckinoxadminui/js/library/dropzone-amd-module.min.js') }}"></script>
{# Bootstrap AdminUI Modules #}
<script src="{{ asset('bundles/eckinoxadminui/js/app.js') }}"></script>
{# Bootstrap multiselect #}
<script src="{{ asset('bundles/eckinoxadminui/js/modules/bootstrap-multiselect.min.js') }}"></script>
<script src="{{ asset('bundles/eckinoxadminui/js/form.js') }}"></script>
{# Tab consistency #}
<script src="{{ asset('bundles/eckinoxadminui/js/tabs.js') }}" type="module"></script>
{# Widgets #}
<script src="{{ asset('bundles/eckinoxadminui/js/widgets/list.js') }}"></script>
<script src="{{ asset('bundles/eckinoxadminui/js/widgets/collection.js') }}"></script>
<script src="{{ asset('bundles/eckinoxadminui/js/library/dom.js') }}"></script>
<script src="{{ asset('bundles/eckinoxadminui/js/widgets/confirm.js') }}"></script>
<script src="{{ asset('bundles/eckinoxadminui/js/widgets/datatable.js') }}"></script>
<script src="{{ asset('bundles/eckinoxadminui/js/widgets/dropzone.js') }}"></script>
<script src="{{ asset('bundles/eckinoxadminui/js/widgets/modal.js') }}"></script>
<script src="{{ asset('bundles/eckinoxadminui/js/widgets/form-validate.js') }}"></script>
<script src="{{ asset('bundles/eckinoxadminui/js/modules/form-validate/additional-methods.js') }}"></script>
{% if 'fr' in app.request.locale %}
<script src="{{ asset('bundles/eckinoxadminui/js/modules/form-validate/language-fr.js') }}"></script>
{% endif %}
<script src="{{ asset('bundles/eckinoxadminui/js/main.js') }}"></script>
<script>
// Notyf
document.addEventListener("DOMContentLoaded", function() {
{% for type, flashes in app.session.flashbag.all %}
{% for flash in flashes %}
{% if flash is iterable %}
window.notyf.open({{ flash|json_encode()|raw }});
{% else %}
window.notyf.open({
type: '{{ type }}',
message: "{{ flash }}",
duration: 10000,
ripple: true,
dismissible: true,
position: {
x: 'right',
y: 'top'
}
});
{% endif %}
{% endfor %}
{% endfor %}
});
</script>
{{ generate_stacked_js() }}
{% block javascripts %}{% endblock %}
</body>
</html>