<!doctype html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="description" content="Xefir's animes search engine (っ^‿^)っ">
    <title>PyNyaaTa - {% block title %}{% endblock %}</title>
    <link rel="icon" href="{{ url_for('static', filename='favicons/favicon.ico') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/bulma.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/bulma-tooltip.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/font-awesome.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
</head>
<body>

<nav class="navbar is-dark" role="navigation" aria-label="main navigation">
    <div class="navbar-start">
        <a class="navbar-item has-tooltip-bottom has-tooltip-hidden-desktop" data-tooltip="Home" href="{{ url_for('home') }}">
            π 😼た
        </a>
        <a class="navbar-item has-tooltip-bottom has-tooltip-hidden-desktop" data-tooltip="Latest torrents" href="{{ url_for('latest') }}">
            <i class="fa fa-newspaper-o"></i><i>&nbsp;</i>
            <span class="is-hidden-mobile">Latest torrents</span>
        </a>
        {% if not mysql_disabled %}
            <a class="navbar-item has-tooltip-bottom has-tooltip-hidden-desktop" data-tooltip="My seeded torrents"
               href="{{ url_for('list_animes') }}">
                <i class="fa fa-cloud-download"></i><i>&nbsp;</i>
                <span class="is-hidden-mobile">My seeded torrents</span>
            </a>
        {% endif %}
        {% block add_button %}{% endblock %}
        {% if request.args.get('q') %}
            <a class="navbar-item has-tooltip-bottom has-tooltip-hidden-desktop" data-tooltip="TVDB"
               href="https://www.thetvdb.com/search?menu%5Btype%5D=TV&query={{ request.args.get('q') }}"
               target="_blank">
                <i class="fa fa-television"></i><i>&nbsp;</i>
                <span class="is-hidden-mobile">TVDB</span>
            </a>
            <a class="navbar-item has-tooltip-bottom has-tooltip-hidden-desktop" data-tooltip="Nautiljon"
               href="https://www.nautiljon.com/search.php?q={{ request.args.get('q') }}" target="_blank">
                <i class="fa fa-rss"></i><i>&nbsp;</i>
                <span class="is-hidden-mobile">Nautiljon</span>
            </a>
        {% endif %}
    </div>
    <div class="navbar-end">
        <form action="{{ url_for('search') }}" class="navbar-item">
            <div class="field has-addons">
                <div class="control">
                    {{ search_form.q(placeholder='Search ...', class='input', value=request.args.get('q', '')) }}
                </div>
                <div class="control">
                    <button type="submit" class="button is-info">
                        <i class="fa fa-search"></i>
                    </button>
                </div>
            </div>
        </form>
    </div>
</nav>

<section class="section" role="main">
    {% if action_form %}
        {% if action_form.errors %}
            <div class="notification is-danger">
                <button class="delete" onclick="this.parentNode.style.display = 'none'"></button>
                <ul>
                    {% for field in action_form.errors %}
                        {% for error in action_form.errors[field] %}
                            <li>"{{ field }}" => {{ error }}</li>
                        {% endfor %}
                    {% endfor %}
                </ul>
            </div>
        {% endif %}
        {% if action_form.message %}
            <div class="notification is-success">
                <button class="delete" onclick="this.parentNode.style.display = 'none'"></button>
                {{ action_form.message }}
            </div>
        {% endif %}
    {% endif %}

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

</body>
</html>