Add display articles by rows, and display article in full mode

This commit is contained in:
Ludovic CANDELLIER
2022-01-18 23:39:27 +01:00
parent ecbb7b62c9
commit cdc88b43df
11 changed files with 147 additions and 84 deletions

View File

@@ -2,23 +2,29 @@
<div class="card">
<img src="{{ App\Repositories\Shop\Articles::getPreviewSrc($article['image'] ?? false) }}" class="card-img-top" alt="...">
<div class="card-body">
<span class="card-title">{{ $product_name }}</span>
<span class="pull-right">
<span class="card-title" style="font-weight: bold; color: green;">{{ $product_name }}</span>
<span class="float-right" style="font-size: 2em; color: red;">
<i class="fa fa-heart"></i>
</span>
<p class="card-text">
<div class="row">
<div class="row" style="color: green;">
<div class="col-6">
{{ $article['semences']['price'] ?? null }}<br>
@if ($article['semences'] ?? false)
<span style="font-size: 1.4em; font-weight: bold;">{{ $article['semences']['price'] ?? null }}</span> <br>
@else
Indisponible
@endif
Semence
</div>
@if ($article['plants'] ?? false)
<div class="col-6">
{{ $article['plants']['price'] }}<br>
Plant
</div>
@endif
<div class="col-6">
@if ($article['plants'] ?? false)
<span style="font-size: 1.4em; font-weight: bold;">{{ $article['plants']['price'] }}</span> <br>
@else
Indisponible
@endif
Plant
</div>
</div>
</p>
</div>

View File

@@ -0,0 +1,55 @@
<a href="{{ route('Shop.Articles.show', ['id' => $article['semences']['article_id'] ?? false ]) }}">
<div class="row pb-3">
<div class="col-12">
<div class="card-title" style="font-weight: bold; color: green;">{{ $product_name }}</div>
</div>
<div class="col-12">
<div class="row">
<div class="col-8">
<div class="row">
<div class="col-2">
<div class="row">
<div class="col-9">
<img src="{{ App\Repositories\Shop\Articles::getPreviewSrc($article['image'] ?? false) }}" class="card-img-top" alt="...">
</div>
<div class="col-3 text-center">
<span style="font-size: 2em; color: red;">
<i class="fa fa-heart"></i>
</span>
</div>
</div>
</div>
<div class="col-10">
{!! $article['description'] !!}
</div>
</div>
</div>
<div class="col-4">
<p class="card-text">
<div class="row" style="color: green;">
<div class="col-6 text-center">
@if ($article['semences'] ?? false)
<span style="font-size: 1.4em; font-weight: bold;">{{ $article['semences']['price'] ?? null }}</span> <br>
{{ $article['semences']['variation'] }}
<div>
Quantité :
</div>
@include('components.form.button', [
'class' => 'btn-success basket semences',
'txt' => 'Ajouter au panier',
])
@endif
</div>
<div class="col-6 text-center">
@if ($article['plants'] ?? false)
<span style="font-size: 1.4em; font-weight: bold;">{{ $article['plants']['price'] }}</span> <br>
{{ $article['plants']['variation'] }}
@endif
</div>
</div>
</p>
</div>
</div>
</div>
</div>
</a>

View File

@@ -0,0 +1,33 @@
@extends('Shop.layout.layout', [
'title' => __('home.title'),
])
@section('content')
<div class="row">
<div class="col-1">
</div>
<div class="col-4">
{!! $article['image_big'] !!}
</div>
<div class="col-4">
<h1>{{ $article['name'] }}</h1>
{!! $article['description'] !!}
</div>
<div class="col-3">
@component('components.card', [
'title' => 'Semence',
'class' => 'mb-3',
])
@include('components.form.button', [
'class' => 'btn-success basket semences',
'txt' => 'Ajouter au panier',
])
@endcomponent
@component('components.card', [
'title' => 'Plant',
])
@endcomponent
</div>
</div>
@endsection

View File

@@ -3,5 +3,9 @@
])
@section('content')
@include('Shop.layout.partials.category_articles')
@if ($display_by_rows ?? true)
@include('Shop.layout.partials.category_articles_rows')
@else
@include('Shop.layout.partials.category_articles')
@endif
@endsection

View File

@@ -0,0 +1,3 @@
@foreach ($articles as $product_name => $article)
@include('Shop.Articles.partials.article_rows')
@endforeach

View File

@@ -4,7 +4,7 @@
@isset($header)
{{ $header }}
@else
<h3 class="card-title">{{ $title }}</h3>
<h3 class="card-title">{{ $title ?? false }}</h3>
@isset($tools)
<div class="card-tools">
{!! $tools !!}

View File

@@ -1,4 +1,6 @@
<button type="{{ $type ?? 'button' }}" class="btn {{ $class ?? ''}}" @if (isset($id)) id="{{ $id }}"@endif>
<i class="fa fa-fw {{ $icon ?? '' }}"></i>
@if ($icon ?? false)
<i class="fa fa-fw {{ $icon ?? '' }}"></i>
@endif
{{ $txt ?? '' }}
</button>