@section('content')
{{Breadcrumb::withLinks($breadcrumbs)}}
{{Navigation::tabs($tabs)->withAttributes(['role' => 'tablist', 'class' => 'flags'])}} {{Form::open(['route' => 'admin.page.store', 'secure' => true])}}
{{ControlGroup::generate( Form::label('position', trans('admin.fields.position').":"), Form::select('position', $position_options, !is_null($parent) ? $parent->position : null, !is_null($parent) ? ['disabled' => true] : null) )}} @if (count($type_options)) {{ControlGroup::generate( Form::label('type', trans('admin.fields.type').":"), Form::select('type', [null => null] + $type_options) )}} @endif @foreach($tabs as $tab)
{{ControlGroup::generate( Form::label('title['.$tab['route'].']', trans('admin.fields.title').":"), Form::text('title['.$tab['route'].']') )}} {{ControlGroup::generate( Form::label('content['.$tab['route'].']', trans('admin.fields.content').":"), Form::textarea('content['.$tab['route'].']', null, ['rows' => 8, 'class' => 'redactor']) )}} @if (!is_null($parent)) {{Form::hidden('position', $parent->position)}} {{Form::hidden('parent', $parent->id)}} @endif
@endforeach
@if (Sentry::getUser()->hasAccess('admin.page.store')) {{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') $('form .input-daterange').datepicker({ autoclose: true, format: "dd.mm.yyyy", weekStart: 1, language: "sk" }); @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@stop