{# -*- engine:django -*- #}

{#{% load i18n menu_generator static sass_tags any_js fav_tags rules %}#}
{% load i18n static sass_tags favtags any_js %}
{% get_current_language as LANGUAGE_CODE %}


<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width,initial-scale=1"/>
    <meta name="description" content="{{ request.site.preferences.general__description }}"/>
    <meta name="generator" content="InfraBlue BigBlueButton Frontend"/>

    {% place_favicon %}

    <title>
        {% block no_browser_title %}
            {% block browser_title %}{% endblock %} —
        {% endblock %}
        {{ request.site.preferences.general__title }}
    </title>

    {# CSS #}
    {% include_css "material-design-icons" %}
    <link rel="stylesheet" href="{% sass_src 'style.scss' %}">

    {# Include jQuery early to provide $(document).ready #}
    {% include_js "jQuery" %}

    {% block extra_head %}{% endblock %}
</head>
<body>

<header>
    <!-- Menu button (sidenav) -->
    <div class="container">
        <a href="#" data-target="slide-out" class="top-nav sidenav-trigger hide-on-large-only">
            <i class="material-icons">menu</i>
        </a>
    </div>

    <!-- Nav bar (logged in as, logout) -->
    <nav>
        <a class="brand-logo" href="/">{{ request.site.preferences.general__title }}</a>

        <div class="nav-wrapper">
            <ul id="nav-mobile" class="right hide-on-med-and-down">
                {% if user.is_authenticated %}
                    <li>{% trans "Logged in as" %} {{ user.get_username }}</li>
                    <li>
                        <a href="{% url 'logout' %}">{% trans "Logout" %} <i
                                class="material-icons right">exit_to_app</i></a>
                    </li>
                {% endif %}
            </ul>
        </div>
    </nav>

        <!-- Main nav (sidenav) -->
        <ul id="slide-out" class="sidenav sidenav-fixed">
            <li class="logo">
                {% static "img/infrablue-banner.svg" as infrablue_banner %}
                <a id="logo-container" href="/" class="brand-logo">
                    <img src="{% firstof request.site.preferences.theme__logo.url infrablue_banner %}"
                         alt="{{ request.site.preferences.general__title }} – Logo">
                </a>
            </li>
            <li class="no-padding">
                {% include "infrablue/sidenav.html" %}
            </li>
        </ul>
</header>


<main role="main">
    {#    {% include 'core/no_person.html' %}#}

    {% if messages %}
        {% for message in messages %}
            <div class="alert {% if message.tags %}{{ message.tags }}{% else %}info{% endif %}">
                <p>
                    {% if message.tags == "success" %}
                        <i class="material-icons left">check_circle</i>
                    {% elif  message.tags == "info" %}
                        <i class="material-icons left">info</i>
                    {% elif  message.tags == "warning" %}
                        <i class="material-icons left">warning</i>
                    {% elif  message.tags == "error" %}
                        <i class="material-icons left">error</i>
                    {% endif %}
                    {{ message }}
                </p>
            </div>
        {% endfor %}
    {% endif %}

    {% block no_page_title %}
        <h4>{% block page_title %}{% endblock %}</h4>
    {% endblock %}

    {% block content %}{% endblock %}
</main>


<footer class="page-footer">
    <div class="container">
        <div class="row no-margin footer-row-large">
            <div class="col l6 s12 no-pad-left height-inherit">
                <p class="white-text valign-bot">
                    {#                    {% include 'core/language_form.html' %}#}

                </p>
            </div>
            <div class="col xl15 l6 offset-xl01 s12 no-pad-right">
                <ul class="no-margin right">
                    {#                    {% include "core/footer-menu.html" %}#}
                </ul>
            </div>
        </div>
        <div class="row no-margin footer-row-small">
            <span class="white-text make-it-higher">
{#  {% include 'core/language_form.html' %}#}

            </span>
            <ul class="no-margin footer-ul">
                {#                {% include "core/footer-menu.html" %}#}
            </ul>
        </div>
    </div>
    <div class="footer-copyright">
        <div class="container">
            <div class="left">
                {#                <a class="blue-text text-lighten-4" href="{% url "about_infrablue" %}">#}
                {% trans "About InfraBlue" %}
                {#                </a>#}
                © The InfraBlue Team
            </div>
            <div class="right">
                <span id="doit"></span>
                {% if request.site.preferences.footer__impress_url %}
                    <a class="blue-text text-lighten-4" href="{{ request.site.preferences.footer__impress_url }}">
                        {% trans "Impress" %}
                    </a>
                {% endif %}
                {% if request.site.preferences.footer__privacy_url and request.site.preferences.footer__impress_url %}
                    ·
                {% endif %}
                {% if request.site.preferences.footer__privacy_url %}
                    <a class="blue-text text-lighten-4" href="{{ request.site.preferences.footer__privacy_url }}">
                        {% trans "Privacy Policy" %}
                    </a>
                {% endif %}
            </div>
        </div>
    </div>
</footer>


{% include_js "materialize" %}
<script type="text/javascript" src="{% static 'js/main.js' %}"></script>
</body>
</html>
