2018-09-09 04:03:41 +00:00
|
|
|
@extends('layouts.app')
|
|
|
|
|
|
|
|
@section('content')
|
2018-10-16 18:15:05 +00:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
2021-02-15 02:20:43 +00:00
|
|
|
setInterval(
|
|
|
|
function() {
|
|
|
|
if (!document.hasFocus() ) {
|
2019-05-31 14:42:18 +00:00
|
|
|
window.location.reload(true);
|
2021-02-15 02:20:43 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
2*60000); //NOTE: period is passed in milliseconds
|
2018-10-16 18:15:05 +00:00
|
|
|
</script>
|
|
|
|
|
2018-09-09 04:03:41 +00:00
|
|
|
<div class="container">
|
|
|
|
<div class="row justify-content-center">
|
|
|
|
<div class="col-md-8">
|
2018-09-21 03:42:19 +00:00
|
|
|
@forelse ($products as $items)
|
|
|
|
<div class="card mb-4">
|
|
|
|
<div class="card-header">{{$items->first()->product->name}}</div>
|
2018-09-09 04:03:41 +00:00
|
|
|
<div class="card-body">
|
2018-09-21 03:42:19 +00:00
|
|
|
@forelse ($items->sortBy('name', SORT_NATURAL | SORT_FLAG_CASE) as $item)
|
2018-09-20 23:37:21 +00:00
|
|
|
@if (!$loop->first)
|
|
|
|
<hr class="m-3">
|
|
|
|
@endif
|
|
|
|
<div class="row align-items-center p-2">
|
|
|
|
<div class="col col-xs-auto">
|
2018-09-16 23:32:32 +00:00
|
|
|
@if ($item->product->url)
|
2018-09-20 23:37:21 +00:00
|
|
|
<a href="{{$item->product->url}}" class="link-unstyled" target="_blank" rel="noopener noreferrer">
|
|
|
|
@endif
|
2018-09-16 23:32:32 +00:00
|
|
|
|
2018-09-21 03:42:19 +00:00
|
|
|
<strong>{{$item->name}}</strong>
|
2018-09-12 21:24:56 +00:00
|
|
|
|
2018-09-20 23:37:21 +00:00
|
|
|
@if ($item->product->url)
|
|
|
|
</a>
|
2018-09-16 23:32:32 +00:00
|
|
|
@endif
|
2018-09-20 23:37:21 +00:00
|
|
|
</div>
|
2018-09-21 03:05:57 +00:00
|
|
|
<div class="ml-auto align-self-end text-right">
|
2018-09-14 15:52:07 +00:00
|
|
|
@if ($item->used_by)
|
2018-09-20 23:37:21 +00:00
|
|
|
@include('home.usedItem')
|
2018-09-11 23:48:09 +00:00
|
|
|
@else
|
2018-09-20 23:37:21 +00:00
|
|
|
@include('home.unusedItem')
|
2018-09-11 23:48:09 +00:00
|
|
|
@endif
|
2018-09-14 15:52:07 +00:00
|
|
|
</div>
|
2018-09-20 23:37:21 +00:00
|
|
|
</div>
|
2018-09-10 04:23:32 +00:00
|
|
|
@empty
|
|
|
|
@endforelse
|
2018-09-09 04:03:41 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-09-21 03:42:19 +00:00
|
|
|
@empty
|
2018-09-29 15:09:18 +00:00
|
|
|
<p>@lang('home.no_messages') <a href="/product">@lang('home.share_item')</a></p>
|
2018-09-21 03:42:19 +00:00
|
|
|
@endforelse
|
2018-09-09 04:03:41 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-09-15 03:22:57 +00:00
|
|
|
@endsection
|