templates/blog/article_show.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{{ article.title }} - WA BENIN{% endblock %}
  3. {% block body %}
  4. <div class="page-header" style="height: 35vh; min-height: 250px; margin-bottom: 40px;">
  5. <div class="container fade-up" style="max-width: 800px; text-align: center;">
  6. <span style="background: var(--gold); color: #fff; padding: 5px 15px; border-radius: 20px; font-size: 0.9rem; font-weight: bold; text-transform: uppercase; margin-bottom: 20px; display: inline-block;">{{ article.category }}</span>
  7. <h1 class="page-title" style="font-size: 2.5rem;">{{ article.title }}</h1>
  8. <div style="color: #ccc; font-size: 1rem; margin-top: 20px; display: flex; justify-content: center; gap: 20px;">
  9. <span><i class="far fa-calendar-alt"></i> {{ article.createdAt|date('d M Y') }}</span>
  10. <span><i class="far fa-user"></i> {{ article.author }}</span>
  11. </div>
  12. </div>
  13. </div>
  14. <section class="section-padding" style="padding-top: 0;">
  15. <div class="container" style="max-width: 800px;">
  16. <div class="fade-up" style="background: #fff; border-radius: var(--border-radius); box-shadow: var(--shadow-soft); overflow: hidden;">
  17. {% if article.image %}
  18. <div style="width: 100%; max-height: 500px; overflow: hidden;">
  19. <img src="{{ article.image }}" alt="{{ article.title }}" style="width: 100%; height: auto; object-fit: cover;">
  20. </div>
  21. {% endif %}
  22. <div style="padding: 40px; font-size: 1.1rem; line-height: 1.8; color: #444;">
  23. {{ article.content|nl2br }}
  24. <div style="margin-top: 40px; padding-top: 30px; border-top: 1px solid #eee; display: flex; justify-content: space-between; align-items: center;">
  25. <div>
  26. <span style="font-weight: bold; color: var(--black-dark);">Partager cet article :</span>
  27. <div class="social-links" style="display: inline-flex; margin-left: 15px; gap: 10px;">
  28. <a href="https://www.facebook.com/sharer/sharer.php?u={{ url('app_article_show', {id: article.id}) }}" target="_blank" rel="noopener noreferrer" style="background: #3b5998; color: #fff; width: 35px; height: 35px;"><i class="fab fa-facebook-f"></i></a>
  29. <a href="https://twitter.com/intent/tweet?url={{ url('app_article_show', {id: article.id}) }}&text={{ article.title|url_encode }}" target="_blank" rel="noopener noreferrer" style="background: #1da1f2; color: #fff; width: 35px; height: 35px;"><i class="fab fa-twitter"></i></a>
  30. <a href="https://api.whatsapp.com/send?text={{ article.title|url_encode }}%20{{ url('app_article_show', {id: article.id}) }}" target="_blank" rel="noopener noreferrer" style="background: #25d366; color: #fff; width: 35px; height: 35px;"><i class="fab fa-whatsapp"></i></a>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </section>
  39. <!-- Articles Récents -->
  40. <section class="section-padding bg-light">
  41. <div class="container">
  42. <h2 style="margin-bottom: 30px; text-align: center;">Articles Récents</h2>
  43. <div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px;">
  44. {% for recent in recent_articles %}
  45. {% if recent.id != article.id %}
  46. <div class="fade-up" style="background: #fff; border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow-soft);">
  47. <div style="height: 200px; overflow: hidden;">
  48. <img src="{{ recent.image }}" alt="{{ recent.title }}" style="width: 100%; height: 100%; object-fit: cover;">
  49. </div>
  50. <div style="padding: 20px;">
  51. <span style="color: var(--gold); font-size: 0.8rem; font-weight: bold; text-transform: uppercase;">{{ recent.category }}</span>
  52. <h3 style="margin: 10px 0; font-size: 1.2rem; line-height: 1.3;">{{ recent.title }}</h3>
  53. <a href="{{ path('app_article_show', {id: recent.id}) }}" style="color: var(--black-dark); font-weight: 600;">Lire la suite <i class="fas fa-arrow-right" style="font-size: 0.8rem; margin-left: 5px;"></i></a>
  54. </div>
  55. </div>
  56. {% endif %}
  57. {% endfor %}
  58. </div>
  59. </div>
  60. </section>
  61. {% endblock %}