Changing home layout from FLOAT to GRID

This commit is contained in:
Bruno F. Fontes 2018-09-20 20:37:21 -03:00
parent 36b62ffc8b
commit 51ee7c2ef3
3 changed files with 53 additions and 56 deletions

View File

@ -8,34 +8,37 @@
<div class="card-header">Your items</div> <div class="card-header">Your items</div>
<div class="card-body"> <div class="card-body">
@if (session('status')) @if (session('status'))
<div class="alert alert-success" role="alert"> <div class="alert alert-success" role="alert">
{{ session('status') }} {{ session('status') }}
</div> </div>
@endif @endif
@forelse ($items as $item) @forelse ($items as $item)
@if (!$loop->first) @if (!$loop->first)
<hr class="m-3"> <hr class="m-3">
@endif @endif
<div class="my-4 p-2"> <div class="row align-items-center p-2">
<div class="col col-xs-auto">
@if ($item->product->url) @if ($item->product->url)
<a href="{{$item->product->url}}" class="link-unstyled" target="_blank" rel="noopener noreferrer"> <a href="{{$item->product->url}}" class="link-unstyled" target="_blank" rel="noopener noreferrer">
@endif @endif
<strong>{{$item->name}}</strong> ({{$item->product->name}}) <strong>{{$item->name}}</strong> ({{$item->product->name}})
@if ($item->product->url) @if ($item->product->url)
</a> </a>
@endif
@if ($item->used_by)
@include('home.usedItem')
@else
@include('home.unusedItem')
@endif @endif
</div> </div>
<div class="align-self-end text-right">
@if ($item->used_by)
@include('home.usedItem')
@else
@include('home.unusedItem')
@endif
</div>
</div>
@empty @empty
<p>There are no items shared with you yet. <a href="/product">Share an item!</a></p> <p>There are no items shared with you yet. <a href="/product">Share an item!</a></p>
@endforelse @endforelse
</div> </div>
</div> </div>

View File

@ -1,7 +1,5 @@
<span class="float-right"> <form action="/take" method="POST">
<form action="/take" method="POST"> {{ csrf_field() }}
{{ csrf_field() }} <input type="hidden" name="item" value="{{$item->id}}">
<input type="hidden" name="item" value="{{$item->id}}"> <button type="submit" class="btn btn-sm btn-success">Take It</button>
<button type="submit" class="btn btn-sm btn-success">Take It</button> </form>
</form>
</span>

View File

@ -1,35 +1,31 @@
@if ($item->used_by == \Auth::id()) @if ($item->used_by == \Auth::id())
<span class="float-right"> <form action="/take" method="POST" class="form-inline">
<form action="/take" method="POST"> <em class="pr-sm-2 ml-auto">{{\Carbon\Carbon::parse($item->updated_at)->diffForHumans()}}</em>
{{ csrf_field() }} <div class="w-100 d-xm-block d-sm-none"></div>
@method('DELETE') {{ csrf_field() }}
<input type="hidden" name="item" value="{{$item->id}}"> @method('DELETE')
<button type="submit" class="btn btn-sm btn-danger">Return It</button> <input type="hidden" name="item" value="{{$item->id}}">
</form> <button type="submit" class="btn btn-sm btn-danger ml-auto">Return It</button>
</span> </form>
<span class="float-right mr-3"><em>{{\Carbon\Carbon::parse($item->updated_at)->diffForHumans()}}</em></span>
@else @else
<span class="float-right"> <form action="/alert" method="POST" class="form-inline">
<form action="/alert" method="POST"> <em class="pr-sm-2 ml-auto">
{{ csrf_field() }} {{str_limit($users[$item->used_by], 15, '...')}}
<input type="hidden" name="item" value="{{$item->id}}"> @if ($item->waiting_user_id && $item->waiting_user_id != \Auth::id())
@if ($item->waiting_user_id == \Auth::id()) <strong>> {{str_limit($users[$item->waiting_user_id], 15, '...')}}</strong>
@method('DELETE') @endif
<button type="submit" class="btn btn-sm btn-outline-danger">Cancel Alert</button> <small>({{$item->updated_at->diffForHumans()}})</small>
@elseif (!$item->waiting_user_id) </em>
<button type="submit" class="btn btn-sm btn-outline-secondary">Alert me</button> <div class="w-100 d-xm-block d-sm-none"></div>
@endif {{ csrf_field() }}
</form> <input type="hidden" name="item" value="{{$item->id}}">
</span> @if ($item->waiting_user_id == \Auth::id())
<span class="float-right mr-3"> @method('DELETE')
<em> <button type="submit" class="btn btn-sm btn-outline-danger ml-auto">Cancel Alert</button>
{{str_limit($users[$item->used_by], 15, '...')}} @elseif (!$item->waiting_user_id)
@if ($item->waiting_user_id && $item->waiting_user_id != \Auth::id()) <button type="submit" class="btn btn-sm btn-outline-secondary ml-auto">Alert me</button>
<strong>> {{str_limit($users[$item->waiting_user_id], 15, '...')}}</strong> @endif
@endif </form>
<small>({{$item->updated_at->diffForHumans()}})</small>
</em>
</span>
@endif @endif