From 4ad9c3623e3045f0a521e4b554fe7b4e565fbabb Mon Sep 17 00:00:00 2001 From: Daniel Meltzer Date: Thu, 29 Dec 2016 21:12:27 -0500 Subject: [PATCH] Show a glyph in the assets datatable. (#3111) --- app/Presenters/AssetPresenter.php | 7 ++++++- app/Presenters/LocationPresenter.php | 5 +++++ app/Presenters/UserPresenter.php | 5 +++++ resources/views/hardware/view.blade.php | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/Presenters/AssetPresenter.php b/app/Presenters/AssetPresenter.php index 6077a8fc9e..1cd9f0d858 100644 --- a/app/Presenters/AssetPresenter.php +++ b/app/Presenters/AssetPresenter.php @@ -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 ''; + } } diff --git a/app/Presenters/LocationPresenter.php b/app/Presenters/LocationPresenter.php index 98d86ca67c..ee364fe0af 100644 --- a/app/Presenters/LocationPresenter.php +++ b/app/Presenters/LocationPresenter.php @@ -72,4 +72,9 @@ class LocationPresenter extends Presenter { return route('locations.show', $this->id); } + + public function glyph() + { + return ''; + } } diff --git a/app/Presenters/UserPresenter.php b/app/Presenters/UserPresenter.php index 1beac2d5b6..021656705a 100644 --- a/app/Presenters/UserPresenter.php +++ b/app/Presenters/UserPresenter.php @@ -155,4 +155,9 @@ class UserPresenter extends Presenter { return route('users.show', $this->id); } + + public function glyph() + { + return ''; + } } diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 916e1e9f5a..39a7a67839 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -353,7 +353,7 @@ @if($asset->assigned_type == User::class) {{ $asset->assigneduser->present()->fullName() }} @endif - {!! $asset->assignedTo->present()->nameUrl() !!} + {!! $asset->assignedTo->present()->glyph() . ' ' .$asset->assignedTo->present()->nameUrl() !!}