{% extends '@CpCreationVitiCore/admin/base.html.twig' %}

{% block content %}
    <h1 class="page-header">Tableau de bord</h1>

    <div class="row">
        {% if is_granted('ROLE_ADMIN') %}
            <div class="col-lg-3 col-md-6">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="fas fa-users fa-3x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <div>Clients</div>
                            </div>
                        </div>
                    </div>
                    <a href="{{ path('admin_client') }}">
                        <div class="panel-footer">
                            <span class="pull-left">Voir la liste</span>
                            <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
                            <div class="clearfix"></div>
                        </div>
                    </a>
                </div>
            </div>
        {% endif %}

        {% if is_granted('ROLE_ORDER') or is_granted('ROLE_ADMIN') %}
            <div class="col-lg-3 col-md-6">
                <div class="panel panel-green">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="fas fa-list-ul fa-3x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <div>Commandes</div>
                            </div>
                        </div>
                    </div>
                    <a href="{{ path('admin_order') }}">
                        <div class="panel-footer">
                            <span class="pull-left">Voir l'historique</span>
                            <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
                            <div class="clearfix"></div>
                        </div>
                    </a>
                </div>
            </div>
        {% endif %}

        {% if is_granted('ROLE_PRODUCT') or is_granted('ROLE_ADMIN') %}
            <div class="col-lg-3 col-md-6">
                <div class="panel panel-yellow">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="fab fa-product-hunt fa-3x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <div>Produits</div>
                            </div>
                        </div>
                    </div>
                    <a href="{{ path('admin_product') }}">
                        <div class="panel-footer">
                            <span class="pull-left">Voir la liste</span>
                            <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
                            <div class="clearfix"></div>
                        </div>
                    </a>
                </div>
            </div>
        {% endif %}

        {% if is_granted('ROLE_ADMIN') %}
            <div class="col-lg-3 col-md-6">
                <div class="panel panel-red">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="fas fa-user-shield fa-3x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <div>Admins</div>
                            </div>
                        </div>
                    </div>
                    <a href="{{ path('admin_user') }}">
                        <div class="panel-footer">
                            <span class="pull-left">Gérer les accès</span>
                            <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
                            <div class="clearfix"></div>
                        </div>
                    </a>
                </div>
            </div>
        {% endif %}

        {% if is_granted('ROLE_POPUP') or is_granted('ROLE_ADMIN') %}
            <div class="col-lg-3 col-md-6">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="far fa-window-restore fa-3x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <div>Annonces</div>
                            </div>
                        </div>
                    </div>
                    <a href="{{ path('admin_popup') }}">
                        <div class="panel-footer">
                            <span class="pull-left">Voir la liste</span>
                            <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
                            <div class="clearfix"></div>
                        </div>
                    </a>
                </div>
            </div>
        {% endif %}

        {% if is_granted('ROLE_PROMO') or is_granted('ROLE_ADMIN') %}
            <div class="col-lg-3 col-md-6">
                <div class="panel panel-yellow">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="fas fa-percent fa-3x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <div>Codes promo</div>
                            </div>
                        </div>
                    </div>
                    <a href="{{ path('admin_promo') }}">
                        <div class="panel-footer">
                            <span class="pull-left">Voir la liste</span>
                            <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
                            <div class="clearfix"></div>
                        </div>
                    </a>
                </div>
            </div>
        {% endif %}

        {% if shopConfig and shopConfig.matomoConfigured %}
            <div class="col-lg-3 col-md-6">
                <div class="panel panel-green">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="fas fa-chart-line fa-3x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <div>Visites</div>
                            </div>
                        </div>
                    </div>
                    <a href="https://matomo.cpcreation.net/" target="_blank" rel="noopener noreferrer">
                        <div class="panel-footer">
                            <span class="pull-left">Voir les statistiques</span>
                            <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
                            <div class="clearfix"></div>
                        </div>
                    </a>
                </div>
            </div>
        {% endif %}
    </div>
{% endblock %}
