<section class="content-header">
    <h1><?= __('Change class settings') ?></h1>
</section>

<section class="content">

    <div class="box box-default">
        <form data-ajax class="form-focus" action="<?= admin_url_to('/configs/change-class') ?>" method="post">
            <?= csrf_field() ?>

            <div class="box-body">
                <div class="section">
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-4 col-xs-12">
                            <h5><?= __('Settings') ?></h5>
                        </div>

                        <div class="col-lg-9 col-md-9 col-sm-8 col-xs-12">
                            <div class="row">
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label class="control-label" for="equalize-points"><?= __('Equalize points') ?></label>
                                        <div>
                                            <input type="checkbox" class="form-control toggle" id="equalize-points"<?= config('change_class.equalize_points') ? 'checked="checked"' : '' ?> value="1" name="equalize_points" />
                                        </div>
                                    </div>
                                </div>

                                <div class="col-md-3">
                                    <?php if (server()->hasSkillTree()): ?>
                                        <div class="form-group">
                                            <label class="control-label" for="master-level"><?= __('Reset master level') ?></label>
                                            <div>
                                                <input type="checkbox" class="form-control toggle" id="master-level"<?= config('change_class.reset_master_level') ? 'checked="checked"' : '' ?> value="1" name="reset_master_level" />
                                            </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label" for="classes"><?= __('Allowed classes') ?></span></label>
                                <div>
                                    <?php foreach (config('characters.classes', []) as $code => $class): ?>
                                        <div style="width:33%;margin-bottom:10px;float:left">
                                            <input<?= in_array($code, config('change_class.classes', [])) ? ' checked' : '' ?> type="checkbox" name="classes[]" id="class-<?= $code ?>" value="<?= $code ?>" /> <label for="class-<?= $code ?>"><?= $class['name'] ?></label>
                                        </div>
                                    <?php endforeach ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="box-footer">
                <div class="row">
                    <div class="col-sm-offset-3" style="padding-left:15px">
                        <input type="submit" class="btn btn-primary" value="<?= __('Save') ?>" />
                    </div>
                </div>
            </div>
        </form>
    </div>
</section>