shareit/resources/views/home.blade.php

49 lines
2.1 KiB
PHP
Raw Normal View History

2018-09-09 04:03:41 +00:00
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Dashboard</div>
<div class="card-body">
@if (session('status'))
<div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
@endif
<h4>Your itens</h4>
@forelse ($items as $item)
2018-09-11 23:48:09 +00:00
<li>
<strong>{{$item->name}}</strong> ({{$item->pname}})
@if ($item->usedBy)
@if ($item->usedBy == \Auth::id())
<span class="float-right">
<form action="/item/{{$item->id}}" method="POST">
<button type="button" class="btn btn-danger" disabled>Return It</button>
</form>
</span>
@else
<div class="alert alert-danger" role="alert">In use by {{$item->usedBy}}, since {{$item->usedSince->diffForHumans()}}</div>
@endif
2018-09-11 23:48:09 +00:00
@else
<span class="float-right">
<form action="/item/{{$item->id}}" method="POST">
<button type="button" class="btn btn-success">Take It</button>
</form>
</span>
2018-09-11 23:48:09 +00:00
@endif
</li>
@empty
2018-09-11 23:48:09 +00:00
<p>There are no items for you yet. Include a product or an item <a href="/product">here.</a></p>
@endforelse
2018-09-09 04:03:41 +00:00
</div>
</div>
</div>
</div>
</div>
@endsection