{{-- CityHub - Add / edit user --}}
{{ Form::open(array('route' => $postRoute, 'role' => 'form', 'class' => 'form-horizontal', 'autocomplete' => 'off', 'id' => 'user-form')) }}

{{ $title }}


@if ($mode == 'edit') {{ Form::hidden('id', $user->id, array('id' => 'id')) }} @endif
{{ Form::text('email', isset($user->email) ? $user->email : null, array('id' => 'email', 'class' => 'form-control')) }} @if (isset($errors) && ($errors->first('email') != '' || $errors->first('email') != null))

{{ $errors->first('email') }}

@endif
@if ($mode == 'add') {{ Form::password('password', array('id' => 'password', 'class' => 'form-control')) }} @else {{ Form::password('password', array('id' => 'password', 'class' => 'form-control')) }} @endif @if (isset($errors) && ($errors->first('password') != '' || $errors->first('password') != null))

{{ $errors->first('password') }}

@endif
@if ($superadmin == true)
@endif
{{ Form::text('first_name', isset($user->first_name) ? $user->first_name : null, array('id' => 'first_name', 'class' => 'form-control')) }} @if (isset($errors) && ($errors->first('first_name') != '' || $errors->first('first_name') != null))

{{ $errors->first('first_name') }}

@endif
{{ Form::text('last_name', isset($user->last_name) ? $user->last_name : null, array('id' => 'last_name', 'class' => 'form-control')) }} @if (isset($errors) && ($errors->first('last_name') != '' || $errors->first('last_name') != null))

{{ $errors->first('last_name') }}

@endif
{{ Form::text('address', isset($user->address) ? $user->address : null, array('id' => 'address', 'class' => 'form-control')) }} @if (isset($errors) && ($errors->first('address') != '' || $errors->first('address') != null))

{{ $errors->first('address') }}

@endif
{{ Form::text('city', isset($user->city) ? $user->city : null, array('id' => 'city', 'class' => 'form-control')) }} @if (isset($errors) && ($errors->first('city') != '' || $errors->first('city') != null))

{{ $errors->first('city') }}

@endif
{{ Form::text('phone', isset($user->phone) ? $user->phone : null, array('id' => 'phone', 'class' => 'form-control')) }} @if (isset($errors) && ($errors->first('phone') != '' || $errors->first('phone') != null))

{{ $errors->first('phone') }}

@endif

{{ Form::text('job_title', isset($user->job_title) ? $user->job_title : null, array('id' => 'job_title', 'class' => 'form-control')) }} @if (isset($errors) && ($errors->first('job_title') != '' || $errors->first('job_title') != null))

{{ $errors->first('job_title') }}

@endif
{{ Form::textarea('biography', isset($user->biography) ? $user->biography : null, array('id' => 'biography', 'class' => 'form-control')) }} @if (isset($errors) && ($errors->first('biography') != '' || $errors->first('biography') != null))

{{ $errors->first('biography') }}

@endif

@if ($mode == 'edit')

{{ Lang::get('user.label_facebook_id') }}: {{ Lang::get('core.not_connected') }}

{{ Lang::get('user.label_google_id') }}: {{ Lang::get('core.not_connected') }}


@endif
{{ Form::select('language', $languages, isset($user->language_id) ? $user->language_id : null, array('id' => 'language', 'class' => 'form-control')) }} @if (isset($errors) && ($errors->first('language') != '' || $errors->first('language') != null))

{{ $errors->first('language') }}

@endif
{{ Form::select('role', $roles, isset($user->role_id) ? $user->role_id : null, array('id' => 'role', 'class' => 'form-control')) }} @if (isset($errors) && ($errors->first('role') != '' || $errors->first('role') != null))

{{ $errors->first('role') }}

@endif
@foreach ($cities as $city)
@endforeach

{{ Lang::get('user.cities_warning') }}

@if (isset($errors) && ($errors->first('cities') != '' || $errors->first('cities') != null))

{{ $errors->first('cities') }}

@endif

{{ Lang::get('core.cancel') }} {{ Form::button(' ' . Lang::get('core.save'), array('type' => 'submit', 'class' => 'btn btn-success')) }}
{{ Form::close() }}