<html>
<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, shrink-to-fit=no">

<title>Stashr - {{ title }}</title>

<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/bootstrap.css') }}">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/new_base.css') }}">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/stashr.css') }}">

<link href="https://cdn.jsdelivr.net/npm/vue-toast-notification/dist/theme-sugar.css" rel="stylesheet">

<link rel="stylesheet" href="{{ url_for('static', filename='css/all.css') }}">

<link href="https://fonts.googleapis.com/css?family=Grand+Hotel" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">

<link rel="manifest" href="{{ url_for('static', filename='manifest/manifest.json') }}">

<link rel="apple-touch-icon" href="touch-icon-iphone.png">
<link rel="apple-touch-icon" sizes="152x152" href="{{ url_for('static', filename='assets/stashr-152.png') }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ url_for('static', filename='assets/stashr-180.png') }}">
<link rel="apple-touch-icon" sizes="167x167" href="{{ url_for('static', filename='assets/stashr-167.png') }}">
<meta name="apple-mobile-web-app-title" content="Stashr">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">

<script src="{{ url_for('static', filename='js/stashr.js') }}"></script>
<script src="{{ url_for('static', filename='js/vue.dev.js') }}"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-toast-notification"></script>

{% block header_script_files %}{% endblock %}
{{ emit_tep('base_page_header_script_files') }}

</head>
<body>

<div class="container-fluid d-flex min-vh-100 m-0 p-0">
    <div class="stashr-menu d-flex flex-column p-3 text-white bg-dark text-center min-vh-100 sticky-top overflow-auto" id="sideMenu" style="width:280px;">
        <div class="d-flex flex-row">
            <a class="navbar-brand" href="{{ url_for('index_page') }}">
                <img class="border rounded-circle" src="{{ url_for('static', filename='assets/stashr.svg') }}" width="40" height="40" />
                <span class="stashr-project_title">Stashr</span>
            </a>         
        </div>
        <hr/>
        <ul class="nav nav-pills flex-column mb-auto text-start">
            {% if current_user.role == 'admin' %}
			<li>
				<a class="nav-link text-white{% if request.path == url_for('settings_app_page') %} active{% endif %}" href="{{ url_for('settings_app_page') }}">
					<i class="fa fa-cogs"></i>
					Application
				</a>
			</li>
			<li>
				<a class="nav-link text-white{% if request.path == url_for('settings_directories_page') %} active{% endif %}" href="{{ url_for('settings_directories_page') }}">
					<i class="fas fa-folder"></i>
					Directories
				</a>
			</li>
			<li class="nav-item">
				<a class="nav-link text-white{% if request.path == url_for('settings_mail_page') %} active{% endif %}" href="{{ url_for('settings_mail_page') }}">
					<i class="fa fa-envelope"></i>
					Mail
				</a>
			</li>
			<li class="nav-item">
				<a class="nav-link text-white{% if request.path == url_for('settings_tasks_page') %} active{% endif %}" href="{{ url_for('settings_tasks_page') }}">
					<i class="fa fa-tasks"></i>
					Tasks
				</a>
			</li>
			<li class="nav-item">
				<a class="nav-link text-white{% if request.path == url_for('settings_all_users_page') %} active{% endif %}" href="{{ url_for('settings_all_users_page') }}">
					<i class="fa fa-users"></i>
					Users
				</a>
			</li>
			<li class="nav-item">
				<a class="nav-link text-white{% if request.path == url_for('settings_plugins_page') %} active{% endif %}" href="{{ url_for('settings_plugins_page') }}">
					<i class="fa fa-plug"></i>
					Plugins
				</a>
			</li>
			{{ emit_tep('settings_menu') }}
            {% endif %}
        </ul>
        <hr />
        <ul class="nav nav-pills d-flex flex-column text-start">
            <li>
                <a href="{{ url_for('settings_single_user_page', user_id=current_user.id) }}" class="nav-link text-white">
                    <i class="fa fa-user"></i>
                    {{ current_user.username }}
                </a>
            </li>
            {% if current_user.role == 'admin' %}
            <li>
                <a href="{{ url_for('settings_page') }}" class="nav-link text-white">
                    <i class="fas fa-cogs"></i>
                    Settings
                </a>
            </li>
            {% endif %}
            <li>
                <a href="{{ url_for('logout_page') }}" class="nav-link text-white">
                    <i class="fas fa-sign-out-alt"></i>
                    Logout
                </a>
            </li>
        </ul>
    </div>
    <div class="d-flex flex-column w-100 m-0 px-0 min-vh-100 overflow-auto bg-light">

        <!-- v HEADER v -->
        <!-- ^ HEADER ^ -->

        <!-- v CONTENT v -->
        {% block settings_pane %}{% endblock %}
        <!-- ^ CONTENT ^ -->

        <!-- v BUTTON CONTAINER v -->
        <div class="stashr-button_container p-2">
        
        </div>

        <div class="stashr-menu_button_container p-2">
            
        </div>
        <div class="d-flex w-100 stashr-footer p-2 new-stashr-button_container">
            <button type="button" class="btn btn-info btn-circle btn-md d-md-none" data-bs-toggle="tooltip" data-bs-placement="top" title="Add Volume from Comicvine" onclick="toggleMenu()">
                <i class="fas fa-ellipsis-v fa-2x"></i>
            </button>
            {% block button_container %}{% endblock %}
        </div>
        <!-- ^ BUTTON CONTAINER ^ -->
    </div>
</div>

<!-- v MODALS v -->
{% block modals %}{% endblock %}
{{ emit_tep('base_page_modals') }}
<!-- ^ MODALS ^ -->

<!-- v FOOTER SCRIPT INCLUDES v -->
<script src="{{ url_for('static', filename='js/bootstrap.bundle.js') }}"></script>
{% block footer_script_files %}{% endblock %}
{{ emit_tep('base_page_footer_script_files') }}
<!-- ^ FOOTER SCRIPT INCLUDES ^ -->

<!-- v FOOTER SCRIPT v -->
<script type="text/javascript">

Vue.use(VueToast);

// Flashes
{% with flashes = get_flashed_messages(with_categories=true) %}
    {% if flashes %}
        {% for category, message in flashes %}
            stashrToast('{{ message }}', '{{ category }}');
        {% endfor %}
    {% endif %}
{% endwith %}

window.addEventListener("load", () => {
    if ("serviceWorker" in navigator) {
    navigator.serviceWorker.register("service-worker.js");
    }
});

{% block script %}{% endblock %}
</script>
<!-- ^ FOOTER SCRIPT ^ -->

</body>
</html>