<?php

/**
 * This file is part of JohnCMS Content Management System.
 *
 * @copyright JohnCMS Community
 * @license   https://opensource.org/licenses/GPL-3.0 GPL-3.0
 * @link      https://johncms.com JohnCMS Project
 */

$this->layout('system::layout/default');
?>
<?php if ($total) : ?>
    <?php foreach ($items as $newlist): ?>
        <div class="new_post-item without_avatar">
            <a href="<?= $newlist['url'] ?>" class="card-title h3"><?= $newlist['name'] ?></a>
            <div class="post-body"><?= $newlist['announce'] ?></div>
            <div class="text-muted small d-flex align-items-center flex-wrap">
                <div class="me-2">
                    <span><?= __('Section:') ?></span> <a href="<?= $newlist['cat_url'] ?>"><?= $newlist['catalog_name'] ?></a>
                </div>
                <div class="me-2">
                    <span><?= __('Author:') ?></span><?= $newlist['who'] ?>
                </div>
                <div class="d-flex align-items-center me-1">
                    <span class="pe-1"><?= __('Rating:') ?></span><?= $newlist['ratingView'] ?>
                </div>
                <div>
                    <?php if ($newlist['comments']) : ?>
                        <a href="/library/article/<?= $newlist['id'] ?>/comments"><?= __('Comments:') ?></a>
                        (<?= $newlist['comm_count'] ?>)
                    <?php endif; ?>
                </div>
            </div>
        </div>
    <?php endforeach; ?>
<?php endif; ?>
<div class="mt-2"><?= __('Total') ?>: <?= $total ?></div>
<?php if ($total > $user->config->kmess) : ?>
    <div><?= $pagination ?></div>
<?php endif ?>
<div class="mt-2">
    <a href="/library/"><?= __('To Library') ?></a>
</div>
