@extends('admin.layouts.main',array( 'scripts' => array( path_asset('path.backoffice.js_path') . '/view/user/backend-user-form.js' ) )) @section('content')

{{ trans('backend.manage_user') }}

@if($canView)
@endif
{!! Form::model($user) !!}
{!! Form::text('username', null, array( 'id' => 'username_input', 'class' => 'form-control', 'maxlength' => '20', 'data-toggle' => ($errors->has('username') ? 'tooltip': null), 'title' => ($errors->has('username') ? $errors->first('username'): null), 'disabled' => $canEdit ? null : 'disabled')) !!}
{!! Form::text('email', null, array( 'id' => 'email_input', 'class' => 'form-control', 'maxlength' => '100', 'data-toggle' => ($errors->has('email') ? 'tooltip': null), 'title' => ($errors->has('email') ? $errors->first('email'): null), 'disabled' => $canManage ? null : 'disabled')) !!}
{!! Form::text('first_name', null, array( 'id' => 'first_name_input', 'class' => 'form-control', 'maxlength' => '50', 'data-toggle' => ($errors->has('first_name') ? 'tooltip': null), 'title' => ($errors->has('first_name') ? $errors->first('first_name'): null), 'disabled' => $canManage ? null : 'disabled')) !!}
{!! Form::text('last_name', null, array( 'id' => 'last_name_input', 'class' => 'form-control', 'maxlength' => '50', 'data-toggle' => ($errors->has('last_name') ? 'tooltip': null), 'title' => ($errors->has('last_name') ? $errors->first('last_name'): null), 'disabled' => $canManage ? null : 'disabled')) !!}
@if($canEdit)
{!! Form::password('password', array( 'id' => 'password_input', 'class' => 'form-control', 'maxlength' => '20', 'data-toggle' => ($errors->has('password') ? 'tooltip': null), 'title' => ($errors->has('password') ? $errors->first('password'): null))) !!}
{!! Form::password('password_confirmation', array( 'id' => 'password_conf_input', 'class' => 'form-control', 'maxlength' => '20')) !!}
@endif
{!! Form::text('location', null, array( 'id' => 'location_input', 'class' => 'form-control', 'maxlength' => '100', 'data-toggle' => ($errors->has('location') ? 'tooltip': null), 'title' => ($errors->has('location') ? $errors->first('location'): null), 'disabled' => $canManage ? null : 'disabled')) !!}
{!! Form::text('contact_1', null, array( 'id' => 'contact_1_input', 'class' => 'form-control', 'maxlength' => '40', 'data-toggle' => ($errors->has('contact_1') ? 'tooltip': null), 'title' => ($errors->has('contact_1') ? $errors->first('contact_1'): null), 'disabled' => $canManage ? null : 'disabled')) !!}
{!! Form::text('contact_2', null, array( 'id' => 'contact_2_input', 'class' => 'form-control', 'maxlength' => '40', 'data-toggle' => ($errors->has('contact_2') ? 'tooltip': null), 'title' => ($errors->has('contact_2') ? $errors->first('contact_2'): null), 'disabled' => $canManage ? null : 'disabled')) !!}
{!! Form::text('role', null, array( 'id' => 'role_input', 'class' => 'form-control', 'maxlength' => '50', 'data-toggle' => ($errors->has('role') ? 'tooltip': null), 'title' => ($errors->has('role') ? $errors->first('role'): null), 'disabled' => $canManage ? null : 'disabled')) !!}
{!! Form::select('type_id', $userTypes, null, array( 'id' => 'type_id_input', 'class' => 'form-control', 'data-toggle' => ($errors->has('type_id') ? 'tooltip': null), 'title' => ($errors->has('type_id') ? $errors->first('type_id'): null), 'disabled' => $canManage ? null : 'disabled')) !!}

{{ trans('backend.user_permissions') }}

@foreach($permissions as $permissionGroup)

{{$permissionGroup->name}}

@if($canManage) {{ trans('backend.select_unselect_all') }} @endif
@foreach($permissionGroup->permissions as $permission)
@endforeach
@endforeach
@if($canEdit)
{!! Form::submit(Lang::get('backend.save'), array('class' => 'btn btn-primary', 'id' => 'user_save_btn')) !!}
@endif {!! Form::close() !!}
@stop