<?php $__env->startSection('header'); ?>
    <?php echo e(trans('admin.head.capsules')); ?> / <?php echo e(trans('admin.head_section.edit')); ?>

    &nbsp;&nbsp;&nbsp;&nbsp;
    <a href="<?php echo e(route('admin.capsule.list')); ?>" class="btn btn-info">
        <?php echo e(trans('admin.capsule.list')); ?>

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

<?php $__env->startSection('main'); ?>
    <div class="px-content">

        <?php if(session('status')): ?>
        <div class="row">
            <div class="col-md-6">
                <div class="alert alert-success">
                    <button type="button" class="close" data-dismiss="alert">×</button>
                    <strong><?php echo e(session('status')); ?></strong>
                </div>
            </div>
        </div>
        <?php endif; ?>

        <div class="row m-t-1">

            <ul class="nav nav-tabs" id="capsule-tabs">
                <li class="active">
                    <a href="#capsule-content" data-toggle="tab">
                        <?php echo e(trans('admin.capsule.content')); ?>

                    </a>
                </li>

                <?php if($capsule->count_comments > 0): ?>
                    <li>
                        <a href="#capsule-comments" data-toggle="tab">
                            <?php echo e(trans('admin.capsule.comments')); ?>

                        </a>
                    </li>
                <?php endif; ?>

                <?php if($capsule->count_tagged_users > 0): ?>
                    <li>
                        <a href="#capsule-tagged-users" data-toggle="tab">
                            <?php echo e(trans('admin.capsule.tagged_users')); ?>

                        </a>
                    </li>
                <?php endif; ?>

                <?php if($capsule->count_subscribers > 0): ?>
                    <li>
                        <a href="#capsule-subscribers" data-toggle="tab">
                            <?php echo e(trans('admin.capsule.subscribers')); ?>

                        </a>
                    </li>
                <?php endif; ?>
            </ul>

            <div class="tab-content tab-content-bordered bg-white">
                <div class="tab-pane p-a-3 fade in active" id="capsule-content">

                    <form action="<?php echo e(route('admin.capsule.update', ['id' => $capsule->id])); ?>" method="POST">
                        <?php echo e(csrf_field()); ?>

                        <?php echo e(method_field('PUT')); ?>


                        <div class="col-md-4">
                            <div class="form-group <?php echo e($errors->has('is_private') ? 'has-error' : ''); ?>">
                                <label>
                                    <input type="checkbox" name="is_private" <?php echo e($capsule->is_private?'checked="checked"':''); ?> />
                                    Is private
                                </label>
                                <?php if($errors->has('is_private')): ?>
                                    <span>
                                        <strong><?php echo e($errors->first('is_private')); ?></strong>
                                    </span>
                                <?php endif; ?>
                            </div>

                            <div class="form-group">
                                <label><b><?php echo e(trans('admin.capsule.search_settings')); ?></b></label>
                            </div>

                            <div class="form-group <?php echo e($errors->has('search_setting') ? 'has-error' : ''); ?>">
                                <label for="search_setting"><?php echo e(trans('admin.capsule.search_type')); ?></label>
                                <select name="search_setting" class="form-control" id="search_setting">
                                    <option value="0" <?php echo ! $capsule->search_setting ? 'selected="selected"' : ''; ?>>
                                        <?php echo e(trans('admin.capsule.search_setting.default')); ?>

                                    </option>

                                    <option value="1" <?php echo $capsule->search_setting == 1 ? 'selected="selected"' : ''; ?>>
                                        <?php echo e(trans('admin.capsule.search_setting.for_all')); ?>

                                    </option>

                                    <option value="2" <?php echo $capsule->search_setting == 2 ? 'selected="selected"' : ''; ?>>
                                        <?php echo e(trans('admin.capsule.search_setting.for_new')); ?>

                                    </option>
                                </select>
                                <?php if($errors->has('search_setting')): ?>
                                    <span>
                                        <strong><?php echo e($errors->first('search_setting')); ?></strong>
                                    </span>
                                <?php endif; ?>
                            </div>

                            <div class="form-group <?php echo e($errors->has('search_position') ? 'has-error' : ''); ?>">
                                <label for="search_position"><?php echo e(trans('admin.capsule.search_position')); ?></label>
                                <input type="number" name="search_position"
                                       id="search_position" class="form-control" value="<?php echo e($capsule->search_position ?? 0); ?>">
                                <?php if($errors->has('search_position')): ?>
                                    <span>
                                        <strong><?php echo e($errors->first('search_position')); ?></strong>
                                    </span>
                                <?php endif; ?>
                            </div>

                            <div class="form-group <?php echo e($errors->has('suggested_position') ? 'has-error' : ''); ?>">
                                <label for="suggested_position"><?php echo e(trans('admin.capsule.suggested_position')); ?></label>
                                <input type="number" name="suggested_position"
                                       id="suggested_position" class="form-control" value="<?php echo e($capsule->suggested_position ?? 0); ?>">
                                <?php if($errors->has('suggested_position')): ?>
                                    <span>
                                        <strong><?php echo e($errors->first('suggested_position')); ?></strong>
                                    </span>
                                <?php endif; ?>
                            </div>

                        </div>

                        <div class="col-md-8">
                            <div class="form-group <?php echo e($errors->has('caption') ? 'has-error' : ''); ?>">
                                <label for="capsule-caption">Caption</label>
                                <textarea name="caption" id="capsule-caption" rows="5"
                                          class="form-control"><?php echo e($capsule->caption); ?></textarea>
                                <?php if($errors->has('caption')): ?>
                                    <span>
                                        <strong><?php echo e($errors->first('caption')); ?></strong>
                                    </span>
                                <?php endif; ?>
                            </div>
                        </div>

                        <div class="col-md-12">
                            <input type="submit" class="btn btn-primary" value="<?php echo e(trans('admin.buttons.change')); ?>" />
                        </div>

                    </form>
                </div>

                <?php if($capsule->count_comments > 0): ?>
                    <div class="tab-pane p-a-3 fade" id="capsule-comments">

                        <?php echo $__env->make('admin.capsule.lists.comments', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                    </div>
                <?php endif; ?>

                <?php if($capsule->count_tagged_users > 0): ?>
                    <div class="tab-pane p-a-3 fade" id="capsule-tagged-users">

                        <?php echo $__env->make('admin.capsule.lists.tagged_users', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                    </div>
                <?php endif; ?>

                <?php if($capsule->count_subscribers > 0): ?>
                    <div class="tab-pane p-a-3 fade" id="capsule-subscribers">

                        <?php echo $__env->make('admin.capsule.lists.subscribers', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                    </div>
                <?php endif; ?>

            </div>
        </div>

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

<?php $__env->startSection('scripts'); ?>
    <style>
        th{
            vertical-align: center;
        }
        td{
            vertical-align: center;
        }
    </style>
    <script>
        $('a[data-toggle="tab"]').on( 'shown.bs.tab', function (e) {
            $.fn.dataTable.tables( {visible: true, api: true} ).columns.adjust();
        } );
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin._layout.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/resources/views.admin/admin/capsule/form.blade.php ENDPATH**/ ?>