<?php $__env->startSection('page_title'); ?>
    <?php echo e(__('admin::app.settings.roles.create-title')); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('content-wrapper'); ?>
    <div class="content full-page adjacent-center">
        <?php echo view_render_event('admin.settings.roles.create.header.before'); ?>


        <div class="page-header">
            
            <?php echo e(Breadcrumbs::render('settings.roles.create')); ?>


            <div class="page-title">
                <h1><?php echo e(__('admin::app.settings.roles.create-title')); ?></h1>
            </div>
        </div>

        <?php echo view_render_event('admin.settings.roles.create.header.after'); ?>


        <form method="POST" action="<?php echo e(route('admin.settings.roles.store')); ?>" @submit.prevent="onSubmit">
            <div class="page-content">
                <div class="form-container">
                    <div class="panel">
                        <div class="panel-header">
                            <?php echo view_render_event('admin.settings.roles.create.form_buttons.before'); ?>


                            <button type="submit" class="btn btn-md btn-primary">
                                <?php echo e(__('admin::app.settings.roles.save-btn-title')); ?>

                            </button>

                            <a href="<?php echo e(route('admin.settings.roles.index')); ?>">
                                <?php echo e(__('admin::app.layouts.back')); ?>

                            </a>

                            <?php echo view_render_event('admin.settings.roles.create.form_buttons.after'); ?>

                        </div>

                        <div class="panel-body">
                            <?php echo view_render_event('admin.settings.roles.create.form_controls.before'); ?>


                            <?php echo csrf_field(); ?>
                            
                            <div class="form-group" :class="[errors.has('name') ? 'has-error' : '']">
                                <label class="required">
                                    <?php echo e(__('admin::app.layouts.name')); ?>

                                </label>

                                <input
                                    type="text"
                                    name="name"
                                    class="control"
                                    value="<?php echo e(old('name')); ?>"
                                    placeholder="<?php echo e(__('admin::app.layouts.name')); ?>"
                                    v-validate="'required'"
                                    data-vv-as="<?php echo e(__('admin::app.layouts.name')); ?>"
                                />

                                <span class="control-error" v-if="errors.has('name')">
                                    {{ errors.first('name') }}
                                </span>
                            </div>

                            <div class="form-group" :class="[errors.has('description') ? 'has-error' : '']">
                                <label class="required">
                                    <?php echo e(__('admin::app.settings.roles.description')); ?>

                                </label>

                                <textarea
                                    class="control"
                                    name="description"
                                    placeholder="<?php echo e(__('admin::app.settings.roles.description')); ?>"
                                    v-validate="'required'"
                                    data-vv-as="<?php echo e(__('admin::app.settings.roles.description')); ?>"
                                ><?php echo e(old('description')); ?></textarea>

                                <span class="control-error" v-if="errors.has('description')">
                                    {{ errors.first('description') }}
                                </span>
                            </div>

                            <div class="form-group" :class="[errors.has('permission_type') ? 'has-error' : '']">
                                <label class="required">
                                    <?php echo e(__('admin::app.settings.roles.permission_type')); ?>

                                </label>

                                <select
                                    class="control"
                                    id="permission_type"
                                    name="permission_type"
                                    v-validate="'required'"
                                    data-vv-as="<?php echo e(__('admin::app.settings.roles.role')); ?>"
                                >
                                    <option value="custom" <?php echo e(old('permission_type') == 'custom' ? 'selected' : ''); ?>>
                                        <?php echo e(__('admin::app.settings.roles.custom')); ?>

                                    </option>

                                    <option value="all" <?php echo e(old('permission_type') == 'all' ? 'selected' : ''); ?>>
                                        <?php echo e(__('admin::app.settings.roles.all')); ?>

                                    </option>
                                </select>

                                <span class="control-error" v-if="errors.has('permission_type')">
                                    {{ errors.first('permission_type') }}
                                </span>
                            </div>

                            <div class="control-group tree-wrapper <?php echo e(old('permission_type') == 'all' ? 'hide' : ''); ?>">
                                <tree-view value-field="key" id-field="key" items='<?php echo json_encode($acl->items, 15, 512) ?>'></tree-view>
                            </div>

                            <?php echo view_render_event('admin.settings.roles.create.form_controls.after'); ?>

                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('scripts'); ?>
    <script>
        $(document).ready(function () {
            $('#permission_type').on('change', function(event) {
                if ($(event.target).val() == 'custom') {
                    $('.tree-wrapper').removeClass('hide')
                } else {
                    $('.tree-wrapper').addClass('hide')
                }

            })
        });
    </script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('admin::layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\laravel-crm\packages\Webkul\Admin\src/resources/views/settings/roles/create.blade.php ENDPATH**/ ?>