Show a glyph in the assets datatable. (#3111)

This commit is contained in:
Daniel Meltzer 2016-12-29 21:12:27 -05:00 committed by snipe
parent 4c5fce847b
commit 4ad9c3623e
4 changed files with 17 additions and 2 deletions

View file

@ -85,7 +85,7 @@ class AssetPresenter extends Presenter
$results['assigned_to'] = '';
if($assigned = $this->model->assignedTo) {
$results['status_label'] = 'Deployed';
$results['assigned_to'] = $assigned->present()->nameUrl();
$results['assigned_to'] = $assigned->present()->glyph() . ' ' . $assigned->present()->nameUrl();
} else if($this->model->assetstatus) {
$results['status_label'] = $this->model->assetstatus->name;
}
@ -268,4 +268,9 @@ class AssetPresenter extends Presenter
{
return route('hardware.show', $this->id);
}
public function glyph()
{
return '<i class="fa fa-barcode"></i>';
}
}

View file

@ -72,4 +72,9 @@ class LocationPresenter extends Presenter
{
return route('locations.show', $this->id);
}
public function glyph()
{
return '<i class="fa fa-globe"></i>';
}
}

View file

@ -155,4 +155,9 @@ class UserPresenter extends Presenter
{
return route('users.show', $this->id);
}
public function glyph()
{
return '<i class="fa fa-users"></i>';
}
}

View file

@ -353,7 +353,7 @@
@if($asset->assigned_type == User::class) <!-- Only users have avatars currently-->
<img src="{{ $asset->assignedTo->present()->gravatar() }}" class="user-image-inline" alt="{{ $asset->assigneduser->present()->fullName() }}">
@endif
{!! $asset->assignedTo->present()->nameUrl() !!}
{!! $asset->assignedTo->present()->glyph() . ' ' .$asset->assignedTo->present()->nameUrl() !!}
</p>
<ul class="list-unstyled">