Refactor article getter for descriptions & tags, minor fixes on tags

This commit is contained in:
Ludovic CANDELLIER
2022-06-22 22:28:18 +02:00
parent 6b1cc0f045
commit e9ab7173f8
12 changed files with 148 additions and 37 deletions

View File

@@ -11,7 +11,7 @@
{{ $article['name'] ?? null }}
</div>
<div class="col-3" class="text-right">
{!! $article['image'] !!}
<img src="{{ $article['image'] }}" class="img-fluid">
</div>
</div>
@@ -19,7 +19,7 @@
<div class="col-12">
{{ Form::label('categories', __('shop.shelves.title')) }}<br>
@foreach (($article['categories'] ?? null) as $category)
{{ $category }}
<span class="btn btn-xs btn-success pb-2">{{ $category }}</span>
@endforeach
</div>
</div>
@@ -42,7 +42,7 @@
<div class="row mb-3">
<div class="col-12">
{{ Form::label('description', 'Description') }}
{!! $article['description'] ?? null !!}
{!! $article['description']['description'] ?? null !!}
</div>
</div>

View File

@@ -3,6 +3,7 @@
'data' => $article['offers']['semences'],
'title' => 'Semence',
'model' => 'semences',
'bgClass' => 'bg-yellow',
])
@endif
@@ -11,6 +12,7 @@
'data' => $article['offers']['plants'],
'title' => 'Plant',
'model' => 'plants',
'bgClass' => 'bg-green',
])
@endif

View File

@@ -1,7 +1,7 @@
@component('components.card', [
'id_card' => $model . '-basket',
'title' => $title,
'class' => 'mb-3',
'class' => 'mb-3 ' . ($bgClass ?? null),
])
@include('components.form.select', [

View File

@@ -9,14 +9,40 @@
</div>
</div>
<div class="row">
<div class="col-9 text-justify">
<div class="col-4">
<div style="max-width: 360px;">
@include('components.multi-images', ['images' => $article['images']])
</div>
</div>
<div class="col-5 text-justify">
{!! $article['description']['semences'] ?? null !!}
{!! $article['description']['plants'] ?? null !!}
{!! $article['description']['variety'] ?? null !!}
{!! $article['description']['merchandise'] ?? null !!}
@if ($article['description']['plus'] ?? false)
<h3>Spécificités</h3>
{!! $article['description']['plus'] !!}
@endif
@if (count($article['tags'] ?? []))
<h3>Caractéristiques</h3>
@foreach ($article['tags'] as $tag_group => $items)
<div>
{{ $tag_group }} :
@foreach ($items as $tag)
<span class="btn btn-xs pt-0 pb-0">{{ $tag }}</span>
@endforeach
</div>
@endforeach
@endif
@if ($article['description']['specie'] ?? false)
<h3 class="mt-3">Complément</h3>
{!! $article['description']['specie'] ?? null !!}
{!! $article['description']['producer'] ?? null !!}
@endif
</div>
<div class="col-3">
@include('Shop.Articles.partials.ArticleAddBasket')