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

Manage Frontend Users

@if($canView)
@endif
{!! Form::model($user) !!}
{!! Form::text('name', $user->name, array( 'id' => 'name_input', 'class' => 'form-control', 'maxlength' => '100', 'data-toggle' => ($errors->has('name') ? 'tooltip': null), 'title' => ($errors->has('name') ? $errors->first('name'): null), 'disabled' => $canManage ? null : 'disabled')) !!}
{!! Form::text('lastName', $user->last_name, array( 'id' => 'lastName_input', 'class' => 'form-control', 'maxlength' => '100', 'data-toggle' => ($errors->has('lastName') ? 'tooltip': null), 'title' => ($errors->has('lastName') ? $errors->first('lastName'): null), 'disabled' => $canManage ? null : 'disabled')) !!}
{!! Form::text('email', $user->email, array( 'id' => 'email_input', 'class' => 'form-control', 'maxlength' => '100', 'data-toggle' => ($errors->has('email') ? 'tooltip': null), 'title' => ($errors->has('email') ? $errors->first('email'): null), 'readonly' => 'readonly')) !!}
{!! Form::text('department', $user->department, array( 'id' => 'department_input', 'class' => 'form-control', 'maxlength' => '20', 'data-toggle' => ($errors->has('department') ? 'tooltip': null), 'title' => ($errors->has('department') ? $errors->first('department'): null), 'disabled' => $canManage ? null : 'disabled')) !!}
{!! Form::text('function', $user->function, array( 'id' => 'function_input', 'class' => 'form-control', 'maxlength' => '250', 'data-toggle' => ($errors->has('function') ? 'tooltip': null), 'title' => ($errors->has('function') ? $errors->first('function'): null), 'disabled' => $canManage ? null : 'disabled')) !!}
{!! Form::text('phoneNumber', $user->phone_number, array( 'id' => 'phoneNumber_input', 'class' => 'form-control', 'maxlength' => '20', 'data-toggle' => ($errors->has('phoneNumber') ? 'tooltip': null), 'title' => ($errors->has('phoneNumber') ? $errors->first('phoneNumber'): null), 'disabled' => $canManage ? null : 'disabled')) !!}
{!! Form::password('password', array( 'id' => 'password_input', 'class' => 'form-control', 'maxlength' => '30', 'data-toggle' => ($errors->has('password') ? 'tooltip': null), 'title' => ($errors->has('password') ? $errors->first('password'): null))) !!}
@if ($user->state !== 'pendingEmailValidation')
state === 'active' ? 'checked' : '' }}>
state === 'inactive' ? 'checked' : '' }}>
@endif
@php $optionsArr = ['id' => 'legal-opinion-permission', 'class' => 'form-check-input', 'data-role' => 'legal-opinion-permission']; @endphp {{ Form::checkbox('legal_opinion_permission', '1', $user->legal_opinion_permission, $optionsArr) }}
@if ($permissionFinanceSubCommittee)
@php $optionsArr = ['id' => 'finance-sub-committee-permission', 'class' => 'form-check-input', 'data-role' => 'finance-sub-committee-permission']; @endphp {{ Form::checkbox('finance_sub_committee_permission', '1', $user->finance_sub_committee_permission, $optionsArr) }}
@endif
@if (!empty($user->image))
@endif
@php $index = 1; @endphp @foreach ($listCommittees as $committee)
@php $isSelectedCommittee = collect($committees)->contains(function ($com) use ($committee) { return $com['id'] == $committee->id; }); $selectedCommitteeType = $isSelectedCommittee ? collect($committees)->firstWhere('id', $committee->id)['type'] : null; @endphp
id) ? 'checked' : '' }}>
id) == 'to') ? 'checked' : '' }}>
id) == 'cc') ? 'checked' : '' }}>
@foreach ($committee->workGroups as $workGroup)
@php $isSelected = collect($workGroups)->contains(function ($wg) use ($workGroup) { return $wg['id'] == $workGroup->id; }); $selectedType = $isSelected ? collect($workGroups)->firstWhere('id', $workGroup->id)['type'] : null; @endphp id) ? 'checked' : '' }}>
id) == 'to') ? 'checked' : '' }}>
id) == 'cc') ? 'checked' : '' }}>
@php $index++; @endphp
@endforeach
@endforeach
@if($canEdit)
{!! Form::submit(Lang::get('backend.save'), array('class' => 'btn btn-primary', 'id' => 'user_save_btn')) !!}
@endif {!! Form::close() !!}
@stop