templates/main/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}SiteWEB{% endblock %}
  3. {% block body %}
  4.     <div class="row">
  5.         <div class="col-12">
  6.             <img src="//via.placeholder.com/500x300.png?text=promo" width="100%" height="250px" />
  7.         </div>
  8.     </div>
  9.     <div class="row">
  10.         <div class="col-lg-12 col-md-12 col-sm-12 sous-menu-home">
  11.             <nav class="navbar navbar-light bg-light" style="display:block;justify-content: normal;padding:0; background-color: #fff !important;border-bottom: 1px solid #d1d5db;">
  12.                 <a class="navbar-brand active" href="/">
  13.                     À la une
  14.                     <span class="border-active"></span>
  15.                 </a>
  16.                 <a class="navbar-brand" href="/new-promo">
  17.                     Nouveaux ({{countNew}})
  18.                     <span class="border-active"></span>
  19.                 </a>
  20.                 <a class="navbar-brand" href="/hot-promo">
  21.                     Hot
  22.                     <span class="border-active"></span>
  23.                 </a>
  24.                 <div class="filter-elment">
  25.                   <a class="btn btn-info filter-element-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  26.                     Filtrer
  27.                     <i class="fa fa-sliders" aria-hidden="true"></i>
  28.                   </a>
  29.                   <div class="form-filter" aria-labelledby="dropdownMenuLink">
  30.                     {{ render(controller('App\\Controller\\MainController::filterForm')) }}
  31.                   </div>
  32.                 </div>
  33.             </nav>
  34.             
  35.         </div>
  36.     </div>
  37.     <div class="row">
  38.     <div class="col-lg-8 col-md-12 col-sm-12">
  39.         {% for article in articles %}
  40.             {% set classArticle = "" %}
  41.             {% if article.endPromo|date('Y-m-d') < "now"|date('Y-m-d') %}
  42.                 {% set classArticle = "expired-article" %}
  43.             {% endif %}
  44.         <div class="col-lg-12 col-md-12 col-sm-12">
  45.             <div class="card-article-detail home {{classArticle}}" style="width: 100%;margin-top: 15px;">
  46.                 <div class="row" style="height: 180px;">
  47.                     <div class="col-4">
  48.                         <div class="img-home-article" style="position:relative;">
  49.                             {% if article.best == true %}
  50.                                 <div class="hot-promo" data-toggle="tooltip" title="Ne ratez pas ce promo !"></div>
  51.                                 <img class="hot-promo-icon" data-toggle="tooltip" title="Ne ratez pas ce promo !" src="{{asset('img/hot-promo.png')}}"> 
  52.                             {% endif %}
  53.                             <img class="card-img-top" height="170" src="{{ vich_uploader_asset(article, 'imageFile')|imagine_filter('article')  }}" alt="img-promo">                    
  54.                         </div>
  55.                     </div>
  56.                     
  57.                     <div class="col-8">
  58.                         <h5 class="card-title text-left" style="float:left;font-size:15px;" title="{{ article.titre | raw |title }}">{{ article.titre |title | slice(0, 100, true) }} {% if article.titre |length > 100 %}...{% endif %}</h5>
  59.                         <span class="home-article-expire">
  60.                             {% if article.endPromo|date('Y-m-d') >= "now"|date('Y-m-d') %}
  61.                                 <i class="fa fa-hourglass-half" aria-hidden="true"></i>
  62.                                 Expire le {{article.endPromo|date('d/m/Y')}}
  63.                             {% else %}
  64.                                 <i class="fa fa-hourglass-end" aria-hidden="true"></i>
  65.                                 Expiré
  66.                             {% endif %}
  67.                         </span>
  68.                         <h5 class="card-title text-left" style="float:left;font-size:15px;width:100%;" title="{{ article.contenu | raw |title }}">
  69.                         
  70.                         {{ article.contenu | slice(0, 100, true)| raw }} {% if article.contenu |length > 100 %}...{% endif %}
  71.                         
  72.                         </h5>
  73.                         <span class="home-article-supplier">
  74.                             Bons plans 
  75.                             <a href="{{ path('article_store', {'id': article.supplier.id}) }}">
  76.                                 {{article.supplier.name}}
  77.                             </a>
  78.                         </span> 
  79.                     </div>
  80.                 </div>
  81.             
  82.                 <div class="card-footer" style="width: 100%;position: relative;padding: 0;background: white;border: none;">
  83.                     {% if article.endPromo|date('Y-m-d') >= "now"|date('Y-m-d') %}
  84.                         <a href="{{ path('web_store_article', {'slug': article.slug}) }}" class="btn btn-primary" style="float:right;">
  85.                             <i class="fa fa-check" aria-hidden="true"></i>
  86.                             Voir Promo
  87.                         </a>
  88.                     {% endif %}
  89.                     <button type="button" class="btn btn-outline-info" style="float:right;margin-right: 5px;">
  90.                             {% set nbrecomment = 0 %}
  91.                             {% for comment in article.commentaires %}
  92.                                 {% if comment.actif == 1 %}
  93.                                     {% set nbrecomment = nbrecomment + 1 %}
  94.                                 {% endif %}
  95.                             {% endfor %}
  96.                             {{ nbrecomment }} 
  97.                             <i class="fa fa-comment"></i>
  98.                         </span>
  99.                     </button>
  100.                 </div>
  101.             </div>
  102.         </div>
  103.         {% endfor %}
  104.         <div class="row">
  105.             <div class="col-12">
  106.                 {{ knp_pagination_render(articles) }}
  107.             </div>
  108.         </div>
  109.         </div>
  110.         <div class="col-lg-4 col-md-4 col-sm-12">
  111.             {{ render(controller('App\\Controller\\MainController::rigthData')) }}
  112.         </div>
  113.     </div>
  114.     <h1>Site WEB des promos</h1>
  115.     <p>Ceci est la page d'accueil</p>
  116.     {% if app.user is null %}
  117.         <a href="{{path('app_login')}}">Admin</a>
  118.     {% endif %}
  119. {% endblock %}