💄 Ajoute des espaces insécables et formate les prix et surfaces

Ajoute aussi des icônes pour faire joli
Fix #10
Fix #9
This commit is contained in:
Clement 2020-07-27 16:16:27 +02:00
parent 842aae0094
commit 06e6493664
3 changed files with 113 additions and 22 deletions

View File

@ -27,5 +27,12 @@ class AppServiceProvider extends ServiceProvider
Str::macro('currency', static function ($price) { Str::macro('currency', static function ($price) {
return sprintf('%s €', number_format($price, 0, ',', ' ')); 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, ',', ' '));
});
} }
} }

View File

@ -54,17 +54,59 @@
</div> </div>
</div> </div>
<div class="row mb-4"> <div class="row mb-4">
<div class="col-lg-12"><h3>Informations :</h3></div> <div class="col-lg-12">
<div class="col-lg-3"><strong>Ville : </strong> {{ $home->city }}</div> <h3>
<div class="col-lg-3"><strong>Prix : </strong> {{ $home->price }}</div> <svg class="bi" width="32" height="32" fill="currentColor">
<div class="col-lg-3"><strong>Surface : </strong> {{ $home->surface }} </div> <use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#exclamation-circle"/>
<div class="col-lg-3"><strong>Nombre de pièces : </strong>{{ $home->rooms }}</div> </svg>
Informations
</h3>
</div>
<div class="col-lg-3">
<svg class="bi" width="16" height="16" fill="currentColor">
<use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#bullseye"/>
</svg>
<strong>Ville&nbsp;: </strong> {{ $home->city }}</div>
<div class="col-lg-3">
<svg class="bi" width="16" height="16" fill="currentColor">
<use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#calculator-fill"/>
</svg>
<strong>Prix&nbsp;: </strong> {{ Str::currency($home->price) }}</div>
<div class="col-lg-3">
<svg class="bi" width="16" height="16" fill="currentColor">
<use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#house"/>
</svg>
<strong>Surface&nbsp;: </strong> {{ Str::surface($home->surface) }}</div>
<div class="col-lg-3">
<svg class="bi" width="16" height="16" fill="currentColor">
<use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#grid-3x3"/>
</svg>
<strong>Pièces&nbsp;: </strong>{{ $home->rooms }}</div>
</div> </div>
<div class="row mb-4"> <div class="row mb-4">
<div class="col-lg-12"><h3>Informations complémentaires :</h3></div> <div class="col-lg-12">
<div class="col-lg-3"><strong>Surface de jardin : </strong> {{ $home->garden_surface ?? '' }}</div> <h3>
<div class="col-lg-3"><strong>Énergie : </strong> {{ $home->energy ?? '' }}</div> <svg class="bi" width="32" height="32" fill="currentColor">
<div class="col-lg-3"><strong>GES : </strong> {{ $home->ges ?? '' }}</div> <use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#info-circle"/>
</svg>
Informations complémentaires
</h3>
</div>
<div class="col-lg-3">
<svg class="bi" width="16" height="16" fill="currentColor">
<use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#hexagon"/>
</svg>
<strong>Jardin&nbsp;: </strong> {{ Str::surface($home->garden_surface) }}</div>
<div class="col-lg-3">
<svg class="bi" width="16" height="16" fill="currentColor">
<use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#lightning"/>
</svg>
<strong>Énergie&nbsp;: </strong> {{ $home->energy ?? '' }}</div>
<div class="col-lg-3">
<svg class="bi" width="16" height="16" fill="currentColor">
<use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#life-preserver"/>
</svg>
<strong>GES&nbsp;: </strong> {{ $home->ges ?? '' }}</div>
</div> </div>
<div class="row"> <div class="row">
@if(!empty($home->slug)) <div class="col-lg-3"><a href="{{ route('public.view', $home->slug) }}" class="btn btn-light">Lien public</a></div>@endif @if(!empty($home->slug)) <div class="col-lg-3"><a href="{{ route('public.view', $home->slug) }}" class="btn btn-light">Lien public</a></div>@endif

View File

@ -49,17 +49,59 @@
</div> </div>
</div> </div>
<div class="row mb-4"> <div class="row mb-4">
<div class="col-lg-12"><h3>Informations :</h3></div> <div class="col-lg-12">
<div class="col-lg-3"><strong>Ville : </strong> {{ $home->city }}</div> <h3>
<div class="col-lg-3"><strong>Prix : </strong> {{ $home->price }}</div> <svg class="bi" width="32" height="32" fill="currentColor">
<div class="col-lg-3"><strong>Surface : </strong> {{ $home->surface }} </div> <use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#exclamation-circle"/>
<div class="col-lg-3"><strong>Nombre de pièces : </strong>{{ $home->rooms }}</div> </svg>
Informations
</h3>
</div>
<div class="col-lg-3">
<svg class="bi" width="16" height="16" fill="currentColor">
<use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#bullseye"/>
</svg>
<strong>Ville&nbsp;: </strong> {{ $home->city }}</div>
<div class="col-lg-3">
<svg class="bi" width="16" height="16" fill="currentColor">
<use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#calculator-fill"/>
</svg>
<strong>Prix&nbsp;: </strong> {{ Str::currency($home->price) }}</div>
<div class="col-lg-3">
<svg class="bi" width="16" height="16" fill="currentColor">
<use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#house"/>
</svg>
<strong>Surface&nbsp;: </strong> {{ Str::surface($home->surface) }}</div>
<div class="col-lg-3">
<svg class="bi" width="16" height="16" fill="currentColor">
<use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#grid-3x3"/>
</svg>
<strong>Pièces&nbsp;: </strong>{{ $home->rooms }}</div>
</div> </div>
<div class="row mb-4"> <div class="row mb-4">
<div class="col-lg-12"><h3>Informations complémentaires :</h3></div> <div class="col-lg-12">
<div class="col-lg-3"><strong>Surface de jardin : </strong> {{ $home->garden_surface ?? '' }}</div> <h3>
<div class="col-lg-3"><strong>Énergie : </strong> {{ $home->energy ?? '' }}</div> <svg class="bi" width="32" height="32" fill="currentColor">
<div class="col-lg-3"><strong>GES : </strong> {{ $home->ges ?? '' }}</div> <use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#info-circle"/>
</svg>
Informations complémentaires
</h3>
</div>
<div class="col-lg-3">
<svg class="bi" width="16" height="16" fill="currentColor">
<use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#hexagon"/>
</svg>
<strong>Jardin&nbsp;: </strong> {{ Str::surface($home->garden_surface) }}</div>
<div class="col-lg-3">
<svg class="bi" width="16" height="16" fill="currentColor">
<use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#lightning"/>
</svg>
<strong>Énergie&nbsp;: </strong> {{ $home->energy ?? '' }}</div>
<div class="col-lg-3">
<svg class="bi" width="16" height="16" fill="currentColor">
<use xlink:href="{{ asset('images/bootstrap-icons.svg') }}#life-preserver"/>
</svg>
<strong>GES&nbsp;: </strong> {{ $home->ges ?? '' }}</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-lg-3"><a href="{{ $home->url }}" class="btn btn-success">Voir l'origine </a></div> <div class="col-lg-3"><a href="{{ $home->url }}" class="btn btn-success">Voir l'origine </a></div>