mirror of
https://github.com/brunofontes/shareit.git
synced 2024-11-24 12:17:10 +00:00
Bruno Fontes
4ec2b24885
When we had no items showing on home page, it were just blank. Turns out that the @empty call that shows the default message were appearing just when it had no items on a product, instead of no items at all. Fixed it moving the paragraph to the right place.
45 lines
1.7 KiB
PHP
45 lines
1.7 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
<div class="container">
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-8">
|
|
@forelse ($products as $items)
|
|
<div class="card mb-4">
|
|
<div class="card-header">{{$items->first()->product->name}}</div>
|
|
<div class="card-body">
|
|
@forelse ($items->sortBy('name', SORT_NATURAL | SORT_FLAG_CASE) as $item)
|
|
@if (!$loop->first)
|
|
<hr class="m-3">
|
|
@endif
|
|
<div class="row align-items-center p-2">
|
|
<div class="col col-xs-auto">
|
|
@if ($item->product->url)
|
|
<a href="{{$item->product->url}}" class="link-unstyled" target="_blank" rel="noopener noreferrer">
|
|
@endif
|
|
|
|
<strong>{{$item->name}}</strong>
|
|
|
|
@if ($item->product->url)
|
|
</a>
|
|
@endif
|
|
</div>
|
|
<div class="ml-auto align-self-end text-right">
|
|
@if ($item->used_by)
|
|
@include('home.usedItem')
|
|
@else
|
|
@include('home.unusedItem')
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@empty
|
|
@endforelse
|
|
</div>
|
|
</div>
|
|
@empty
|
|
<p>@lang('home.no_messages') <a href="/product">@lang('home.share_item')</a></p>
|
|
@endforelse
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection |