Skip to content

A free open source IT asset/license management system

Few more tweaks

snipe2bfee0c29a28
diff --git a/app/Http/Controllers/Consumables/ConsumablesController.php b/app/Http/Controllers/Consumables/ConsumablesController.php
index 5685944a5c..9dd17fe6bc 100644
--- a/app/Http/Controllers/Consumables/ConsumablesController.php
+++ b/app/Http/Controllers/Consumables/ConsumablesController.php
@@ -200,7 +200,7 @@ class ConsumablesController extends Controller
*/
public function show($consumableId = null)
{
- $consumable = Consumable::find($consumableId);
+ $consumable = Consumable::withCount('users as users_consumables')->find($consumableId);
$this->authorize($consumable);
if (isset($consumable->id)) {
return view('consumables/view', compact('consumable'));
diff --git a/resources/views/consumables/view.blade.php b/resources/views/consumables/view.blade.php
index 512d387031..402edd707b 100644
--- a/resources/views/consumables/view.blade.php
+++ b/resources/views/consumables/view.blade.php
@@ -3,7 +3,7 @@
{{-- Page title --}}
@section('title')
{{ $consumable->name }}
- {{ trans('general.consumable') }}
+ {{ trans('general.consumable') }} -
({{ trans('general.remaining_var', ['count' => $consumable->numRemaining()]) }})
@parent
@endsection
@@ -38,10 +38,10 @@
<li>
<a href="#checkedout" data-toggle="tab">
<span class="hidden-lg hidden-md">
- <i class="fas fa-info-circle fa-2x" aria-hidden="true"></i>
+ <i class="fas fa-users fa-2x" aria-hidden="true"></i>
</span>
- <span class="hidden-xs hidden-sm">{{ trans('general.users') }}
- {!! ($consumable->users->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($consumable->users->count()).'</badge>' : '' !!}
+ <span class="hidden-xs hidden-sm">{{ trans('general.assigned') }}
+ {!! ($consumable->users_consumables > 0 ) ? '<badge class="badge badge-secondary">'.number_format($consumable->users_consumables).'</badge>' : '' !!}
</span>
</a>
</li>
@@ -190,6 +190,18 @@
</div>
@endif
+ <!-- min amt -->
+ @if ($consumable->min_amt)
+ <div class="row">
+ <div class="col-md-3">
+ {{ trans('general.min_amt') }}
+ </div>
+ <div class="col-md-9">
+ {{ $consumable->min_amt }}
+ </div>
+ </div>
+ @endif
+
<!-- locationm -->
@if ($consumable->location)
<div class="row">
@@ -248,7 +260,7 @@
<i class="fa-regular fa-clipboard js-copy-link" data-clipboard-target=".js-copy" aria-hidden="true" data-tooltip="true" data-placement="top" title="{{ trans('general.copy_to_clipboard') }}">
<span class="sr-only">{{ trans('general.copy_to_clipboard') }}</span>
</i>
-
+
</div>
</div>
@endif