{% extends 'base_frontend.html.twig' %}

{% block title %}  Détail Article  {% endblock %}

{% block content %}
<!-- ============================================== HEADER : END ============================================== -->
<div class="breadcrumb">
    <div class="breadcrumb-inner">
        <ul class="list-inline list-unstyled">
            <li><a href="{{ path('frontend_home_index') }}">Accueil</a></li>
            <li><a href="{{ path('frontend_article_service_index') }}">Article et Service</a></li>
            <li class="active">Détail Article</li>
        </ul>
    </div>
</div>

{% include 'frontend/basic/alert.html.twig' %}
<style>
    .img-resp{
        max-width: 402px;
        max-height: 380px;
    }
</style>

<!-- /.breadcrumb -->
<div class="body-content outer-bottom-xs">
    <div class='row single-product'>
        <!-- ============================================== Testimonials: END ============================================== -->
        <!-- /.sidebar -->
        <div class="detail-block">
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 gallery-holder">
                    <div class="product-item-holder size-big single-product-gallery small-gallery">
                        <div id="owl-single-product">
                            <!-- /.single-product-gallery-item -->
                            {% for key,image in article.getAllImage() %}
                                <div class="single-product-gallery-item" id="slide{{key}}">
                                    <a data-lightbox="image-{{key}}" data-title="Gallery" href="{{ asset('uploads/images/articles/' ~ image ) }}">
                                        <img class="img-responsive img-resp" alt="" src="{{ asset('uploads/images/articles/' ~ image) }}" data-echo="{{ asset('uploads/images/articles/' ~ image ) }}" />
                                    </a>
                                </div>
                            {% endfor %}
                            <!-- /.single-product-gallery-item -->
                        </div>
                        <!-- /.single-product-slider -->
                        <div class="single-product-gallery-thumbs gallery-thumbs">
                            <div id="owl-single-product-thumbnails">
                                {% for key,image in article.getAllImage() %}
                                    <div class="item {% if key == 1 %} active {% endif %}">
                                        <a class="horizontal-thumb" data-target="#owl-single-product" data-slide="{{ key }}" href="#slide{{ key }}">
                                            <img class="img-responsive" alt="" src="{{ asset('uploads/images/articles/' ~ image) }}" data-echo="{{ asset('uploads/images/articles/' ~ image) }}" />
                                        </a>
                                    </div>
                                {% endfor %}
                            </div>
                            <!-- /#owl-single-product-thumbnails -->
                        </div>
                        <!-- /.gallery-thumbs -->
                    </div>
                    <!-- /.single-product-gallery -->
                </div>
                <!-- /.gallery-holder -->   
                <div class='col-sm-12 col-md-8 col-lg-8 product-info-block'>
                    <div class="product-info">
                        <h1 class="name">{{ article.getTitre() }}</h1>
                        <div class="rating-reviews m-t-20">
                            <div class="row">
                                <div class="col-lg-12">
                                    <div class="pull-left">
                                        <div class="rating rateit-small"></div>
                                    </div>
                                    <div class="pull-left">
                                        <div class="reviews">
                                            <a href="#" class="lnk">(13 Reviews)</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- /.row -->		
                        </div>
                        <!-- /.rating-reviews -->
                        <div class="stock-container info-container m-t-10">
                            <div class="row">
                                <div class="col-lg-12">
                                    <div class="pull-left">
                                        <div class="stock-box">
                                            <span class="label">Exemplaire(s) en Stock: </span>
                                        </div>
                                    </div>
                                    <div class="pull-left">
                                        <div class="stock-box">
                                            <span class="value">{{ article.getLimitQuantite() }}</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- /.row -->	
                        </div>
                        <!-- /.stock-container -->
                        <div class="price-container info-container m-t-30">
                            <div class="row">
                                <div class="col-sm-6 col-xs-6">
                                    <div class="price-box">
                                        <span class="price">{{ article.getPrixPromo() }} DT</span>
                                        <span class="price-strike">{{ article.getPrixMarche() }} DT</span>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-xs-6">
                                    <div class="favorite-button m-t-5">
                                        <a class="btn btn-primary" data-toggle="tooltip" data-placement="right" title="Wishlist" href="#">
                                            <i class="fa fa-heart"></i>
                                        </a>
                                        <a class="btn btn-primary" data-toggle="tooltip" data-placement="right" title="E-mail" href="#">
                                            <i class="fa fa-envelope"></i>
                                        </a>
                                    </div>
                                </div>
                            </div>
                            <!-- /.row -->
                        </div>
                        <!-- /.price-container -->
                        <div class="quantity-container info-container">
                            <div class="row">
                                <div class="qty">
                                    <span class="label">Qty :</span>
                                </div>
                                <div class="qty-count">
                                    <div class="cart-quantity">
                                        <div class="quant-input">
                                            <div class="arrows">
                                                <div class="arrow plus gradient" id="qty-asc"><span class="ir"><i class="icon fa fa-sort-asc"></i></span></div>
                                                <div class="arrow minus gradient" id="qty-desc"><span class="ir"><i class="icon fa fa-sort-desc"></i></span></div>
                                            </div>
                                            <input type="text" value="1" id="qty-val">
                                        </div>
                                    </div>
                                </div>
                                <div class="add-btn">
                                    <button class="btn btn-primary" id="addPanier">
                                        <i class="fa fa-shopping-cart inner-right-vs"></i> 
                                        Ajouter au panier
                                    </button>
                                </div>
                            </div>
                            <!-- /.row -->
                        </div>
                        <!-- /.quantity-container -->
                    </div>
                    <!-- /.product-info -->
                </div>
                <!-- /.col-sm-7 -->
            </div>
            <!-- /.row -->
        </div>
    </div>
    <!-- /.row -->
</div>
<!-- /.body-content -->


 <!-- /.description-container -->
<div class="blog-page">
    <div class="blog-review wow fadeInUp">
        <div class="row">
            <div class="col-md-12">
                <div class="description-container m-t-20">
                    {{ article.getDescription()|raw }}
                   
                </div>
            </div>
        </div>
    </div>
</div>
<br><br>

{% set comments = article.getCommentArticles() %}
{% include 'frontend/comment/comments.html.twig' %}

{{ render(controller(
        'App\\Controller\\Frontend\\CommentController::article_add',
        { 'id': article.getId() }
    )) }}		

{% endblock %}

{% block javascripts %}
    <script>
        var pathAddArticlePanier = "{{ path('frontend_panier_add_article', {id: article.id }) }}";
    </script>
    {{ parent() }}
    {{ encore_entry_script_tags('app_frontend_article_service') }}
{% endblock %}