@section('content')
{{Breadcrumb::withLinks($breadcrumbs)}}
{{Navigation::tabs($tabs)->withAttributes(['role' => 'tablist', 'class' => 'flags'])}} {{Form::open(['route' => ['admin.page.update', $page->id], 'method' => 'PUT', 'secure' => true])}}
{{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) )}} @if (count($type_options)) {{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) )}} @endif @foreach($tabs as $tab)
{{ControlGroup::generate( Form::label('title['.$tab['route'].']', trans('admin.fields.title').":"), Form::text('title['.$tab['route'].']', $page->title($tab['id'])) )}} {{ControlGroup::generate( Form::label('content['.$tab['route'].']', trans('admin.fields.content').":"), Form::textarea('content['.$tab['route'].']', $page->content($tab['id']), ['rows' => 8, 'class' => 'redactor']) )}} @if (!is_null($page->parent)) {{Form::hidden('position', $parent->position)}} {{Form::hidden('parent', $parent->id)}} @endif @if ($page->type=='books') {{Form::hidden('position', $page->position)}} {{Form::hidden('type', $page->type)}} @endif @if ($page->type=='terms' || $page->type=='privacy') {{Form::hidden('type', $page->type)}} @endif
@endforeach
@if (Sentry::getUser()->hasAccess('admin.page.update')) {{Button::success(trans('admin.buttons.store'))->prependIcon(Icon::ok())->submit()}} {{Button::danger(trans('admin.buttons.cancel'))->prependIcon(Icon::remove())->asLinkTo(route('admin.page.index'))}} @else {{Button::primary(trans('admin.buttons.back'))->prependIcon(Icon::arrow_left())->asLinkTo(route('admin.page.index'))}} @endif {{Form::close()}}
@stop @section('scripts') $('textarea.redactor').redactor({ imageUpload: '{{route('admin.image.store')}}', uploadImageFields: {'_token': '{{csrf_token()}}' }, fileUpload: '{{route('admin.file.store')}}', uploadFileFields: {'_token': '{{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' }); @stop