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

@ -17,7 +17,8 @@
@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
@ -27,13 +28,15 @@
@if ($item->product->url) @if ($item->product->url)
</a> </a>
@endif @endif
</div>
<div class="align-self-end text-right">
@if ($item->used_by) @if ($item->used_by)
@include('home.usedItem') @include('home.usedItem')
@else @else
@include('home.unusedItem') @include('home.unusedItem')
@endif @endif
</div> </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

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>
<div class="w-100 d-xm-block d-sm-none"></div>
{{ csrf_field() }} {{ csrf_field() }}
@method('DELETE') @method('DELETE')
<input type="hidden" name="item" value="{{$item->id}}"> <input type="hidden" name="item" value="{{$item->id}}">
<button type="submit" class="btn btn-sm btn-danger">Return It</button> <button type="submit" class="btn btn-sm btn-danger ml-auto">Return It</button>
</form> </form>
</span>
<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() }}
<input type="hidden" name="item" value="{{$item->id}}">
@if ($item->waiting_user_id == \Auth::id())
@method('DELETE')
<button type="submit" class="btn btn-sm btn-outline-danger">Cancel Alert</button>
@elseif (!$item->waiting_user_id)
<button type="submit" class="btn btn-sm btn-outline-secondary">Alert me</button>
@endif
</form>
</span>
<span class="float-right mr-3">
<em>
{{str_limit($users[$item->used_by], 15, '...')}} {{str_limit($users[$item->used_by], 15, '...')}}
@if ($item->waiting_user_id && $item->waiting_user_id != \Auth::id()) @if ($item->waiting_user_id && $item->waiting_user_id != \Auth::id())
<strong>> {{str_limit($users[$item->waiting_user_id], 15, '...')}}</strong> <strong>> {{str_limit($users[$item->waiting_user_id], 15, '...')}}</strong>
@endif @endif
<small>({{$item->updated_at->diffForHumans()}})</small> <small>({{$item->updated_at->diffForHumans()}})</small>
</em> </em>
</span> <div class="w-100 d-xm-block d-sm-none"></div>
{{ csrf_field() }}
<input type="hidden" name="item" value="{{$item->id}}">
@if ($item->waiting_user_id == \Auth::id())
@method('DELETE')
<button type="submit" class="btn btn-sm btn-outline-danger ml-auto">Cancel Alert</button>
@elseif (!$item->waiting_user_id)
<button type="submit" class="btn btn-sm btn-outline-secondary ml-auto">Alert me</button>
@endif
</form>
@endif @endif