1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Edit client information

This commit is contained in:
David Bomba 2019-08-14 07:41:02 +10:00
parent b2f7740fa1
commit 60853a8510
6 changed files with 42 additions and 122 deletions

View File

@ -77,16 +77,16 @@ class Handler extends ExceptionHandler
{
return response()->json(['message'=>'Fatal error', 500]);
}
/* else if ($exception instanceof \Illuminate\Session\TokenMismatchException)
else if ($exception instanceof \Illuminate\Session\TokenMismatchException)
{
return redirect()
->back()
->withInput($request->except('password'))
->withInput($request->except('password', 'password_confirmation', '_token'))
->with([
'message' => ctrans('texts.token_expired'),
'message-type' => 'danger']);
}
*/
return parent::render($request, $exception);
}

View File

@ -90,14 +90,9 @@ class ProfileController extends Controller
return back();
}
public function settings()
public function updateClient(UpdateSettingsRequest $request, ClientContact $client_contact)
{
return view('portal.default.settings.index');
}
public function updateSettings(UpdateSettingsRequest $request)
{
dd("hi");
return back();
}
}

View File

@ -0,0 +1,34 @@
<div class="row">
<div class="col-sm-9" style="padding-bottom: 10px;">
{!! Former::framework('TwitterBootstrap4'); !!}
{!! Former::horizontal_open()
->id('update_settings')
->route('client.profile.update_settings', auth()->user()->hashed_id)
->method('PUT'); !!}
@csrf
<div class="card">
<div class="card-header">
{{ ctrans('texts.client_information') }}
</div>
<div class="card-body">
</div>
<div class="card-footer">
<button class="btn btn-primary pull-right">{{ ctrans('texts.save') }}</button>
</div>
{!! Former::close() !!}
</div>

View File

@ -100,6 +100,8 @@
</div>
@include('portal.default.profile.client_information')
</div>
</main>

View File

@ -1,110 +0,0 @@
@extends('portal.default.layouts.master')
@push('css')
<link href="/vendors/css/select2.min.css" rel="stylesheet">
<link href="/vendors/css/select2-bootstrap4.css" rel="stylesheet">
<style>
select {border: 1px solid !important;}
.select2-container--bootstrap4 .select2-selection--single
{
border: 1px solid #e4e7ea !important;
}
</style>
@endpush
@section('body')
<main class="main">
<div class="container-fluid">
<div class="row" style="padding-top: 30px;">
@if (Session::has('error'))
<div class="alert alert-danger">{!! Session::get('error') !!}</div>
@endif
<div class="col-sm-3" style="padding-bottom: 10px;">
{!! Former::framework('TwitterBootstrap4'); !!}
{!! Former::horizontal_open()
->id('update_settings')
->route('client.profile.update_settings', auth()->user()->hashed_id)
->method('PUT'); !!}
@csrf
<div class="card">
<div class="card-header">
<strong>{{ ctrans('texts.avatar') }}</strong>
</div>
<div class="card-body align-items-center">
@if(auth()->user()->avatar)
<img src="{{ auth()->user()->avatar }}" class="img-fluid">
@else
<i class="fa fa-user fa-5x"></i>
@endif
{!! Former::file('avatar')
->max(2, 'MB')
->accept('image')
->label('')
->inlineHelp(trans('texts.logo_help')) !!}
</div>
<div class="card-footer">
</div>
</div>
</div>
<div class="col-sm-6" style="padding-bottom: 10px;">
<div class="card">
<div class="card-header">
<strong> {{ ctrans('texts.user_details') }}</strong>
</div>
<div class="card-body">
{!! Former::text('first_name')->placeholder( ctrans('texts.first_name'))->label('')->value(auth()->user()->first_name)!!}
{!! Former::text('last_name')->placeholder( ctrans('texts.last_name'))->label('')->value(auth()->user()->last_name) !!}
{!! Former::text('email')->placeholder( ctrans('texts.email'))->label('')->value(auth()->user()->email) !!}
{!! Former::text('phone')->placeholder( ctrans('texts.phone'))->label('')->value(auth()->user()->phone) !!}
{!! Former::password('password')->placeholder( ctrans('texts.password'))->label('') !!}
{!! Former::password('password_confirmation')->placeholder( ctrans('texts.confirm_password'))->label('') !!}
</div>
<div class="card-footer">
<button class="btn btn-primary pull-right">{{ ctrans('texts.save') }}</button>
</div>
</div>
{!! Former::close() !!}
</div>
</div>
</div>
</main>
</body>
@endsection

View File

@ -18,8 +18,7 @@ Route::group(['middleware' => ['auth:contact'], 'prefix' => 'client', 'as' => 'c
Route::get('invoices', 'ClientPortal\InvoiceController@index')->name('invoices.index'); // name = (dashboard. index / create / show / update / destroy / edit
Route::get('profile/{client_contact}/edit', 'ClientPortal\ProfileController@edit')->name('profile.edit');
Route::put('profile/{client_contact}/edit', 'ClientPortal\ProfileController@update')->name('profile.update');
Route::get('profile/{client_contact}/settings', 'ClientPortal\ProfileController@settings')->name('profile.settings');
Route::put('profile/{client_contact}/settings', 'ClientPortal\ProfileController@updateSettings')->name('profile.update_settings');
Route::put('profile/{client_contact}/edit_client', 'ClientPortal\ProfileController@updateClient')->name('profile.edit_client');
Route::post('document', 'ClientPortal\DocumentController@store')->name('document.store');
Route::delete('document', 'ClientPortal\DocumentController@destroy')->name('document.destroy');