{#
    /**
     * This file is part of FacturaScripts
     * Copyright (C) 2017-2020 Carlos Garcia Gomez <carlos@facturascripts.com>
     *
     * This program is free software: you can redistribute it and/or modify
     * it under the terms of the GNU Lesser General Public License as
     * published by the Free Software Foundation, either version 3 of the
     * License, or (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     * GNU Lesser General Public License for more details.
     *
     * You should have received a copy of the GNU Lesser General Public License
     * along with this program. If not, see http://www.gnu.org/licenses/.
     */
#}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ constant('FS_LANG') | slice(0, 2) }}" xml:lang="{{ constant('FS_LANG') | slice(0, 2) }}" >
    <head>
        {% block meta %}
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <title>{{ fsc.title | raw }}</title>
            <meta name="description" content="{{ i18n.trans('meta-description') }}" />
            <meta name="viewport" content="width=device-width, initial-scale=1.0" />
            <meta name="generator" content="FacturaScripts" />
            <meta name="robots" content="noindex" />
        {% endblock %}
        {% block icons %}
            <link rel="shortcut icon" href="{{ asset('Dinamic/Assets/Images/favicon.ico') }}" />
            <link rel="apple-touch-icon" sizes="180x180" href="{{ asset('Dinamic/Assets/Images/apple-icon-180x180.png') }}" />
        {% endblock %}
        {% block css %}
            <link rel="stylesheet" href="{{ asset('node_modules/bootstrap/dist/css/bootstrap.min.css') }}" />
            <link rel="stylesheet" href="{{ asset('node_modules/@fortawesome/fontawesome-free/css/all.min.css') }}" />
            <link rel="stylesheet" href="{{ asset('node_modules/jquery-ui-dist/jquery-ui.min.css') }}" />
            <link rel="stylesheet" href="{{ asset('Dinamic/Assets/CSS/custom.css') }}" />
        {% endblock %}
        {# Adds custom CSS assets #}
        {% for css in assetManager.get('css') %}
            <link rel="stylesheet" href="{{ css }}" />
        {% endfor %}
        {% block javascripts %}
            <script src="{{ asset('node_modules/jquery/dist/jquery.min.js') }}"></script>
            <script src="{{ asset('node_modules/bootstrap/dist/js/bootstrap.bundle.min.js') }}"></script>
            <script src="{{ asset('node_modules/bootbox/dist/bootbox.min.js') }}"></script>
            <script src="{{ asset('node_modules/bootbox/dist/bootbox.locales.min.js') }}"></script>
            <script src="{{ asset('node_modules/jquery-ui-dist/jquery-ui.min.js') }}"></script>
            <script src="{{ asset('node_modules/pace-js/pace.min.js') }}"></script>
            <script src="{{ asset('Dinamic/Assets/JS/Custom.js') }}"></script>
        {% endblock %}
        {# Adds custom JS assets #}
        {% for js in assetManager.get('js') %}
            <script src="{{ js }}"></script>
        {% endfor %}
        {{ debugBarRender.renderHead() | raw }}
    </head>
    {% block fullBody %}
        <body>
            {% block navbar %}
                <nav class="navbar navbar-expand navbar-dark bg-dark sticky-top d-print-none">
                    {% block navbarContent %}
                        <a class="navbar-brand d-none d-sm-inline" href="{{ asset('') }}" title="{{ i18n.trans('homepage') }}">
                            <img src="{{ asset('Dinamic/Assets/Images/logo-white.png') }}" width="30" height="30" class="d-inline-block align-top" alt="FacturaScripts"/>
                            <span class="d-none d-xl-inline">{{ fsc.empresa.nombrecorto | raw }}</span>
                        </a>
                        <div class="navbar-collapse collapse">
                            <ul class="navbar-nav pt-1">
                                {% import 'Macro/Menu.html.twig' as macros %}
                                {% for menuItem in menuManager.getMenu() %}
                                    {{ macros.showMenu(menuItem) }}
                                {% endfor %}
                            </ul>
                            <ul class="navbar-nav flex-row ml-auto">
                                <li class="nav-item{{ template == 'MegaSearch.html.twig' ? ' active' : '' }}" title="{{ i18n.trans('search') }}">
                                    <a class="nav-link" href="MegaSearch">
                                        <i class="fas fa-search" aria-hidden="true"></i>
                                    </a>
                                </li>
                                <li class="nav-item" title="{{ i18n.trans('help') }}">
                                    <a class="nav-link" href="https://facturascripts.com/ayuda" target="_blank">
                                        <i class="fas fa-question-circle" aria-hidden="true"></i>
                                    </a>
                                </li>
                                <li class="nav-item dropdown" title="{{ i18n.trans('user') }}">
                                    <a class="nav-link dropdown-toggle mr-md-2" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                        <i class="fas fa-user-circle fa-fw" aria-hidden="true"></i>
                                    </a>
                                    <div class="dropdown-menu dropdown-menu-right" aria-labelledby="user-list">
                                        <a class="dropdown-item" href="{{ fsc.user.url() }}">
                                            <i class="fas fa-user-circle fa-fw" aria-hidden="true"></i> {{ fsc.user.nick }}
                                        </a>
                                        <div class="dropdown-divider"></div>
                                        <a class="dropdown-item" href="?logout=TRUE">
                                            <i class="fas fa-door-open fa-fw" aria-hidden="true"></i> {{ i18n.trans('logout') }}
                                        </a>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    {% endblock %}
                </nav>
            {% endblock %}
            <div class="bg-header pt-3">
                {% block messages %}
                    {% from 'Macro/Utils.html.twig' import message as showMessage %}
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-12">
                                {{ showMessage(log, ['error', 'critical'], 'danger') }}
                                {{ showMessage(log, ['warning'], 'warning') }}
                                {{ showMessage(log, ['notice'], 'success') }}
                                {{ showMessage(log, ['info'], 'info') }}
                            </div>
                        </div>
                    </div>
                {% endblock %}
                {% block bodyHeaderOptions %}
                {% endblock %}
            </div>
            {% block body %}
            {% endblock %}
            <br/>
            <br/>
            <br/>
            {{ debugBarRender.render() | raw }}
        </body>
    {% endblock %}
</html>