@extends('admin.master')

@section('top')
    <div class="top-breadcrumb pull-left">
        <h5>修改成员</h5>
        <a class="btn btn-xs btn-default goback" onclick="javascript:history.go(-1);">
            <i class="iconfont icon-back-copy"></i><span>返回</span>
        </a>
    </div>
@endsection

@section('content')
    {!! Form::model($user, ['route' => ['admin.team.user.update', $user->id], 'method'=>'put', 'class'=>'form-horizontal form-detail']) !!}
    <div class="tab-content">
        <div role="tabpanel" class="tab-pane in active" id="home">
            <div class="tab-content">
                <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="icon">
                            <div class="upload-wrap-btn {{ $user->icon ? 'display-none' : ''}}">
                                <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">
                                @if($user->icon != '')
                                    <li class="thumbnail" data-img="{{ $user->icon }}" >
                                        <input name="img" value="{{ $user->icon }}" type="hidden">
                                        <a class="thumbnail-img"><img src="{{ url($user->icon) }}"></a>
                                        <a class="thumbnail-remove" data-id="fileupload" href="javascript:;">删除</a>
                                    </li>
                                @endif
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label label-width">团队：</label>
                    <div class="col-sm-5">
                        {!! Form::select('team_id', ['请选择'] + $team, $user->team_id, ['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="pretty-box">
                            <div class="pretty p-default p-round p-smooth">
                                {!! Form::radio('is_manager', 1, null) !!}
                                <div class="state p-success-o"><label>开启</label></div>
                            </div>
                            <div class="pretty p-default p-round p-smooth">
                                {!! Form::radio('is_manager', 0, null) !!}
                                <div class="state p-success-o"><label>关闭</label></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group form-item-required">
                    <label class="col-sm-2 control-label label-width">用户名：</label>
                    <div class="col-sm-5">
                        {!! Form::text("username", null, ['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("password", '', ['class'=>'form-control']) !!}
                    </div>
                </div>
                <div class="form-group form-item-required">
                    <label class="col-sm-2 control-label label-width">姓名：</label>
                    <div class="col-sm-5">
                        {!! Form::text("name", null, ['class'=>'form-control']) !!}
                    </div>
                </div>
                <div class="form-group form-item-required">
                    <label class="col-sm-2 control-label label-width">职位：</label>
                    <div class="col-sm-5">
                        {!! Form::text("position", null, ['class'=>'form-control']) !!}
                    </div>
                </div>
                <div class="form-group form-item-required">
                    <label class="col-sm-2 control-label label-width">邮箱：</label>
                    <div class="col-sm-5">
                        {!! Form::text("email", null, ['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("phone", null, ['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("address", null, ['class'=>'form-control']) !!}
                    </div>
                </div>
                <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/selectize.js') }}"></script>
{{--媒体库 start--}}
@include('admin.common.media', ['type' => 'jpg,gif,png'])
{{--媒体库 end--}}
@endsection