<?php $__env->startSection('styles'); ?>
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('admin/css/awesome-bootstrap-checkbox.css')); ?>">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('pagetitle'); ?>
	Page <small>edit</small>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('crumbs'); ?>
	<li><a href="<?php echo e(url('admin/pages')); ?>"><i class="fa fa-text-o"></i> Pages</a></li>
	<li class="active"><i class="fa fa-pencil"></i> Editing a page</li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('pagecontents'); ?>

    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title pull-left"><i class="fa fa-th fa-fw"></i> Create New Page</h3>
                    <p class="pull-right">
                    	<a href="<?php echo e(url('admin/pages')); ?>" class="btn btn-default btn-sm"><i class="fa fa-reply"></i> Cancel</a>
                    </p>
                    <div class="clearfix"></div>
                </div>
                <div class="panel-body">
                        <div class="table-responsive">
                            <?php echo Form::model($page, ['url' => '/admin/pages/' . $page->id, 'method' => 'PATCH']); ?>

                    			<div class="col-md-8">
                    				
                					<div class="form-group">
                						<?php echo Form::label('page_title', 'Page Title', ['class' => 'control-label']); ?>

    									<?php echo Form::text('page_title', null, ['class' => 'form-control', 'required']); ?>

                					</div>

                                    <div class="form-group">
                                        <?php echo Form::label('description', 'Description', ['class' => 'control-label']); ?>

                                        <?php echo Form::text('description', null, ['class' => 'form-control']); ?>

                                    </div>

                                    <div class="form-group">
                                        <label>Parent Page</label>
                                        <select name="parent" class="form-control">
                                            <option value="0">Choose a parent</option>
                                            <?php foreach($pagelist as $p): ?>
                                                <option value="<?php echo e($p->id); ?>" <?php if($p->id == $page->parent): ?> selected <?php endif; ?>><?php echo e($p->page_title); ?></option>
                                            <?php endforeach; ?>
                                        </select>
                                    </div>
        								
                    			</div>
                                <div class="col-md-4">
                                    
                                </div>

                                <div class="col-md-12">
                                    <div class="form-group">
                                        <?php echo Form::label('content', 'Description', ['class' => 'control-label']); ?>

                                        <?php echo Form::textarea('content', null, ['class' => 'form-control', 'rows' => '12', 'id' => 'editor1']); ?>

                                    </div>

                                    <div class="spinbox" data-initialize="spinbox" id="mySpinbox">
                                        <?php echo Form::label('order', 'Order of appearance', ['class' => 'control-label']); ?>

                                        <div class="clearfix"></div>
                                        <?php echo Form::text('order', null, ['class' => 'form-control input-mini spinbox-input']); ?>

                                        <div class="spinbox-buttons btn-group btn-group-vertical">
                                        <button type="button" class="btn btn-default spinbox-up btn-xs">
                                          <span class="glyphicon glyphicon-chevron-up"></span><span class="sr-only">Increase</span>
                                        </button>
                                        <button type="button" class="btn btn-default spinbox-down btn-xs">
                                          <span class="glyphicon glyphicon-chevron-down"></span><span class="sr-only">Decrease</span>
                                        </button>
                                      </div>
                                    </div>

                                    <h3>Metadata </h3>
                                    <div class="form-group">
                                        <?php echo Form::label('meta_title', 'Meta Title', ['class' => 'control-label']); ?>

                                        <?php echo Form::text('meta_title', null, ['class' => 'form-control', 'rows' => '12']); ?>

                                    </div>
                                    <div class="form-group">
                                        <?php echo Form::label('meta_keywords', 'Meta Keywords', ['class' => 'control-label']); ?>

                                        <?php echo Form::text('meta_keywords', null, ['class' => 'form-control', 'rows' => '12']); ?>

                                    </div>
                                    <div class="form-group">
                                        <?php echo Form::label('meta_desc', 'Meta Description', ['class' => 'control-label']); ?>

                                        <?php echo Form::textarea('meta_desc', null, ['class' => 'form-control', 'rows' => '12']); ?>

                                    </div>

                                    <div class="form-group text-right">
                                        <?php echo Form::submit('Submit', ['class' => 'btn btn-primary']); ?>

                                        
                                    </div>
                                </div>
                            <?php echo Form::close(); ?>

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

<?php $__env->startSection('scripts'); ?>
    <script type="text/javascript" src="<?php echo e(asset('/admin/js/ckeditor/ckeditor.js')); ?>"></script>
    <script>
        CKEDITOR.replace( 'editor1' );
    </script>
<?php $__env->stopSection(); ?>

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