{% extends "base.html" %}
{% load i18n %}
{% block title %}Category-Product List{% endblock %}
{% block content %}
<div class="container">
    <div class="row">

    </div>
    <br>
    <div class="row">
        <div class="col-6">
            <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
                <div class="carousel-inner">
                    <div class="carousel-item active">
                        <img src="{{ product.image.url }}" class="d-block w-100" alt="..." height="400" width="400">
                    </div>
                    {% for img in otherimages %}
                    <div class="carousel-item">
                        <img src="{{ img.image.url }}" class="d-block w-100" alt="..." height="400" width="400">
                    </div>
                    {% endfor %}
                </div>
                <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
                    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                    <span class="sr-only">Previous</span>
                </a>
                <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
                    <span class="carousel-control-next-icon" aria-hidden="true"></span>
                    <span class="sr-only">Next</span>
                </a>
            </div>
        </div>
        <div class="col-6">
            <h1>{{ product.name }}</h1>
            {% for cate in product.categorynameforproduct %}
            <h3>{{ cate }}</h3>
            {% endfor %}
            <p>{{ product.price }}</p>
            <form action="{% url "cart:cart_add" product.id %}" method="post">
                {{ cart_product_form.as_p }}
                {% csrf_token %}
                <input type="submit" value="{% trans "Add to cart" %}">
            </form>
            <hr>
            {{ product.description | linebreaks }}
        </div>
    </div>
    <hr>
    {% include "product/extraproductdetail.html" %}
</div>
{% endblock %}