File: //home/artinside/fhs.artinside.com.br/themes/adminBackup/widgets/blog/home.php
<?php $this->layout("_admin"); ?>
<section class="wrapper">
<!-- page start-->
<div class="row" >
<div class="col-12 text-center my-4 text-sm-center">
<h3> Consulta de Posts</h3>
<p>Consulte as Matérias em nosso sistema</p>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<section class="card" style="border-radius: 5px">
<header class="card-header white-bg" style="border-radius: 5px">
<form action="<?= url("/admin/blog/home"); ?>" method="post">
<label style="margin-top: 6px;">Busca de Posts >> <a href="<?= url("/admin/blog/home"); ?>" style="font-weight: bold">Home</a></label>
<input type="text" name="s" value="<?= $search; ?>" placeholder="Pesquisar Artigo:" class="form-control" style="width: 50%; float: right;">
</form>
</header>
</section>
</div>
</div>
<div class="col-md-12">
<div class="row product-list">
<?php if (!$posts): ?>
<div class="message info icon-info">Ainda não existem artigos cadastrados no blog.</div>
<?php else: ?>
<?php foreach ($posts as $post):?>
<div class="col-md-6 col-lg-4 col-xl-3">
<section class="card" style=" border-top-right-radius: 10px; border-top-left-radius: 10px">
<div class="pro-img-box categories-img-box" style="height:150px; background-image: url(<?= image($post->cover, 600, 300) ?>); border-top-right-radius: 10px; border-top-left-radius: 10px">
<a href="<?= url("/admin/blog/post/{$post->id}"); ?>" class="adtocart bg-blue">
<i class="fal fa-pencil"></i>
</a>
</div>
<div class="card-body text-center" style="margin-top: 20px">
<p class="font-xsmall bold"><a target="_blank" href=" <?= url("/blog/{$post->uri}"); ?>">
<?php if ($post->post_at > date("Y-m-d H:i:s")): ?>
<span class="icon-clock-o"> <?= $post->title; ?></span>
<?php else: ?>
<span class="icon-check blue-text"> <?= $post->title; ?></span>
<?php endif; ?>
</a></p>
<hr>
<div class="info">
<p class="icon-clock-o"> <?= date_fmt($post->post_at, "d.m.y \à\s H\hi"); ?></p>
<p class="icon-bookmark"> <?= $post->category()->title; ?></p>
<p class="icon-user"> <?= $post->author() ? $post->author()->fullName() : "NA"; ?></p>
<p class="icon-bar-chart"> <?= $post->views; ?></p>
<p class="icon-pencil-square-o"> <?= ($post->status == "post" ? "Artigo" : ($post->status == "draft" ? "Rascunho" : "Lixo")); ?></p>
</div>
<hr>
<a class="btn btn-danger btn-block white-text"
data-post="<?= url("/admin/blog/post"); ?>"
data-action="delete"
data-confirm="Tem certeza que deseja deletar o post?"
data-post_id="<?= $post->id; ?>"><i class="fal fa-trash"></i> DELETAR</a>
</div>
</section>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
<div class="row">
<div class="col-lg-12">
<section class="card" style="border-radius: 5px">
<?= $paginator; ?>
</section>
</div>
</div>
</div>
</div>
<!-- page end-->
</section>
<a href="<?= url("/admin/blog/post"); ?>" class="btn btn-round btn-success btn-cadastrar"><i class="fa fa-plus"></i> Cadastrar</a>