<?php $__env->startSection('content'); ?>
<link href="<?php echo e(url('assets/css/plugins/chosen/chosen.css')); ?>" rel="stylesheet">
<div class="row wrapper border-bottom white-bg page-heading">
                <div class="col-lg-10">
                    <h2>HomePage Settings</h2>
                    <ol class="breadcrumb">
                        <li>
                            <a href="<?php echo e(url('')); ?>"><?php echo app('translator')->getFromJson('common.home'); ?></a>
                        </li>
                        
                        <li class="active">
                            <strong>HomePage Settings</strong>
                        </li>
                    </ol>
                </div>
                <div class="col-lg-2">

                </div>
            </div>
			
			<div class="wrapper wrapper-content animated fadeInRight">
<div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>HomePage Settings</h5>
                            <div class="ibox-tools">
                                <a class="collapse-link">
                                    <i class="fa fa-chevron-up"></i>
                                </a>
                                
                                
                            </div>
                        </div>
                        <div class="ibox-content">
						
			

<form action="<?php echo e(url('settings/homepage')); ?>" class="form-horizontal" method="POST" enctype='multipart/form-data'>
                        <?php echo e(csrf_field()); ?>

 <?php $__empty_1 = true; $__currentLoopData = $homepage; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $home): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
 
 <?php if($home->type == "text"): ?> 

 <div class="form-group">
 <label class="col-sm-2 control-label"><?php echo e($home->label); ?></label>
                                    <div class="col-sm-10">  <input type="text" class="form-control" id="<?php echo e($home->key); ?>" name="<?php echo e($home->key); ?>" value="<?php echo e(old($home->key, $home->value)); ?>"></div>
                                </div>
				<?php endif; ?>
				
				<?php if($home->type == "textarea"): ?> 

 <div class="form-group">
						<label class="col-sm-2 control-label"><?php echo e($home->label); ?></label>
                                    <div class="col-sm-10"> 
									<textarea class="form-control" id="<?php echo e($home->key); ?>" name="<?php echo e($home->key); ?>"><?php echo e($home->value); ?></textarea>
									</div>
                                </div>
				<?php endif; ?>
				
                                <div class="hr-line-dashed"></div>
								
           
          
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <?php endif; ?>
				<?php $cat_array = array();
                    $cats = homepage_by_key('category');
    if(!empty($cats)) {
        foreach(explode(",", $cats) as $c) { 
            $cat_array[] = $c;
        }
        $category = explode(",", $cats);
    }     
                ?>
                                        
                <div class="form-group">
                        <label class="col-sm-2 control-label">Home Categories</label>
                                    <div class="col-sm-10"> 
                                     <select data-placeholder="Choose a Category..." class="chosen-select" name="category[]" multiple style="width:350px;" tabindex="4">
                                        <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option <?php if(in_array($category->id, $cat_array)) { echo "selected"; 
                                       }?> value="<?php echo e($category->id); ?>"><?php echo e($category->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                </div>
                 <div class="hr-line-dashed"></div>
                                
                            <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-2">
                                        
                                         <a class="btn btn-white" href="<?php echo e(url('settings/general')); ?>">Cancel</a>
                                        <button class="btn btn-primary" type="submit">Save changes</button>
                                    </div>
                                </div>
         </form>
                        </div>
                    </div>
                </div>
            </div>
            </div>
             <script src="<?php echo e(url('assets/js/plugins/chosen/chosen.jquery.js')); ?>"></script>
            <script> 
             var config = {
                '.chosen-select'           : {},
                '.chosen-select-deselect'  : {allow_single_deselect:true},
                '.chosen-select-no-single' : {disable_search_threshold:10},
                '.chosen-select-no-results': {no_results_text:'Oops, nothing found!'},
                '.chosen-select-width'     : {width:"95%"}
                }
            for (var selector in config) {
                $(selector).chosen(config[selector]);
            }
            </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>