<!DOCTYPE html>
<html>

<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 %}{{ page_title }}{% endblock %} - {{ config.PROJECT }}</title>

    <link rel="stylesheet" href="{{ url_for('static', filename='css/bulma.min.css') }}"/>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/fontawesome/fontawesome.min.css') }}"/>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/fontawesome/all.min.css') }}"/>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/laniakea.css') }}"/>
    {% block css %}{% endblock %}
</head>
{% block js_pre %}{% endblock %}

<body>
    <nav class="navbar is-white">
        <div class="container">
            <div class="navbar-brand">
                <a class="navbar-item brand-text" href="{{ url_for('overview.index') }}">
                {{ config.PROJECT }}
                </a>
                <div class="navbar-burger burger" data-target="navMenu">
                    <span></span>
                    <span></span>
                    <span></span>
                </div>
            </div>
            <div id="navMenu" class="navbar-menu">
                <div class="navbar-start">
                 <!-- top navbar not used at the moment -->
                </div>

            </div>
        </div>
    </nav>

    {% block container %}
    <div class="container">
        <div class="columns">
            <div class="column is-2">
                <aside class="menu">
                {% set active_menu = active_menu|default('overview') -%}

                <p class="menu-label">
                    General
                </p>
                <ul class="menu-list">
                    <li><a class="{{'is-active' if active_menu == 'overview' }}" href="{{ url_for('overview.index') }}">
                       <i class="fas fa-solar-panel"></i>
                       Overview
                    </a></li>
                </ul>

                <p class="menu-label">
                   Package Archive
                </p>
                <ul class="menu-list">
                    <li><a><i class="fas fa-snowplow"></i> Transitions</a></li>

                    <li><a class="{{'is-active' if active_menu == 'migrations' }}" href="{{ url_for('migrations.index') }}">
                        <i class="fas fa-route"></i>
                        Migrations
                    </a></li>

                    <li><a class="{{'is-active' if active_menu == 'synchronization' }}" href="{{ url_for('synchronization.index') }}">
                        <i class="fa-solid fa-down-left-and-up-right-to-center"></i>
                        Synchronization
                    </a></li>

                    <li><a class="{{'is-active' if active_menu == 'depcheck' }}" href="{{ url_for('depcheck.index') }}">
                        <i class="fas fa-puzzle-piece"></i>
                        Dependency Check
                    </a></li>

                    <li><a><i class="fas fa-seedling"></i> Package Seeds</a></li>

                    <li><a class="{{'is-active' if active_menu == 'reviewqueues' }}" href="{{ url_for('review_queues.index') }}">
                        <i class="fa-solid fa-clipboard-list"></i>
                        Review Queues
                    </a></li>
                </ul>

		<p class="menu-label">
                   Building &amp; Delivery
                </p>
                <ul class="menu-list">
                    <li><a class="{{'is-active' if active_menu == 'osimages' }}" href="{{ url_for('osimages.index') }}">
                        <i class="fas fa-sd-card"></i>
                        Disk Images
                    </a></li>

                    <li><a class="{{'is-active' if active_menu == 'jobqueue' }}" href="{{ url_for('jobs.queue', page=1) }}">
                        <i class="fas fa-tasks"></i>
                        Job Queue
                    </a></li>

                    <li><a class="{{'is-active' if active_menu == 'workers' }}" href="{{ url_for('jobs.workers') }}">
                        <i class="fas fa-server"></i>
                        Workers
                    </a></li>
                </ul>

                </aside>
            </div>
            <div class="column is-12">
                <nav class="breadcrumb" aria-label="breadcrumbs">
                    {% block breadcrumbs %}{% endblock %}
                </nav>

                {% block flash_message %}
                   {% with messages = get_flashed_messages(with_categories=True) %}
                       {% if messages %}
                           {% for category, msg in messages %}
                               <div class="alert alert-{{ category }}">
                                   {{ msg|safe }}
                               </div>
                           {% endfor %}
                        {% endif %}
                    {% endwith %}
                {% endblock %}

                {% block body_header %}{% endblock %}

                {% block body %}{% endblock %}
            </div>
            {% endblock %}
        </div>
    </div>

    <footer class="footer">
        <div class="section-legal has-text-centered">
            <p>
                <small>
                    <a href="#">Back to top</a>
                </small>
	    </p>
            <p>
                <small>
                    Powered by
                    <a href="https://github.com/lkhq/laniakea">Laniakea</a>.
                </small>
            </p>
        </div>
    </footer>

    <script src="{{ url_for('static', filename='js/jquery/jquery.slim.min.js') }}"></script>
    {% block js %}{% endblock %}
</body>

</html>
