41 lines
1.5 KiB
HTML
41 lines
1.5 KiB
HTML
<article class="card card--stack">
|
|
<check if="{{ @post.thumbnail_url }}">
|
|
<true>
|
|
<img class="media-frame" src="{{ @post.thumbnail_url }}" alt="{{ @post.thumbnail_alt ?: @post.title }}">
|
|
</true>
|
|
<false>
|
|
<check if="{{ @adminMode }}">
|
|
<true>
|
|
<div class="media-frame media-frame--placeholder">Aucune image</div>
|
|
</true>
|
|
</check>
|
|
</false>
|
|
</check>
|
|
<div class="card-body">
|
|
<h2 class="card-title">{{ @post.title }}</h2>
|
|
<p class="meta-text">
|
|
Publié le <time datetime="{{ @post.created_at }}">{{ @post.created_at | date_fr }}</time>
|
|
<check if="{{ @post.updated_at !== @post.created_at }}">
|
|
<true><br>Mis à jour le <time datetime="{{ @post.updated_at }}">{{ @post.updated_at | date_fr }}</time></true>
|
|
</check>
|
|
</p>
|
|
<p class="card-summary">{{ @post.excerpt }}</p>
|
|
<check if="{{ @adminMode }}">
|
|
<true>
|
|
<div class="card-actions">
|
|
<a class="button button--ghost" href="{{ 'post_edit', 'id='.@post.id | alias }}">Modifier</a>
|
|
<form method="post" action="{{ 'post_delete', 'id='.@post.id | alias }}" data-confirm="Supprimer cet article ?">
|
|
<include href="partials/csrf_field.html" />
|
|
<button class="button button--danger" type="submit">Supprimer</button>
|
|
</form>
|
|
</div>
|
|
</true>
|
|
<false>
|
|
<div class="card-actions">
|
|
<a class="button button--ghost" href="{{ 'post_show', 'slug='.@post.slug | alias }}">Lire l'article</a>
|
|
</div>
|
|
</false>
|
|
</check>
|
|
</div>
|
|
</article>
|