From 06e64936641c5d311e4238367486674fd210784d Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 27 Jul 2020 16:16:27 +0200 Subject: [PATCH] =?UTF-8?q?:lipstick:=20Ajoute=20des=20espaces=20ins=C3=A9?= =?UTF-8?q?cables=20et=20formate=20les=20prix=20et=20surfaces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajoute aussi des icônes pour faire joli Fix #10 Fix #9 --- app/Providers/AppServiceProvider.php | 7 +++ resources/views/homes/view.blade.php | 68 ++++++++++++++++++++++----- resources/views/public/view.blade.php | 60 +++++++++++++++++++---- 3 files changed, 113 insertions(+), 22 deletions(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 0f1ea4b..e050a4a 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -27,5 +27,12 @@ class AppServiceProvider extends ServiceProvider Str::macro('currency', static function ($price) { return sprintf('%s €', number_format($price, 0, ',', ' ')); }); + + Str::macro('surface', static function ($surface) { + if (empty($surface)) { + return ''; + } + return sprintf('%s m²', number_format($surface, 0, ',', ' ')); + }); } } diff --git a/resources/views/homes/view.blade.php b/resources/views/homes/view.blade.php index 006b0a0..513120d 100644 --- a/resources/views/homes/view.blade.php +++ b/resources/views/homes/view.blade.php @@ -53,19 +53,61 @@ {!! nl2br($home->description) !!} -
-

Informations :

-
Ville : {{ $home->city }}
-
Prix : {{ $home->price }}
-
Surface : {{ $home->surface }} m²
-
Nombre de pièces : {{ $home->rooms }}
-
-
-

Informations complémentaires :

-
Surface de jardin : {{ $home->garden_surface ?? '−' }}
-
Énergie : {{ $home->energy ?? '−' }}
-
GES : {{ $home->ges ?? '−' }}
-
+
+
+

+ + + + Informations +

+
+
+ + + + Ville : {{ $home->city }}
+
+ + + + Prix : {{ Str::currency($home->price) }}
+
+ + + + Surface : {{ Str::surface($home->surface) }}
+
+ + + + Pièces : {{ $home->rooms }}
+
+
+
+

+ + + + Informations complémentaires +

+
+
+ + + + Jardin : {{ Str::surface($home->garden_surface) }}
+
+ + + + Énergie : {{ $home->energy ?? '−' }}
+
+ + + + GES : {{ $home->ges ?? '−' }}
+
@if(!empty($home->slug)) @endif diff --git a/resources/views/public/view.blade.php b/resources/views/public/view.blade.php index 7e55720..c38ae20 100644 --- a/resources/views/public/view.blade.php +++ b/resources/views/public/view.blade.php @@ -49,17 +49,59 @@
-

Informations :

-
Ville : {{ $home->city }}
-
Prix : {{ $home->price }}
-
Surface : {{ $home->surface }} m²
-
Nombre de pièces : {{ $home->rooms }}
+
+

+ + + + Informations +

+
+
+ + + + Ville : {{ $home->city }}
+
+ + + + Prix : {{ Str::currency($home->price) }}
+
+ + + + Surface : {{ Str::surface($home->surface) }}
+
+ + + + Pièces : {{ $home->rooms }}
-

Informations complémentaires :

-
Surface de jardin : {{ $home->garden_surface ?? '−' }}
-
Énergie : {{ $home->energy ?? '−' }}
-
GES : {{ $home->ges ?? '−' }}
+
+

+ + + + Informations complémentaires +

+
+
+ + + + Jardin : {{ Str::surface($home->garden_surface) }}
+
+ + + + Énergie : {{ $home->energy ?? '−' }}
+
+ + + + GES : {{ $home->ges ?? '−' }}