{% extends 'admin/layouts/base.html.twig' %}

{% block title %}Admin - {{ app.user ? app.user.username : company_name }} - {{ title }} {% endblock %}
{% block pageheader %}
    <div class="page-header page-header-light">
        <div class="page-header-content header-elements-md-inline">
            <div class="page-title d-flex">
                <h4><i class="icon-users mr-2"></i>
                    <span class="font-weight-semibold">{{ proprietaire.name }}</span>
                </h4>
                <a href="javascript:" class="header-elements-toggle text-default d-md-none">
                    <i class="icon-more"></i>
                </a>
            </div>
            <div class="header-elements d-none">
                <div class="d-flex justify-content-center">
                    <a href="javascript:"
                       data-toggle="modal" data-target="#new-items" class="btn btn-warning btn-sm btn-icon mr-2">
                        <i data-toggle="tooltip" title="Nouvelle commande" class="icon-cart-add"></i>
                    </a>
                    <a data-toggle="tooltip" title="{{ libelle_liste }}"
                       href="{{ path('admin.acteurs.proprietaires.index') }}"
                       class="btn btn-primary btn-sm btn-icon mr-2">
                        <i class="icon-list"></i>
                    </a>
                    <a data-toggle="tooltip" title="Editer la fiche de l'employé"
                       href="{{ path('admin.acteurs.proprietaires.edit', {'id': proprietaire.id}) }}"
                       class="btn btn-info btn-sm btn-icon mr-2">
                        <i class="icon-pencil5"></i>
                    </a>
                    <a data-toggle="tooltip" title="{{ libelle_ajouter}}"
                       href="{{ path('admin.acteurs.proprietaires.new') }}" class="btn btn-success btn-sm btn-icon">
                        <i class="icon-user-plus"></i>
                    </a>
                </div>
            </div>
        </div>

        <div class="breadcrumb-line breadcrumb-line-light header-elements-md-inline">
            {{ fil_arial(title, 'Fournisseurs') }}
        </div>
    </div>
{% endblock %}
{% block body %}
    <!-- Profile navigation -->
    <div class="navbar navbar-expand-lg navbar-light rounded mb-3">
        <div class="text-center d-lg-none w-100">
            <button type="button" class="navbar-toggler dropdown-toggle" data-toggle="collapse" data-target="#navbar-second">
                <i class="icon-menu7 mr-2"></i>
                Profile navigation
            </button>
        </div>

        <div class="navbar-collapse collapse" id="navbar-second">
            <ul class="nav navbar-nav">
                <li class="nav-item">
                    <a href="#informations" class="navbar-nav-link active" data-toggle="tab">
                        <i class="icon-cart-add2 mr-2"></i>
                        Informations
                    </a>
                </li>
            </ul>

            <ul class="navbar-nav ml-lg-auto">
                <li class="nav-item">
                    <a href="#" class="navbar-nav-link dropdown-toggle" data-toggle="dropdown">
                        <i class="icon-gear"></i> Actions
                        <span class="d-lg-none ml-2">Actions</span>
                    </a>

                    <div class="dropdown-menu dropdown-menu-right">
                        <a href="{{ path('admin.acteurs.proprietaires.edit', {'id': proprietaire.id}) }}" class="dropdown-item">
                            <i class="icon-pencil5"></i> Modifier les infos proprietaire
                        </a>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <!-- /profile navigation -->

    <!-- Tab content -->
   <div class="row">
        <div class="col-md-8 offset-2">
            <div class="card">
                <div class="card-header header-elements-inline">
                    <h6 class="card-title"><i class="icon-users"></i> {{ title }}</h6>
                     <div class="header-elements">
                        <a href="{{ path('admin.utilisateurs.index') }}" 
                        class="btn btn-outline-secondary btn-sm">
                            <i class="icon-arrow-left13 mr-1"></i> Retour
                        </a>
                    </div>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="table-responsive">
                                <table class="table table-bordered table-striped">
                                    <tbody>
                                        <tr>
                                            <th>Nom et prénom</th>
                                            <td>{{ proprietaire.name }}</td>
                                        </tr>
                                        <tr>
                                            <th>Dossier</th>
                                            <td><span class="btn btn-sm btn-primary">{{ proprietaire.dossier }}</span></td>
                                        </tr>
                                        <tr>
                                            <th>Numéro de CNI</th>
                                            <td>{{ proprietaire.getNumeroCniPassport() }}</td>
                                        </tr>
                                        <tr>
                                            <th>Email</th>
                                            <td>{{ proprietaire.adresses.email }}</td>
                                        </tr>
                                        <tr>
                                            <th>Téléphone</th>
                                            <td>{{ proprietaire.adresses.phone }}</td>
                                        </tr>
                                        <tr>
                                            <th>Adresse</th>
                                            <td>{{ proprietaire.adresses.street ?? 'Non renseignée' }}</td>
                                        </tr>
                                        <tr>
                                            <th>Localisation</th>
                                           <td>{{ proprietaire.adresses.country  ?? 'Non renseignée' }} - {{ proprietaire.adresses.city }}</td>
                                        </tr>

                                         <tr>
                                            <th>Statut</th>
                                           <td>
                                                <span class="{{ proprietaire.getIsActif ? 'text-success' : 'text-danger' }}">
                                                    {{ proprietaire.getIsActif ? 'Location en cours' : 'Partir' }}
                                                </span>
                                            </td>

                                        </tr>
                                        
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>    
            </div>
        </div>
    </div>
    <!-- /tab content -->
{% endblock %}
{% block javascripts %}{% endblock %}