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

{% block title %} Article {% endblock %}

{% block content %}
<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
    <h1 class="h3 mb-0 text-gray-800">Article</h1>
    <ol class="breadcrumb float-sm-right">
        <li class="breadcrumb-item">Article</li>
        <li class="breadcrumb-item">Détail</li>
    </ol>
</div>



<!-- Begin Page Content -->
<div class="container-fluid">
    
    {% include 'backend_admin/basic/notice.html.twig' %}
    
    <!-- DataTales Example -->
    <div class="card shadow mb-4">
       
        <div class="card-header py-3">
            <h6 class="m-0 font-weight-bold text-info">Détail article</h6>
        </div>
        <div class="card-body">
            
             {{ form_start(form) }}
                <div class="row g-3">

                    {{ form_errors(form) }}
                    {{ form_row(form._token) }}

                    <div class="col-8 my-3">
						{{ form_label(form.titre, 'Titre *', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-book"></i></span>
							{{ form_widget(form.titre, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.titre) }}
							</div>
						</div>
					</div>

                    <div class="col-4 my-3">
						{{ form_label(form.categorie, 'Catégorie', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-bars"></i></span>
							{{ form_widget(form.categorie, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.categorie) }}
							</div>
						</div>
					</div>


                    <div class="col-6 my-3">
						{{ form_label(form.adress, 'Adresse', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-percent"></i></span>
							{{ form_widget(form.adress, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.adress) }}
							</div>
						</div>
					</div>

                    <div class="col-5 offset-1">
						{{ form_label(form.marque, 'Marque', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-money-bill-wave"></i></span>
							{{ form_widget(form.marque, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.marque) }}
							</div>
						</div>
					</div>

                    <div class="col-5 my-3">
						{{ form_label(form.prix_promo, 'Prix promo *', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-money-bill-wave"></i></span>
							{{ form_widget(form.prix_promo, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.prix_promo) }}
							</div>
						</div>
					</div>

                    <div class="col-5 offset-1">
						{{ form_label(form.prix_marche, 'Prix du marché', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-money-bill-1"></i></span>
							{{ form_widget(form.prix_marche, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.prix_marche) }}
							</div>
						</div>
					</div>
					
                    <div class="col-8 my-3">
						{{ form_label(form.societe, 'Société *', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-building"></i></span>
							{{ form_widget(form.societe, {'attr': {'class': 'form-control select-filter select2bs4 select-filter-speaker'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.societe) }}
							</div>
						</div>
					</div>

					<div class="row my-3">

						<div class="col-3">
							{{ form_label(form.limit_type, 'Limitation par', {'attr': {'class': 'form-check-input'}}) }}
							{% for key,child in form.limit_type %}
								<div class="form-check">
									{{ form_widget(child, {'attr': {'class': 'form-check-input'}} ) }}
									{{ form_label(child) }}
								</div>
							{% endfor %}
						</div>
						
						<div class="col-3" id="article-limita-date" {% if article.getLimitType()== 1 %} style="display:none" {% endif %}>
							{{ form_label(form.limit_date, 'Limitation  Par Date', {'attr': {'class': 'form-label'}}) }}
							<div class="input-group">
								<span class="input-group-text"><i class="fa-solid fa-percent"></i></span>
								{{ form_widget(form.limit_date, {'attr': {'class': 'form-control'}}) }}
								<div class="invalid-feedback">
									{{ form_errors(form.limit_date) }}
								</div>
							</div>
						</div>

						<div class="col-3" id="article-limita-quanti" {% if article.getLimitType()== 0 %} style="display:none" {% endif %}>
							{{ form_label(form.limit_quantite, 'Limitation  Par Quantité', {'attr': {'class': 'form-label'}}) }}
							<div class="input-group">
								<span class="input-group-text"><i class="fa-solid fa-percent"></i></span>
								{{ form_widget(form.limit_quantite, {'attr': {'class': 'form-control'}}) }}
								<div class="invalid-feedback">
									{{ form_errors(form.limit_quantite) }}
								</div>
							</div>
						</div>
						
					</div>

                    
                    <div class="col-12 my-3">
                            {{ form_label(form.description, 'Déscription *', {'attr': {'class': 'form-label'}}) }}
                            {{ form_widget(form.description, {'attr': {'class': 'form-control'}}) }}
                            <div class="invalid-feedback">{{ form_errors(form.description) }}</div>
                        </div>

                    <hr class="my-4">
                    {{ form_widget(form.save, {'label': "Enregister", 'attr': {'class': 'w-90 btn btn-primary btn-lg'}}) }}
						

                </div>

            {{ form_end(form) }}

        </div>
    </div>
</div>
{% endblock %}

{% block javascripts %}
    {{ parent() }}
    {{ encore_entry_script_tags('app_backend_article_service') }}
{% endblock %}