<?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
 */

/**
 * @var $title
 * @var $page_title
 * @var $items
 * @var $pagination
 * @var $users_list_url
 * @var $guests_list_url
 * @var $empty_message
 * @var $is_users
 * @var $poll_name
 */

$this->layout(
    'system::layout/default',
    [
        'title'      => $title,
        'page_title' => $page_title,
    ]
);
?>

<h3><?= $poll_name ?></h3>

<?php foreach ($items as $item): ?>
    <?= $this->fetch('forum::user_row', ['item' => $item]) ?>
<?php endforeach; ?>

<?php if (empty($total)): ?>
    <div class="alert alert-info shadow border-0"><?= $empty_message ?></div>
<?php endif; ?>

<?php if (! empty($total)): ?>
    <div class="mb-n2 pt-1">
        <div><?= __('Total') ?>: <?= $total ?></div>
        <!-- Page switching -->
        <?php if ($total > $user->config->kmess): ?>
            <div class="mt-1"><?= $pagination ?></div>
        <?php endif ?>
    </div>
<?php endif ?>

<?php if (! empty($id)): ?>
    <div class="mt-3">
        <a href="/forum/?type=topic&id=<?= $id ?>"><?= __('Go to Topic') ?></a>
    </div>
<?php endif; ?>
