@extends('adminlte::page')
@section('content')
@if ($errors->any())
<div class="row">
    <div class="alert alert-danger">
        <ul>
            @foreach ($errors->all() as $error)
            <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
</div>
@endif
<fieldset class="form-horizontal  create post">
    {!! Form::open( array( 'url' => URL::route('admin\page-store'), 'method' => 'POST', 'class' =>
    'form-horizontal', 'role'=>'form',
    'files' => true ) ) !!}
    <div class="form-group odd">
        {!! Form::label('title_ba', '*'.Lang::get('common.title'), array('class'=>'col-sm-2 control-label')) !!}
        <div class="col-md-6 col-lg-4">
            {!! Form::text('title_ba', '', array('class' => 'form-control', 'maxlength' => 128)) !!}
        </div>
    </div>
    <div class="form-group odd">
        {!! Form::label('title_en', '*'.Lang::get('common.title_en'), array('class'=>'col-sm-2 control-label')) !!}
        <div class="col-md-6 col-lg-4">
            {!! Form::text('title_en', '', array('class' => 'form-control', 'maxlength' => 128)) !!}
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    <div class="form-group">
        {!! Form::label('pid', Lang::get('common.pid'), array('class'=>'col-sm-2 control-label')) !!}
        <div class="col-sm-10 col-md-3">
            {!! Form::select('pid', $menupages, '', array('class' => 'form-control')) !!}
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    <div class="form-group">
        {!! Form::label('link', Lang::get('Link'), array('class'=>'col-sm-2 control-label')) !!}
        <div class="col-xs-12 col-sm-6 col-md-5">
            {!! Form::text('link', '', array('class' => 'form-control', 'maxlength' => 255)) !!}
            <p class="help-block">Obavezno u slučaju odabira internog ili eksternog linka sa {!!
                Lang::get('admin.menu_link_type') !!}</p>
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    <div class="hr-line-dashed"></div>
    <div class="form-group odd">
        {!! Form::label('f_image', Lang::get('Slika'), array('class'=>'col-sm-2 control-label')) !!}
        <div class="col-xs-12 col-sm-7 col-md-5">
            <img id="preview" src="#" />
            <div class="fileupload fileupload-new" data-provides="fileupload">
                <div class="fileupload-preview thumbnail"></div>
                <div class="upload-image-admin">
                    <span class="btn btn-primary btn-file">
                        <label for="inputImg" class="fileupload-new mb-0">{!! Lang::get('Izaberi sliku') !!}</label>
                        <input type="file" id="inputImg" name="image">
                    </span>
                </div>
            </div>
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    <div class="hr-line-dashed"></div>
    <div class="form-group">
        {!! Form::label('description_ba', Lang::get('common.description'), array('class'=>'col-sm-2 control-label')) !!}
        <div class="col-xs-12 col-sm-9 col-md-9">
            {!! Form::textarea('description_ba', '', array('class'=>'form-control vresize', 'rows' => 7, 'cols'=> 1))
            !!}
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    <div class="hr-line-dashed"></div>
    <div class="form-group">
        {!! Form::label('description_en', Lang::get('common.description_en'), array('class'=>'col-sm-2 control-label'))
        !!}
        <div class="col-xs-12 col-sm-9 col-md-9">
            {!! Form::textarea('description_en', '', array('class'=>'form-control vresize', 'rows' => 7, 'cols'=> 1))
            !!}
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    <div class="hr-line-dashed"></div>
    <div class="form-group odd">
        {!! Form::label('content_ba', '*'.Lang::get('common.content'), array('class'=>'col-sm-2 control-label')) !!}
        <div class="col-xs-12 col-sm-9 col-md-9">
            {!! Form::textarea('content_ba', '', array('class'=>'form-control textarea-tinymce', 'rows' => 15, 'cols'=>
            1)) !!}
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    <div class="hr-line-dashed"></div>
    <div class="form-group odd">
        {!! Form::label('content_en', '*'.Lang::get('common.content_en'), array('class'=>'col-sm-2 control-label')) !!}
        <div class="col-xs-12 col-sm-9 col-md-9">
            {!! Form::textarea('content_en', '', array('class'=>'form-control textarea-tinymce', 'rows' => 15, 'cols'=>
            1)) !!}
        </div>
    </div>
    <div class="form-group odd">
        {!! Form::label('position', '*'.Lang::get('common.position'), array('class'=>'col-sm-2 control-label')) !!}
        <div class="col-md-6 col-lg-4">
            {!! Form::text('position', '', array('class' => 'form-control', 'type' => 'integer')) !!}
        </div>
    </div>
    <div class="form-group odd">
        <label for="status_id" class="col-sm-2 control-label">Objavljeno</label>
        <div class="col-xs-12 col-sm-9 col-md-9">
            <select class="form-control m-bot15" name="status_id">
                <option value=1>Objavljeno</option>
                <option value=2>Neobjavljeno</option>
            </select>
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    <div class="hr-line-dashed"></div>
    <div class="form-group">
        <div class="col-sm-10 col-sm-offset-2">
            {!! Form::submit(Lang::get('Potvrdi'), array('class' => 'btn btn-primary')) !!}
        </div>
    </div>
    {!! Form::close() !!}
</fieldset>
@endsection
@section('js')
<script src="https://cdn.tiny.cloud/1/mypjlpl0ll198jkom1nivwr7g17mj8g5oefvob9eqey6bvy5/tinymce/5/tinymce.min.js"
    referrerpolicy="origin"></script>
<script>
    tinymce.init({
    selector:'textarea',
    width: 900,
    height: 300
    });
</script>
@endsection
