{% extends 'tournaments/base.html' %}

{% block head_title %}La Boutique{% endblock %}
{% block first_title %}Padel Club{% endblock %}
{% block second_title %}La Boutique{% endblock %}

{% block content %}

<nav class="margin10">
    <a href="{% url 'shop:product_list' %}">La Boutique</a>
    <a href="{% url 'index' %}" class="orange">Accueil</a>
    <a href="{% url 'clubs' %}" class="orange">Clubs</a>
    {% if user.is_authenticated %}
        <a href="{% url 'my-tournaments' %}" class="orange">Mes tournois</a>
        <a href="{% url 'profile' %}">Mon compte</a>
    {% else %}
        <a href="{% url 'login' %}">Se connecter</a>
    {% endif %}
</nav>

<nav class="margin10">
    <a class="confirm-nav-button" href="{% url 'shop:view_cart' %}">Voir mon panier ({{ total }} €)</a>
    {% if cart_items %}
        <a class="cancel-nav-button" href="{% url 'shop:clear_cart' %}" onclick="return confirm('Êtes-vous sûr de vouloir supprimer votre panier ?');">Vider le panier</a>
    {% endif %}

</nav>

{% if products %}
<div class="grid-x">
    {% for product in products %}
        {% include "shop/product_item.html" with product=product %}
    {% endfor %}
</div>
{% else %}
<p>No products available.</p>
{% endif %}
</div>
{% endblock %}
