Multi-images component, refactoring medias functions

This commit is contained in:
Ludovic CANDELLIER
2022-04-16 19:33:17 +02:00
parent 1dc815bf39
commit fe1e14d2c0
16 changed files with 559 additions and 9192 deletions

View File

@@ -1,5 +1,9 @@
@if (count($article['inherited'] ?? []))
@component('components.layout.box-collapse', ['id' => 'product_description_box', 'title' => 'Informations héritées', 'collapsed' => $collapsed ?? false])
@component('components.layout.box-collapse', [
'id' => 'product_description_box',
'title' => 'Informations héritées',
'collapsed' => $collapsed ?? false,
])
@foreach ($article['inherited'] as $inherited)
@component('components.card', ['title' => $inherited['name'], 'class' => 'mb-3'])
{!! $inherited['description'] !!}
@@ -7,7 +11,7 @@
@if ($inherited['tags'])
<h6> Tags</h6>
@foreach ($inherited['tags'] as $tag)
<button type="button" class="btn btn-secondary btn-xs">{{ $tag['group']['name'] }}-{{ $tag['name']['fr'] ?? $tag['name'] }}</button>
<button type="button" class="btn btn-secondary btn-xs">{{ $tag['tag_group']['name'] }}-{{ $tag['name'] ?? $tag['name'] }}</button>
@endforeach
@endif
@endcomponent

View File

@@ -9,10 +9,10 @@
</div>
</div>
<div class="row">
<div class="col-4">
<img src="{{ $article['image_big'] }}" class="img-fluid border">
</div>
<div class="col-5">
<div class="col-9 text-justify">
<div style="max-width: 360px;">
@include('components.multi-images', ['images' => $article['images']])
</div>
{!! $article['description'] !!}
</div>
<div class="col-3">

View File

@@ -0,0 +1,14 @@
<div class="sp-loading"><img src="images/sp-loading.gif" alt=""><br>LOADING IMAGES</div>
<div class="sp-wrap" style="width: 100%;">
@foreach ($images as $image)
<a href="{{ App\Repositories\Core\Images::getImageSrc($image) }}"><img src="{{ App\Repositories\Core\Images::getNormalSrc($image) }}"></a>
@endforeach
</div>
@push('js')
<script>
$(window).load(function() {
$('.sp-wrap').smoothproducts();
});
</script>
@endpush