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

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

$counters = $data['counters'] ?? [];
?>
<div class="row">
    <div class="col-md-6">
        <form action="./search/" method="get" class="mb-3">
            <label for="search"><?= __('Look for the User') ?></label>
            <div class="input-group">
                <input type="text" name="search" id="search" class="form-control" placeholder="<?= __('Nickname') ?>">
                <div class="input-group-append">
                    <button class="btn btn-outline-secondary" type="submit"><?= __('Search') ?></button>
                </div>
            </div>
            <div class="text-muted mb-2 small"><?= __('The search is performed by Nickname and are case-insensitive.') ?></div>
        </form>
        <div class="list-group">
            <a href="./users/" class="list-group-item d-flex justify-content-between align-items-center">
                <?= __('Users') ?>
                <span class="badge badge-light badge-pill"><?= $counters['usersCount'] ?></span>
            </a>
            <a href="./administration/" class="list-group-item d-flex justify-content-between align-items-center">
                <?= __('Administration') ?>
                <span class="badge badge-light badge-pill"><?= $counters['adminCount'] ?></span>
            </a>
            <?php if (! empty($counters['birthDays'])): ?>
                <a href="./birthdays/" class="list-group-item d-flex justify-content-between align-items-center">
                    <?= __('Birthdays') ?>
                    <span class="badge badge-light badge-pill"><?= $counters['birthDays'] ?></span>
                </a>
            <?php endif ?>
            <a href="./top/" class="list-group-item d-flex justify-content-between align-items-center">
                <?= __('Top Activity') ?>
            </a>
        </div>
    </div>
</div>
