Fixed #2857 - better CSS for requestable assets page when no results

This commit is contained in:
snipe 2017-10-25 20:07:10 -07:00
parent e8847753f4
commit d008334f2d

View file

@ -27,120 +27,127 @@
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane fade in active" id="assets"> <div class="tab-pane fade in active" id="assets">
<div class="row">
<div class="col-md-12">
@if ($assets->count() > 0) @if ($assets->count() > 0)
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr role="row"> <tr role="row">
<th class="col-md-3" bSortable="true">{{ trans('admin/hardware/table.asset_model') }}</th> <th class="col-md-3" bSortable="true">{{ trans('admin/hardware/table.asset_model') }}</th>
@if ($snipeSettings->display_asset_name) @if ($snipeSettings->display_asset_name)
<th class="col-md-3" bSortable="true">{{ trans('admin/hardware/form.name') }}</th> <th class="col-md-3" bSortable="true">{{ trans('admin/hardware/form.name') }}</th>
@endif @endif
<th class="col-md-3" bSortable="true">{{ trans('admin/hardware/table.serial') }}</th> <th class="col-md-3" bSortable="true">{{ trans('admin/hardware/table.serial') }}</th>
<th class="col-md-2" bSortable="true">{{ trans('admin/hardware/table.location') }}</th> <th class="col-md-2" bSortable="true">{{ trans('admin/hardware/table.location') }}</th>
<th class="col-md-2" bSortable="true">{{ trans('admin/hardware/table.status') }}</th> <th class="col-md-2" bSortable="true">{{ trans('admin/hardware/table.status') }}</th>
<th class="col-md-2" bSortable="true">{{ trans('admin/hardware/form.expected_checkin') }}</th> <th class="col-md-2" bSortable="true">{{ trans('admin/hardware/form.expected_checkin') }}</th>
<th class="col-md-1 actions" bSortable="false">{{ trans('table.actions') }}</th> <th class="col-md-1 actions" bSortable="false">{{ trans('table.actions') }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach ($assets as $asset) @foreach ($assets as $asset)
<tr> <tr>
<form action="{{route('account/request-item', ['itemType' => 'asset', 'itemId' => $asset->id])}}" method="POST" accept-charset="utf-8"> <form action="{{route('account/request-item', ['itemType' => 'asset', 'itemId' => $asset->id])}}" method="POST" accept-charset="utf-8">
{{ csrf_field() }} {{ csrf_field() }}
<td>{!! $asset->model->present()->nameUrl() !!}</td> <td>{!! $asset->model->present()->nameUrl() !!}</td>
@if ($snipeSettings->display_asset_name) @if ($snipeSettings->display_asset_name)
<td>{{ $asset->name }}</td> <td>{{ $asset->name }}</td>
@endif @endif
<td><a href="{{ $asset->present()->viewUrl() }}">{{ $asset->serial }}</a></td> <td><a href="{{ $asset->present()->viewUrl() }}">{{ $asset->serial }}</a></td>
<td> <td>
@if ($asset->assetloc) @if ($asset->assetloc)
{!! $asset->assetloc->present()->nameUrl() !!} {!! $asset->assetloc->present()->nameUrl() !!}
@endif @endif
</td> </td>
@if ($asset->assigned_to != '' && $asset->assigned_to > 0) @if ($asset->assigned_to != '' && $asset->assigned_to > 0)
<td>Checked out</td> <td>Checked out</td>
@else @else
<td>{{ trans('admin/hardware/general.requestable') }}</td> <td>{{ trans('admin/hardware/general.requestable') }}</td>
@endif @endif
<td>{{ $asset->expected_checkin }}</td>
<td>
@if ($asset->isRequestedBy(Auth::user()))
{{Form::submit(trans('button.cancel'), ['class' => 'btn btn-danger btn-sm'])}}
@else
{{Form::submit(trans('button.request'), ['class' => 'btn btn-primary btn-sm'])}}
@endif
</td>
</form>
</tr>
@endforeach
</tbody>
</table>
</div>
@else
<div class="alert alert-info alert-block">
<i class="fa fa-info-circle"></i>
{{ trans('general.no_results') }}
</div>
@endif
<td>{{ $asset->expected_checkin }}</td>
<td>
@if ($asset->isRequestedBy(Auth::user()))
{{Form::submit(trans('button.cancel'), ['class' => 'btn btn-danger btn-sm'])}}
@else
{{Form::submit(trans('button.request'), ['class' => 'btn btn-primary btn-sm'])}}
@endif
</td>
</form>
</tr>
@endforeach
</tbody>
</table>
</div> </div>
@else
<div class="col-md-12">
<div class="alert alert-info alert-block">
<i class="fa fa-info-circle"></i>
{{ trans('general.no_results') }}
</div>
</div>
@endif
</div> </div>
</div>
<div class="tab-pane fade" id="models"> <div class="tab-pane fade" id="models">
<div class="row">
<div class="col-md-12">
@if ($models->count() > 0) @if ($models->count() > 0)
<h4>Requestable Models</h4> <h4>Requestable Models</h4>
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr role="row"> <tr role="row">
<th class="col-md-6" bSortable="true">{{ trans('admin/hardware/table.asset_model') }}</th> <th class="col-md-6" bSortable="true">{{ trans('admin/hardware/table.asset_model') }}</th>
<th class="col-md-3" bSortable="true">{{ trans('admin/accessories/general.remaining') }}</th> <th class="col-md-3" bSortable="true">{{ trans('admin/accessories/general.remaining') }}</th>
<th class="col-md-2" bSortable="true">{{ trans('general.quantity') }}</th> <th class="col-md-2" bSortable="true">{{ trans('general.quantity') }}</th>
<th class="col-md-1 actions" bSortable="false">{{ trans('table.actions') }}</th> <th class="col-md-1 actions" bSortable="false">{{ trans('table.actions') }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($models as $requestableModel) @foreach($models as $requestableModel)
<tr> <tr>
<form action="{{route('account/request-item', ['itemType' => 'asset_model', 'itemId' => $requestableModel->id])}}" <form action="{{route('account/request-item', ['itemType' => 'asset_model', 'itemId' => $requestableModel->id])}}"
method="POST" method="POST"
accept-charset="utf-8" accept-charset="utf-8"
> >
{{ csrf_field() }} {{ csrf_field() }}
<td>{{$requestableModel->name}}</td> <td>{{$requestableModel->name}}</td>
<td>{{$requestableModel->assets->where('requestable', '1')->count()}}</td> <td>{{$requestableModel->assets->where('requestable', '1')->count()}}</td>
<td><input type="text" name="request-quantity" value=""></td> <td><input type="text" name="request-quantity" value=""></td>
<td> <td>
@if ($requestableModel->isRequestedBy(Auth::user())) @if ($requestableModel->isRequestedBy(Auth::user()))
{{Form::submit(trans('button.cancel'), ['class' => 'btn btn-danger btn-sm'])}} {{Form::submit(trans('button.cancel'), ['class' => 'btn btn-danger btn-sm'])}}
@else @else
{{Form::submit(trans('button.request'), ['class' => 'btn btn-primary btn-sm'])}} {{Form::submit(trans('button.request'), ['class' => 'btn btn-primary btn-sm'])}}
@endif @endif
</td> </td>
</form> </form>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
@else @else
<div class="col-md-12"> <div class="alert alert-info alert-block">
<div class="alert alert-info alert-block"> <i class="fa fa-info-circle"></i>
<i class="fa fa-info-circle"></i> {{ trans('general.no_results') }}
{{ trans('general.no_results') }} </div>
@endif
</div> </div>
</div> </div>
@endif
</div> </div>
</div> <!-- .tab-content--> </div> <!-- .tab-content-->