<?php $__env->startSection('content'); ?> <div class="row"> <div class="col-xs-12"> <?php echo Breadcrumb::withLinks($breadcrumbs); ?> </div> </div> <div class="row"> <div class="col-xs-12"> <div role="tabpanel"> <?php echo Navigation::tabs($tabs)->withAttributes(['role' => 'tablist', 'class' => 'flags']); ?> <?php echo Form::open(['route' => ['admin.page.update', $page->id], 'method' => 'PUT', 'secure' => true]); ?> <div class="tab-content"> <?php echo ControlGroup::generate( Form::label('position', trans('admin.fields.position').":"), Form::select('position', $position_options, !is_null($page->parent) ? $parent->position : $page->position, (!is_null($parent) || ($page->type=='books')) ? ['disabled' => true] : null) ); ?> <?php if(count($type_options)): ?> <?php echo ControlGroup::generate( Form::label('type', trans('admin.fields.type').":"), Form::select('type', [null => null] + $type_options, $page->type, ($page->type=='books' || $page->type=='terms' || $page->type=='privacy') ? ['disabled' => true] : null) ); ?> <?php endif; ?> <?php foreach($tabs as $tab): ?> <div role="tabpanel" class="tab-pane <?php echo $tab['active'] ? 'active' : ''; ?>" id="<?php echo $tab['route']; ?>"> <?php echo ControlGroup::generate( Form::label('title['.$tab['route'].']', trans('admin.fields.title').":"), Form::text('title['.$tab['route'].']', $page->title($tab['id'])) ); ?> <?php echo ControlGroup::generate( Form::label('content['.$tab['route'].']', trans('admin.fields.content').":"), Form::textarea('content['.$tab['route'].']', $page->content($tab['id']), ['rows' => 8, 'class' => 'redactor']) ); ?> <?php if(!is_null($page->parent)): ?> <?php echo Form::hidden('position', $parent->position); ?> <?php echo Form::hidden('parent', $parent->id); ?> <?php endif; ?> <?php if($page->type=='books'): ?> <?php echo Form::hidden('position', $page->position); ?> <?php echo Form::hidden('type', $page->type); ?> <?php endif; ?> <?php if($page->type=='terms' || $page->type=='privacy'): ?> <?php echo Form::hidden('type', $page->type); ?> <?php endif; ?> </div> <?php endforeach; ?> </div> <?php if(Sentry::getUser()->hasAccess('admin.page.update')): ?> <?php echo Button::success(trans('admin.buttons.store'))->prependIcon(Icon::ok())->submit(); ?> <?php echo Button::danger(trans('admin.buttons.cancel'))->prependIcon(Icon::remove())->asLinkTo(route('admin.page.index')); ?> <?php else: ?> <?php echo Button::primary(trans('admin.buttons.back'))->prependIcon(Icon::arrow_left())->asLinkTo(route('admin.page.index')); ?> <?php endif; ?> <?php echo Form::close(); ?> </div> </div> </div> <?php $__env->stopSection(); ?> <?php $__env->startSection('scripts'); ?> $('textarea.redactor').redactor({ imageUpload: '<?php echo route('admin.image.store'); ?>', uploadImageFields: {'_token': '<?php echo csrf_token(); ?>' }, fileUpload: '<?php echo route('admin.file.store'); ?>', uploadFileFields: {'_token': '<?php echo csrf_token(); ?>' }, buttons: ['formatting', 'bold', 'italic', 'deleted', 'underline', 'unorderedlist', 'orderedlist', 'outdent', 'indent', 'image', 'file', 'link', 'alignment', 'horizontalrule'], allowedTags: ['h1', 'h2', 'h3', 'strong', 'b', 'em', 'i', 'del', 'strike', 'u', 'ul', 'ol', 'li', 'img', 'a', 'table', 'tbody', 'thead', 'tfoot', 'tr', 'td', 'th', 'hr', 'br'], formatting: ['h1', 'h2', 'h3'], cleanStyleOnEnter: true, removeComments: true, removeDataAttr: true, paragraphize: false, replaceDivs: false, imageLink: false, linebreaks: true, plugins: ['table'], minHeight: 250, lang: 'sk' }); <?php $__env->stopSection(); ?>