index.html.twig 1.1 KB

123456789101112131415161718192021222324252627282930
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{{ parent() }} - Blog{% endblock %}
  3. {% block body %}
  4. <div>
  5. <section id="section-articles">
  6. {% for article in articles %}
  7. <article class="article-preview">
  8. <div class="titre-article">
  9. <h1><a href="{{ path('app_view', {'slug': article.slug}) }}">{{ article.title}}</a></h1>
  10. <p class="article-by">{{ article.publicationDate | format_date('long') }} - {{ article.author }}</p>
  11. </div>
  12. <div class="contenu">
  13. {{ article.content | markdown }}
  14. </div>
  15. </article>
  16. <a href="{{ path('app_view', {'slug': article.slug}) }}">Voir l'article</a>
  17. {% if is_granted('edit', article) %}
  18. <a class="btn btn-blue" href="{{ path('app_article_edit', {'id': article.id}) }}">Modifier cet article</a>
  19. {% endif %}
  20. <hr>
  21. {% else %}
  22. <p class="remarque">Rien pour le moment</p>
  23. {% endfor %}
  24. </section>
  25. </div>
  26. {% endblock %}