From b6821d52a71dd679fc96afc304e82ddc0f1838ee Mon Sep 17 00:00:00 2001 From: Ludovic CANDELLIER Date: Thu, 22 Dec 2022 18:16:25 +0100 Subject: [PATCH] fix --- .../Controllers/Shop/CustomerController.php | 10 ++++++- build/css/site.css | 3 ++ resources/views/Shop/Customers/edit.blade.php | 25 +++++++++++++++++ .../Customers/partials/addresses.blade.php | 21 ++++++++++++++ .../Shop/Customers/partials/user.blade.php | 3 ++ .../auth/passwords/change_password.blade.php | 23 +-------------- .../passwords/password_confirmation.blade.php | 22 +++++++++++++++ .../views/components/form/input.blade.php | 28 ++++++++++++++----- .../views/components/form/label.blade.php | 6 ++++ 9 files changed, 111 insertions(+), 30 deletions(-) create mode 100644 resources/views/Shop/Customers/edit.blade.php create mode 100644 resources/views/Shop/Customers/partials/addresses.blade.php create mode 100644 resources/views/Shop/auth/passwords/password_confirmation.blade.php create mode 100644 resources/views/components/form/label.blade.php diff --git a/app/Http/Controllers/Shop/CustomerController.php b/app/Http/Controllers/Shop/CustomerController.php index 29c0ea33..4649fdd2 100644 --- a/app/Http/Controllers/Shop/CustomerController.php +++ b/app/Http/Controllers/Shop/CustomerController.php @@ -6,6 +6,7 @@ use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Repositories\Shop\Customers; +use Illuminate\Support\Facades\Auth; class CustomerController extends Controller { @@ -17,10 +18,17 @@ class CustomerController extends Controller public function modalProfile($id = false) { - $data['old'] = Customers::get($id); + $data['customer'] = Customers::get($id); return view('Shop.Customers.partials.registration', $data); } + public function edit() + { + $id = Auth::id(); + $data['customer'] = Customers::get($id); + return view('Shop.Customers.edit', $data); + } + public function storeProfileAjax(Request $request) { $data = $request->all(); diff --git a/build/css/site.css b/build/css/site.css index 7c931492..b1ba35c5 100644 --- a/build/css/site.css +++ b/build/css/site.css @@ -9,7 +9,10 @@ body { background: linear-gradient(180deg, rgba(52,91,71,1) 0%, rgba(45,81,63,1) 10%, rgba(24,48,39,1) 90%, rgba(28,54,45,1) 100%); background-size: cover; background-attachment: fixed; +} +label { + margin-top: 0.5rem; } .gradient-green1 { diff --git a/resources/views/Shop/Customers/edit.blade.php b/resources/views/Shop/Customers/edit.blade.php new file mode 100644 index 00000000..42872289 --- /dev/null +++ b/resources/views/Shop/Customers/edit.blade.php @@ -0,0 +1,25 @@ +@extends('Shop.layout.layout', [ + 'title' => __('Editer son profil'), +]) + +@section('content') +
+
+ + @include('Shop.Customers.partials.registration') + +
+
+ + @include('Shop.Customers.partials.addresses') + + + + @include('Shop.auth.passwords.password_confirmation') + +
+ +
+@endsection + +@include('load.layout.modal') diff --git a/resources/views/Shop/Customers/partials/addresses.blade.php b/resources/views/Shop/Customers/partials/addresses.blade.php new file mode 100644 index 00000000..ba8d223d --- /dev/null +++ b/resources/views/Shop/Customers/partials/addresses.blade.php @@ -0,0 +1,21 @@ +@foreach ($addresses ?? [] as $address) +
+
+ +
+
+ {{ $address['address'] }}
+ @if ($address['address2']) + {{ $address['address2'] }}
+ @endif + {{ $address['zipcode'] }} {{ $address['city'] }} +
+
+@endforeach + +
+
+ +
+
+ diff --git a/resources/views/Shop/Customers/partials/user.blade.php b/resources/views/Shop/Customers/partials/user.blade.php index 1af04e43..c68bc066 100644 --- a/resources/views/Shop/Customers/partials/user.blade.php +++ b/resources/views/Shop/Customers/partials/user.blade.php @@ -27,11 +27,14 @@ @push('js') @endpush \ No newline at end of file diff --git a/resources/views/Shop/auth/passwords/change_password.blade.php b/resources/views/Shop/auth/passwords/change_password.blade.php index 9acd1569..6853ee6e 100644 --- a/resources/views/Shop/auth/passwords/change_password.blade.php +++ b/resources/views/Shop/auth/passwords/change_password.blade.php @@ -13,28 +13,7 @@
-
- -
- -
-
- -
- - -
- -
-
- -
- - -
- -
-
+ @include('Shop.auth.passwords.password_confirmation')