templates/base/tutos_list.html.twig line 1

Open in your IDE?
  1. {% extends 'layout.html.twig' %}
  2. {% block layout %}
  3. <div class="row">
  4.     <div class="d-lg-block col-lg-3">
  5.         <div class="list-group">
  6.                 <a href="{{ path('la_base', {category: null}) }}" class="list-group-item list-group-item-action {{ (null == categoryRequest) ? "active" : "" }}">
  7.                     Toutes les catégories
  8.                 </a>
  9.             {% for category in categories %}
  10.                 <a href="{{ path('la_base', {category: category.id}) }}" class="list-group-item list-group-item-action color color-{{category.id}} {{ (categoryRequest != null and category.id == categoryRequest.id) ? "active" : "" }}">
  11.                     {{ category.name }}
  12.                 </a>
  13.             {% endfor %}
  14.         </div>
  15.     </div>
  16.     <div class="col-lg-9 col-12">
  17.         <h2><strong>Les derniers articles dans La Base</strong></h2>
  18.         <div class="row" style="padding-top:20px">
  19.             {% for data in tutos %}
  20.                 <div class="col-sm-12 col-lg-6 liste">
  21.                     <div class="card" style="border: 1px solid black;height: 100%;min-height:215px">
  22.                         <h5 class="card-header color color-{{ data.category.id }}">
  23.                             <strong>
  24.                                 {{ data.title }}
  25.                             </strong>
  26.                         </h5>
  27.                         <div class="card-body">
  28.                             <p class="card-text">
  29.                                 <i>
  30.                                     {% if data.chapo != null %}
  31.                                         {{ data.chapo|length > 200 ? data.chapo|slice(0,200)|raw : data.chapo|raw }}
  32.                                         {{ data.chapo|length > 200 ? '...' : ''}}
  33.                                     {% else %}
  34.                                         {{ data.content|length > 200 ? data.content|slice(0,200)|raw : data.content|raw }}
  35.                                         {{ data.content|length > 200 ? '...' : ''}}
  36.                                     {% endif %}
  37.                                 </i>
  38.                             </p>
  39.                         </div>
  40.                         <div class="card-footer" style="display:flex; align-items:center;">
  41.                             <span> {{data.createdAt|date('d/m/Y')}} </span>
  42.                             <a style="margin-left:auto; background-color:{{data.category.color}}; border-color:{{data.category.color}};" href="{{ path('tuto_read', {tutoId: data.id}) }}" class="btn btn-primary">
  43.                                 Lire l'article
  44.                             </a>
  45.                         </div>
  46.                     </div>
  47.                 </div>
  48.             {% endfor %}
  49.         </div>
  50.         <div class="navigation">
  51.             {{ knp_pagination_render(tutos) }}
  52.         </div>
  53.     </div>
  54. </div>
  55. {% endblock %}
  56. {% block stylesheets %}
  57.     {{ parent() }}
  58.     <style>
  59.         .color::before {
  60.             content: '';
  61.             display: inline-block;
  62.             width: .5em;
  63.             height: .5em;
  64.             -moz-border-radius: .25em;
  65.             -webkit-border-radius: .25em;
  66.             border-radius: .25em;
  67.         }
  68.         {% for category in categories %}
  69.             .color.color-{{ category.id }}::before {
  70.                 background-color:{{ category.color }};
  71.             }
  72.         {% endfor %}
  73.     </style>
  74. {% endblock %}