{% extends "web/_base.html" %}
{% block navbar_left %}
    {{ block.super }}
    {% include "web/_collection-menu.html" with collection=collection only %}
{% endblock %}
{% block title %}Search collection {{ collection.name }}{% endblock %}
{% block content %}
    <h1>Search {{ collection.name }} {{ collection.category }} collection</h1>
    <form method="get" action=".">
        {{ form.as_p }}
        <button type="submit" class="btn btn-primary">Search</button>
    </form>
    {% if item_list %}
        <table class="table table-sm">
            <thead>
                <tr>
                    <th>
                        Category
                        {% include "web/_order.html" with name="category" order=order asc=asc only %}
                    </th>
                    <th>
                        Name
                        {% include "web/_order.html" with name="name" order=order asc=asc only %}
                    </th>
                </tr>
            </thead>
            <tbody>
                {% for item in item_list %}
                    <tr>
                        <td>{{ item.category }}</td>
                        <td>{{ item.name }}</td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        <p>No results.</p>
    {% endif %}
    {% include "web/_pagination.html" %}
{% endblock %}
