{% extends "base.html" %}
{% block content %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Результаты поиска</title>
</head>
<body>
    <h1>Результаты поиска</h1>

    <form method="get" action="{% url 'search' %}">
        {{ form.as_p }}
        <button type="submit">Поиск</button>
    </form>

    {% if results %}
        <ul>
            {% for product in results %}
                <li>{{ product.name }}</li>
            {% endfor %}
        </ul>
    {% else %}
        <p>Нет такого результата поиска.</p>
    {% endif %}
</body>
</html>
{% endblock %}