templates/article/show.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{{ article.title }} - {{ site_setting('site_name', 'ActuFake') }}{% endblock %}
  3. {% block description %}{{ article.excerpt }}{% endblock %}
  4. {% block body %}
  5. <article class="container my-5">
  6.     {% if is_preview|default(false) %}
  7.     <div class="alert alert-info shadow-sm">
  8.         <i class="fas fa-eye"></i> Mode prévisualisation - Article non publié
  9.     </div>
  10.     {% endif %}
  11.     <div class="row">
  12.         <div class="col-lg-10 mx-auto">
  13.             <div class="alert alert-warning border-warning border-2 mb-4">
  14.                 <i class="fas fa-exclamation-triangle"></i>
  15.                 <strong>ARTICLE SATIRIQUE</strong> — Cette information est FICTIVE et à but humoristique uniquement.
  16.             </div>
  17.             <header class="article-header mb-5">
  18.                 <div class="mb-3">
  19.                     <span class="category-badge">{{ article.category.name }}</span>
  20.                 </div>
  21.                 
  22.                 <h1 class="display-3 fw-bold mb-3" style="line-height: 1.1; letter-spacing: -1px;">
  23.                     {{ article.title }}
  24.                 </h1>
  25.                 
  26.                 {% if article.subtitle %}
  27.                 <h2 class="h3 text-muted fw-normal mb-4" style="line-height: 1.4;">{{ article.subtitle }}</h2>
  28.                 {% endif %}
  29.                 <div class="d-flex flex-wrap align-items-center gap-3 mb-4 pb-4 border-bottom">
  30.                     <div class="text-muted">
  31.                         <i class="fas fa-user me-1"></i>
  32.                         <strong>{{ article.author ?? 'Rédaction ActuFake' }}</strong>
  33.                     </div>
  34.                     <div class="text-muted">
  35.                         <i class="fas fa-clock me-1"></i>
  36.                         {{ article.publishedAt|date('d M Y à H:i') }}
  37.                     </div>
  38.                     <div class="text-muted">
  39.                         <i class="fas fa-eye me-1"></i>
  40.                         {{ article.viewCount }} vues
  41.                     </div>
  42.                 </div>
  43.                 <div class="d-flex gap-2 mb-4">
  44.                     <a href="https://twitter.com/intent/tweet?text={{ article.title|url_encode }}&url={{ url('article_show', {slug: article.slug}) }}" 
  45.                        target="_blank" 
  46.                        class="btn btn-outline-dark">
  47.                         <i class="fab fa-twitter"></i> Twitter
  48.                     </a>
  49.                     <a href="https://www.facebook.com/sharer/sharer.php?u={{ url('article_show', {slug: article.slug}) }}" 
  50.                        target="_blank" 
  51.                        class="btn btn-outline-dark">
  52.                         <i class="fab fa-facebook"></i> Facebook
  53.                     </a>
  54.                 </div>
  55.             </header>
  56.             {% if article.featuredImage %}
  57.             <figure class="mb-5">
  58.                 {% set image_path = article.featuredImage.path starts with '/' ? article.featuredImage.path|slice(1) : article.featuredImage.path %}
  59.                 <img src="{{ base_path }}/{{ image_path }}" 
  60.                      alt="{{ article.featuredImage.alt }}" 
  61.                      class="img-fluid w-100"
  62.                      style="max-height: 600px; object-fit: cover;">
  63.                 {% if article.featuredImage.alt %}
  64.                 <figcaption class="text-muted small mt-2 fst-italic">{{ article.featuredImage.alt }}</figcaption>
  65.                 {% endif %}
  66.             </figure>
  67.             {% endif %}
  68.             <div class="article-excerpt lead mb-5 p-4 bg-light border-start border-4 border-danger" style="line-height: 1.7;">
  69.                 {{ article.excerpt }}
  70.             </div>
  71.             <div class="article-body" style="font-size: 1.125rem; line-height: 1.8;">
  72.                 {{ article.body|raw }}
  73.             </div>
  74.             {% if article.tags|length > 0 %}
  75.             <div class="article-tags mt-5 pt-4 border-top">
  76.                 <div class="mb-2 text-muted small text-uppercase fw-bold" style="letter-spacing: 1px;">Tags</div>
  77.                 {% for tag in article.tags %}
  78.                 <a href="{{ path('search', {q: tag.name}) }}" class="badge bg-dark text-decoration-none me-2 mb-2 px-3 py-2" style="font-size: 0.85rem;">
  79.                     #{{ tag.name }}
  80.                 </a>
  81.                 {% endfor %}
  82.             </div>
  83.             {% endif %}
  84.             <div class="alert alert-warning border-warning border-2 mt-5 shadow-sm">
  85.                 <h6 class="fw-bold" style="color: #856404;">
  86.                     <i class="fas fa-info-circle"></i> Rappel important
  87.                 </h6>
  88.                 <p class="mb-0" style="line-height: 1.7;">
  89.                     Cet article est une <strong>parodie satirique</strong>. 
  90.                     Les faits, citations et informations mentionnés sont <strong>totalement fictifs</strong>.
  91.                     {% if article.isAiGenerated %}
  92.                     Ce contenu a été généré avec l'assistance d'une intelligence artificielle.
  93.                     {% endif %}
  94.                 </p>
  95.             </div>
  96.             {% if related_articles|length > 0 %}
  97.             <section class="related-articles mt-5 pt-5 border-top">
  98.                 <h3 class="section-title">Vous aimerez aussi</h3>
  99.                 <div class="row g-4">
  100.                     {% for related in related_articles %}
  101.                     <div class="col-md-4">
  102.                         <article class="card article-card h-100 border-0 shadow-sm">
  103.                             {% if related.featuredImage %}
  104.                             <img src="/{{ related.featuredImage.path }}" class="card-img-top" alt="{{ related.title }}" style="height: 200px;">
  105.                             {% else %}
  106.                             <div class="bg-secondary d-flex align-items-center justify-content-center" style="height: 200px;">
  107.                                 <i class="fas fa-newspaper fa-3x text-white opacity-25"></i>
  108.                             </div>
  109.                             {% endif %}
  110.                             <div class="card-body">
  111.                                 <span class="category-badge mb-2">{{ related.category.name }}</span>
  112.                                 <h6 class="card-title mt-2" style="line-height: 1.3;">
  113.                                     <a href="{{ path('article_show', {slug: related.slug}) }}" class="text-decoration-none">
  114.                                         {{ related.title }}
  115.                                     </a>
  116.                                 </h6>
  117.                                 <small class="text-muted d-block mt-2">
  118.                                     <i class="fas fa-clock"></i> {{ related.publishedAt|date('d M Y') }}
  119.                                 </small>
  120.                             </div>
  121.                         </article>
  122.                     </div>
  123.                     {% endfor %}
  124.                 </div>
  125.             </section>
  126.             {% endif %}
  127.         </div>
  128.     </div>
  129. </article>
  130. {% endblock %}