mirror of
https://github.com/brunofontes/shareit.git
synced 2024-11-24 04:14:57 +00:00
Bruno Fontes
7a8d5ccaff
It was necessary to keep refreshing the page to check if an item was returned when we did not want to be alerted. So, now, the page refresh itself every 2 minutes (while I do not know how to use Laravel broadcasting) and the title shows the number of items in use (including when used by you).
52 lines
1.9 KiB
PHP
52 lines
1.9 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
|
|
<script type="text/javascript">
|
|
setInterval(function() {
|
|
window.location.reload(true);
|
|
}, 2*60000); //NOTE: period is passed in milliseconds
|
|
</script>
|
|
|
|
<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 |