{% extends 'base.html' %}

{% block content %}
<main class="container mx-auto w-full px-4 my-8 flex-1">
    <h1 class="page-title">Suchen</h1>
    <div class="sm:flex sm:flex-row-reverse justify-center text-gray-700 dark:text-gray-200">

        <form method="get" action=".">
            <table>
                {{ form.as_table }}
                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <input type="submit" value="Search">
                    </td>
                </tr>
            </table>

            {% if object_list %}
                <h3>Results</h3>

                {% for result in object_list %}
                    <p>
                        <a href="{{ result.get_absolute_url }}">{{ result.date|date }}: {{ result.title }}</a>
                    </p>
                {% empty %}
                    <p>No results found.</p>
                {% endfor %}
            {% endif %}
        </form>
    </div>
</main>
{% endblock %}
