<!DOCTYPE html>
<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <link href='{{ url_for("static", filename="anno.css") }}' rel='stylesheet'/>
    <script src='{{ url_for("static", filename="anno.js") }}'></script>
    {% if title != 'Anno' %}
        <title>Anno - {{ title }}</title>
    {% else %}
        <title>{{ title }}</title>
    {% endif %}
</head>
<body id='index-page'>
    {% include 'flashes.html' %}
    {% if show_home_btn %}
        <div class='nav-wrapper'>
            <div class='nav content'>
                <a href='/' class='btn'>Home</a>
            </div>
        </div>
    {% else %}
        <div class='nav-wrapper'>
            <div class='nav content'>
                <div class='controls'>
                    <a href='/new' class='btn'>Create note</a>
                    <form action='/search' method='post' id='search_form'>
                        <input type='text' name='search_text' id='search_text' placeholder='Search...'>
                        <input type='submit' class='btn' value='Go'>
                    </form>
                </div>
            </div>
        </div>
    {% endif %}
    <div class='title-wrapper'>
        <div class='content'>
            <h1>{{ title }}</h1>
        </div>
    </div>
    <div class='content'>
        {% if notes %}
            <table>
            {% for item in notes %}
                <tr>
                    <td class='date'>{{ item.date | date_to_string }}</td>
                    <td class='title'>
                        <a href='/{{ item.url }}'>{{ item.title }}</a>
                    </td>
                    {% if item.labels %}
                        <td class='labels'>
                            {% for label in item.labels %}
                                <a class='label {{ label }}' href='/label/{{ label }}'>{{ label }}</a>
                            {% endfor %}
                        </td>
                    {% else %}
                        <td></td>
                    {% endif %}
                </tr>
            {% endfor %}
            </table>
        {% else %}
            {{ no_notes_msg }}
        {% endif %}
    </div>
</body>
</html>