templates/news/news_read.html.twig line 1

Open in your IDE?
  1. {% extends 'layout.html.twig' %}
  2. {% block layout %}
  3.     <div class="row" style="display: block; max-width: 100%;">
  4.         <h3 class="news_title" style="text-align: center">
  5.             <strong>
  6.                 {{ news.title }}
  7.             </strong>
  8.         </h3>
  9.         <div class="row" style="display: block;text-align: center;">
  10.             <i style="color:gray;">{{ news.createdAt|date('d/m/Y') }}</i>
  11.             <br/>
  12.             {% if news.listekeywords|length > 0 %}
  13.                 {% for data in news.listekeywords %}
  14.                     <a href="{{ path('keyword', {keyword: data.id}) }}">
  15.                         <span class="badge badge-primary">
  16.                             {{ data.keyword }}
  17.                         </span>
  18.                     </a>
  19.                 {% endfor %}
  20.             {% endif %}
  21.             <br/>
  22.             {% if is_granted('ROLE_ADMIN') %}
  23.                 <a href="{{ea_url()
  24.                     .setController('App\\Controller\\Admin\\NewsCrudController')
  25.                     .setAction('edit')
  26.                     .setEntityId(news.id)}}">
  27.                     <button type="button" class="btn btn-info">Modifier l'article</button>
  28.                 </a>    
  29.             {% endif %}
  30.         </div>
  31.     </div>
  32.     <div class="row">
  33.         <div class="col-lg-8 col-12">
  34.             {% if news.pdf is not null and news.pdf != '' %}
  35.                 <br/>
  36.                 <a href="{{ '/news-pdf/'~ news.pdf }}" target="_blank">
  37.                     <button type="button" class="btn btn-primary" style="margin-left:10px">Voir le document joint</button>
  38.                 </a>
  39.             {% endif %}
  40.             <div class="texte-principal">
  41.                 {{ news.content|raw }}
  42.             </div>
  43.             <br>
  44.         </div>
  45.         {% if news.listelexique|length > 0 %}
  46.             <div class="col-lg-4 col-12">
  47.                 <div style="padding:20px; margin:10px;border: 1px solid gray;border-radius:3px">
  48.                     {% for data in news.listelexique %}
  49.                         {% if data.active == true %}
  50.                             <b>{{ data.word }} :</b> {{ data.definition|raw }}
  51.                             <br/>
  52.                         {% endif %}
  53.                     {% endfor %}
  54.                 </div>
  55.             </div>
  56.         {% endif %}
  57.     </div>
  58. {% endblock %}