{# Source code of the Ubuntu-it website
 # Copyright (C) 2015  Pietro Albini <pietroalbini@ubuntu.com>
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU Affero 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; witout even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU Affero General Public License for more details.
 #
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #}

{% from "macros.html" import nav_item with context %}

<!DOCTYPE html>
<html lang="en" dir="ltr">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>{% block title %}Senza titolo{% endblock %} - Ubuntu-it</title>

    <link rel="stylesheet" href="{{ url_for("static", filename="website.css") }}" />
    <script type="text/javascript" src="{{ url_for("static", filename="website.js") }}"></script>
</head>

<body {% block extra_body %}{% endblock %}>
    <header class="banner global" role="banner">
        <nav role="navigation" class="nav-primary nav-right" id="nav">
            <span id="main-navigation-link"><a href="#main-navigation">Jump to site nav</a></span>
            <div class="logo">
                <a href="{{ url_for("pages.index") }}">ubuntu-it</a>
                {# Used <ol> so it won't be styled #}
                <div class="website-selector">
                    <ol>
                        <li><a href="http://www.ubuntu-it.org" class="active">Sito web</a></li>
                        <li><a href="http://wiki.ubuntu-it.org">Documentazione e wiki</a></li>
                        <li><a href="http://forum.ubuntu-it.org">Forum</a></li>
                        <li><a href="http://chiedi.ubuntu-it.org">Domande e risposte</a></li>
                        <li><a href="http://chat.ubuntu-it.org">Chat IRC</a></li>
                        <li><a href="http://cerca.ubuntu-it.org">Ricerca</a></li>
                        <li><a href="http://planet.ubuntu-it.org">Planet della comunità</a></li>
                        <li class="website-selector-footer">
                            <a class="social facebook" href="https://www.facebook.com/ubuntu.it"></a>
                            <a class="social twitter" href="https://twitter.com/ubuntuit"></a>
                            <a class="social gplus" href="https://plus.google.com/+ubuntuit"></a>
                            <a class="social youtube" href="https://www.youtube.com/ubuntuitpromozione"></a>
                        </li>
                    </ol>
                </div>
            </div>
            <ul>
                {% for item in _navbar[0] %}
                    {{ nav_item(item) }}
                {% endfor %}
            </ul>
        </nav>
        <div class="nav-toggle">
            <a href="#nav" class="nav-toggle__link open"></a>
            <a href="#" class="nav-toggle__link close"></a>
        </div>
    </header>
    <header class="banner inverted">
        <nav role="navigation" class="nav-primary nav-right" id="subnav">
            <ul>
                {% for item in _navbar[1] %}
                    {{ nav_item(item) }}
                {% endfor %}
            </ul>
        </nav>
    </header>
    <div class="wrapper">
        <div id="main-content" class="inner-wrapper">
            {% if _navbar|length >= 3 %}
            <nav class="nav-secondary clearfix">
                <ul class="breadcrumb">
                    <li>
                        <a href="{{ url_for(_navbar_active[1].endpoint) }}"
                           class="breadcrumb-link">
                            {{ _navbar_active[1].name }}
                        </a>
                    </li>
                </ul>
                <ul class="second-level-nav">
                    {% for item in _navbar[2] %}
                        {{ nav_item(item) }}
                    {% endfor %}
                </ul>
            </nav>
            {% endif %}
            {% block content %}{% endblock %}
        </div>
    </div>
    <footer class="global clearfix no-global">
        <nav class="nav-footer">
            {% for category in _navbar[0] %}
                <div>
                    <h2><a href="{{ url_for(category.endpoint) }}">{{ category.name }}</a></h2>
                    {% if "subs" in category %}
                        <ul>
                            {% for item in category.subs %}
                                {{ nav_item(item) }}
                            {% endfor %}
                        </ul>
                    {% endif %}
                </div>
            {% endfor %}
        </nav>
        <hr>
        <nav id="main-navigation" role="navigation" class="clearfix">
            <div class="legal clearfix">
                <p class="twelve-col">
                    Ubuntu e Canonical sono marchi registrati da Canonical Ltd.<br>
                    Sito realizzato con &#9829; dal Gruppo Web di Ubuntu-it, con
                    <a href="https://www.python.org/">Python</a>,
                    <a href="http://flask.pocoo.org/">Flask</a> e
                    <a href="http://www.postgresql.org/">PostgreSQL</a>.
                </p>
                <ul class="inline-list clear">
                    <li><a href="{{ url_for("pages.cookies") }}"><small>Informativa sui cookie</small></a></li>
                    <li><a href="http://code.ubuntu-it.org/ubuntu-it-web/www/issues">
                        <small>Segnala un errore</small>
                    </a></li>
                    <li><a href="http://code.ubuntu-it.org/ubuntu-it-web/www">
                        <small>Scarica il codice</small>
                    </a></li>
                    <li><a href="http://wiki.ubuntu-it.org/GruppoWeb">
                        <small>Collabora con noi</small>
                    </a></li>
                </ul>
                <span class="accessibility-aid"><a href="#">Got to the top of the page</a></span>
            </div>
        </nav>
    </footer>
</body>

</html>
