Multi-images component, refactoring medias functions
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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">
|
||||
|
||||
14
resources/views/components/multi-images.blade.php
Normal file
14
resources/views/components/multi-images.blade.php
Normal 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
|
||||
Reference in New Issue
Block a user