Less home code more F3
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<true>
|
||||
<div class="card-grid">
|
||||
<repeat group="{{ @posts }}" value="{{ @post }}">
|
||||
<include href="partials/post_card_admin.html" />
|
||||
<include href="partials/post_card.html" />
|
||||
</repeat>
|
||||
</div>
|
||||
<include href="partials/pagination.html" />
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
<article class="card article-card">
|
||||
<a class="card-media-link" href="{{ 'post_show', 'slug='.@post.slug | alias }}">
|
||||
<check if="{{ @post.cover_url }}">
|
||||
<true><img class="media-frame" src="{{ @post.cover_url }}" alt="{{ @post.title }}"></true>
|
||||
<false>
|
||||
<div class="media-frame media-frame--placeholder">Aucune image</div>
|
||||
</false>
|
||||
</check>
|
||||
</a>
|
||||
<check if="{{ @post.cover_url }}">
|
||||
<true>
|
||||
<a class="card-media-link" href="{{ 'post_show', 'slug='.@post.slug | alias }}">
|
||||
<img class="media-frame" src="{{ @post.cover_url }}" alt="{{ @post.cover_alt ?: @post.title }}">
|
||||
</a>
|
||||
</true>
|
||||
<false>
|
||||
<check if="{{ @adminMode }}">
|
||||
<true>
|
||||
<div class="media-frame media-frame--placeholder">Aucune image</div>
|
||||
</true>
|
||||
</check>
|
||||
</false>
|
||||
</check>
|
||||
<div class="card-body article-card__body">
|
||||
<h2 class="card-title">{{ @post.title }}</h2>
|
||||
<h2 class="card-title">
|
||||
<a class="card-title__link" href="{{ 'post_show', 'slug='.@post.slug | alias }}">{{ @post.title }}</a>
|
||||
</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 }}">
|
||||
@@ -16,5 +24,16 @@
|
||||
</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 ?">
|
||||
<input type="hidden" name="csrf_token" value="{{ @CSRF }}">
|
||||
<button class="button button--danger" type="submit">Supprimer</button>
|
||||
</form>
|
||||
</div>
|
||||
</true>
|
||||
</check>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<article class="card article-card">
|
||||
<a class="card-media-link" href="{{ 'post_edit', 'id='.@post.id | alias }}">
|
||||
<check if="{{ @post.cover_url }}">
|
||||
<true><img class="media-frame" src="{{ @post.cover_url }}" alt="{{ @post.title }}"></true>
|
||||
<false>
|
||||
<div class="media-frame media-frame--placeholder">Aucune image</div>
|
||||
</false>
|
||||
</check>
|
||||
</a>
|
||||
<div class="card-body article-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>
|
||||
<div class="card-actions">
|
||||
<a class="button button--ghost" href="{{ 'post_show', 'slug='.@post.slug | alias }}">Voir</a>
|
||||
<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 ?">
|
||||
<input type="hidden" name="csrf_token" value="{{ @CSRF }}">
|
||||
<button class="button button--danger" type="submit">Supprimer</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
@@ -12,12 +12,8 @@
|
||||
<check if="{{ @post.cover_url }}">
|
||||
<true>
|
||||
<img class="media-frame media-frame--large article-cover" src="{{ @post.cover_url }}"
|
||||
alt="{{ @post.title }}">
|
||||
alt="{{ @post.cover_alt ?: @post.title }}">
|
||||
</true>
|
||||
<false>
|
||||
<div class="media-frame media-frame--large media-frame--placeholder article-cover">Aucune image
|
||||
</div>
|
||||
</false>
|
||||
</check>
|
||||
|
||||
<div class="prose">{{ @post.body_html | raw }}</div>
|
||||
|
||||
Reference in New Issue
Block a user