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

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

<div class="row">
    <div class="m-sm-auto m-md-auto m-lg-0 col-sm-12 col-md-8 col-lg-7 col-xl-7">
        <?php if (! empty($data['message'])): ?>
            <?= $this->fetch(
                'system::app/alert',
                [
                    'alert_type' => 'alert-success',
                    'alert'      => $data['message'],
                ]
            ) ?>
        <?php endif; ?>
        <div class="card shadow border-0">
            <form action="<?= $data['form_action'] ?>" method="post">
                <div class="card-body">
                    <h3><?= $data['title'] ?></h3>
                    <div class="custom-control custom-checkbox mb-3">
                        <input type="checkbox"
                               class="custom-control-input"
                               name="show_forum_unread"
                               value="1"
                               id="show_forum_unread" <?= $data['current_settings']['show_forum_unread'] ? 'checked' : '' ?>>
                        <label class="custom-control-label" for="show_forum_unread"><?= __('Display the number of unread messages in the forum') ?></label>
                    </div>
                    <div class="d-flex flex-wrap justify-content-between">
                        <div class="mb-1 mr-1">
                            <input type="submit" name="submit" value="<?= __('Save') ?>" class="btn btn-primary"/>
                            <a href="<?= $data['back_url'] ?>" class="btn btn-secondary"><?= __('Cancel') ?></a>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
