<div id="single-picker-{{$id}}" class="form-group single-picker-wrapper {{ $blocksMode ? "blocks-mode--$blocksMode" : 'blocks-mode--hide' }}" style="{{ !empty($hide) ? 'display:none' : '' }}" data-form-id="generic_form_{{RequestContext::get('generic_form_timestamp')}}">
    {!! Form::hidden($name, '', array('id' => $id, 'class' => 'single-picker-values')) !!}
    {!! Form::label($id, ucfirst($label), array('class' => 'control-label')) !!}
    <button type="button" class="btn btn-xs btn-default command-add-item pull-right" title="">
        <span class="icon glyphicon glyphicon-plus"></span>
    </button>
    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-default picker-panel single-picker-list">
                <ol class="list-group"></ol>
            </div>
        </div>
    </div>
    @if(!empty($info))
        <span id="helpBlock" class="help-block">{{ $info }}</span>
    @endif
</div>

<script>
    $(function(){
        new Eae.View.BackendSinglePicker({
            el: $("[data-form-id='generic_form_{{RequestContext::get('generic_form_timestamp')}}']#single-picker-{{$id}}"),
            list: @json($list),
            order: @json($order),
            disabled: {{ $enabled ? 'false': 'true' }},
            parentId: {{ $parentId }},
            parentContentType: '{{ $parentContentType }}',
            parentFieldName: '{{ $name }}',
            parent:  {!! empty($parent) ? 'false': json_encode($parent) !!},
            contentType: {
                label:  '{{ $childContentType->getSingularLabel() }}',
                type: '{{ $childContentType->getType() }}'
            },
            @if($maxSize)
                maxSize: {{ $maxSize }}
            @endif
        });
    });
</script>


