templates/post/includes/_post.html.twig line 1

  1. <article>
  2.     <h3 class="display-4">
  3.         {% if app.current_route != 'cms_post_show' %}
  4.             <a href="{{ path('cms_post_show', {'slug': post.slug|lower}) }}" class="nav-link">
  5.         {% endif %}
  6.         {{ post.title }}
  7.         {% if app.current_route != 'cms_post_show' %}
  8.             </a>
  9.         {% endif %}
  10.     </h3>
  11.     <div class="text-muted">
  12.         <small>{{ 'Par'|trans }} {{ post.createdBy.email }} {{ 'Le '|trans }} {{ post.createdAt|date('d F Y - H:i') }}</small>
  13.         <div class="d-flex justify-content-between">
  14.             <p><small>{{ 'Catégorie'|trans }} : <a href="{{ path('cms_post_index', {'type': 'category', 'slug': post.category.slug}) }}">{{ post.category.name }}</a></small></p>
  15.             <p><small>{{ 'Tags'|trans }}
  16.                     : {{ post.tags|map(tag => "<a href=" ~ path('cms_post_index', {'type': 'tags', 'slug': tag.slug}) ~ ">#{tag.name}</a>")|join(', ')|default('Pas de tags')|raw }}</small>
  17.             </p>
  18.         </div>
  19.     </div>
  20.     <hr>
  21.     <div>
  22.         {{ post.content|raw }}
  23.     </div>
  24.     <hr>
  25.     {% if is_granted('comments_allowed') or post.comments.count > 0 %}
  26.         <aside id="comments_stream">
  27.             {{ render(path('cms_comment_show_for_post', {post: post.id})) }}
  28.         </aside>
  29.     {% endif %}
  30. </article>