shareit/resources/views/home.blade.php

54 lines
2.0 KiB
PHP
Raw Normal View History

2018-09-09 04:03:41 +00:00
@extends('layouts.app')
@section('content')
<script type="text/javascript">
setInterval(function() {
2019-05-31 14:42:18 +00:00
if (!document.hasFocus() ) {
window.location.reload(true);
}
}, 2*60000); //NOTE: period is passed in milliseconds
</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)
@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)
<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>
@if ($item->product->url)
</a>
2018-09-16 23:32:32 +00:00
@endif
</div>
<div class="ml-auto align-self-end text-right">
@if ($item->used_by)
@include('home.usedItem')
2018-09-11 23:48:09 +00:00
@else
@include('home.unusedItem')
2018-09-11 23:48:09 +00:00
@endif
</div>
</div>
@empty
@endforelse
2018-09-09 04:03:41 +00:00
</div>
</div>
2018-09-21 03:42:19 +00:00
@empty
<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>
@endsection