@extends('admin.master')

@section('top')
  <div class="top-breadcrumb pull-left">
    <h5>添加图文</h5>
    <a href="{{ url('admin/photo-group?pid=' . $pid) }}" class="btn btn-xs btn-default goback">
      <i class="iconfont icon-back-copy"></i><span>返回列表</span>
    </a>
  </div>
@endsection

@section('content')
  {!! Form::open(['route' => 'admin.photo-group.store', 'class'=>'form-horizontal form-detail']) !!}
  <div class="tab-content">
    <div role="tabpanel" class="tab-pane active" id="home">
      <div class="tab-content">
        <div role="tabpanel" class="tab-pane active" id="language-{{ $managerLang }}">
          <div class="form-group form-item-required">
            <label class="col-sm-2 control-label label-width">分类：</label>
            <div class="col-sm-5">
              {!! Form::select('pid', ['' => '请选择'] + $category, $pid, ['class'=>'form-control']) !!}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label label-width">主标题：</label>
            <div class="col-sm-5">
              {!! Form::text("description[{$managerLang}][title]", '', ['class'=>'form-control']) !!}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label label-width">副标题：</label>
            <div class="col-sm-5">
              {!! Form::text("description[{$managerLang}][f_title]", '', ['class'=>'form-control']) !!}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label label-width">文字1：</label>
            <div class="col-sm-5">
              {!! Form::text("description[{$managerLang}][text1]", '', ['class'=>'form-control']) !!}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label label-width">文字2：</label>
            <div class="col-sm-5">
              {!! Form::text("description[{$managerLang}][text2]", '', ['class'=>'form-control']) !!}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label label-width">文字3：</label>
            <div class="col-sm-5">
              {!! Form::text("description[{$managerLang}][text3]", '', ['class'=>'form-control']) !!}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label label-width">图片：</label>
            <div class="col-sm-5">
              <div class="upload-wrap" data-name="description[{{ $managerLang }}][imgs][]">
                <div class="upload-wrap-btn">
                  <span class="btn btn-default" data-toggle="modal" data-target="#media-dialog-modal">媒体上传</span>
                  <span class="text-muted pl-10">(允许上传的媒体类型：jpg、gif、png)</span>
                </div>
                <ul id="picfram" class="upload-wrap-lists attachments clearfix"></ul>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label label-width">摘要：</label>
            <div class="col-sm-5">
              {!! Form::textarea("description[{$managerLang}][summary]", '', ['class'=>'form-control', 'rows'=>3]) !!}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label label-width">排序：</label>
            <div class="col-sm-5">
              {!! Form::number('orders', maxValue('photo-group'), ['class'=>'form-control']) !!}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label label-width">链接：</label>
            <div class="col-sm-5">
              {!! Form::text('url', '', ['class'=>'form-control']) !!}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label label-width">详细内容：</label>
            <div class="col-sm-10">
              {!! Form::textarea("description[{$managerLang}][content]", '', ['id'=>"editor-{$managerLang}", 'class'=>'len-full']) !!}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label label-width">发布状态：</label>
            <div class="col-sm-5">
              <div class="pretty-box">
                <div class="pretty p-default p-round p-smooth">
                  {!! Form::radio('flag', 1, true) !!}
                  <div class="state p-success-o"><label>发布</label></div>
                </div>
                <div class="pretty p-default p-round p-smooth">
                  {!! Form::radio('flag', 0, false) !!}
                  <div class="state p-success-o"><label>不发布</label></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="form-send-height">
      <div class="form-send-box">
        <div class="form-group">
          <label class="col-sm-3 control-label label-width"></label>
          <div class="col-sm-5">
            {!! Form::submit('提交', ['class'=>'btn btn-primary']) !!}
          </div>
        </div>
      </div>
    </div>
    {!! Form::close() !!}
    @endsection

    @section('foot')
      <script src="{{ asset('data/assets/js/ueditor/ueditor.config.js') }}"></script>
      <script src="{{ asset('data/assets/js/ueditor/ueditor.all.min.js') }}"></script>
      <script src="{{ asset('data/assets/js/ueditor/addCustomizeButton.js') }}"></script>
      <script type="text/javascript">
          $(function(){
              UE.getEditor('editor-' + '{{ config('managerLang')  }}');
              var list = document.getElementById("picfram");
              new Sortable(list, {
                  animation: 150,
              });
          });
      </script>
{{--媒体库 start--}}
@include('admin.common.media', ['type' => 'jpg,gif,png', 'multi' => true])
{{--媒体库 end--}}
@endsection