
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h5 class="modal-title">{{__('User')}}<span class="font-weight-light">{{__('create/edit')}}</span></h5>
</div>
{!! Form::open(['url' => route('admin_user_update_modal', ['user']), 'class' => 'form-horizontal']) !!}

<div class="modal-body">
    <input type="hidden" name="id" id="id" value="{{ $user->id }}">

    <div class="form-row">
        <div class="form-group col">
            <label for="email" class="form-label">{{__('E-Mail')}}</label>
            {{ Form::text('email', $user->email,  array('placeholder'=>__('E-Mail'), 'class'=>'form-control', 'readonly')) }}
        </div>
    </div>
<hr>
    <div class="form-row">
        <div class="form-group col">
            <label for="admin" class="form-label">{{__('Role')}}</label>
            <select class="selectpicker" data-style="btn-default" name="admin">
                {!!  HTMLHelper::getRolesOptions($user->admin) !!}
            </select>
        </div>
    </div>
    <hr>
    @foreach($groups as $role_id => $permissions)
        <h6>{{$roles[$role_id]}}</h6>
        @foreach($permissions as $key=>$val)
            <div class="form-group">
                <label class="custom-control custom-checkbox m-0">
                    {!! Form::checkbox('permissions['.$key.']', 1, $user->isPermission($key), ['class'=>'custom-control-input']) !!}
                    <span class="custom-control-label custom-control-label-{{$val['color']}}">{{$val['name']}}</span>
                </label>
            </div>
        @endforeach
        <hr>
    @endforeach
    <hr>
    <div class="form-group">
        <label class="custom-control custom-checkbox m-0">
            {!! Form::checkbox('confirmed', 1, $user->confirmed, ['class'=>'custom-control-input']) !!}
            <span class="custom-control-label">{{__('verified')}}</span>
        </label>
    </div>

    <div class="form-group">
        <label class="custom-control custom-checkbox m-0">
            {!! Form::checkbox('active', 1, $user->active, ['class'=>'custom-control-input']) !!}
            <span class="custom-control-label">{{__('active')}}</span>
        </label>
    </div>

</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">{{__('close')}}</button>
    <button type="submit" class="btn btn-primary">{{__('save')}}</button>
</div>
{!! Form::close() !!}