mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Added icon to presenter
This commit is contained in:
parent
4ada5eaa94
commit
8ab29c628f
|
@ -8,25 +8,6 @@ namespace App\Presenters;
|
||||||
*/
|
*/
|
||||||
class ActionlogPresenter extends Presenter
|
class ActionlogPresenter extends Presenter
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Link to this companies name
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function forDataTable()
|
|
||||||
{
|
|
||||||
|
|
||||||
return [
|
|
||||||
'icon' => '<i class="'.$this->parseItemIcon().'"></i>',
|
|
||||||
'created_at' => date("M d, Y g:iA", strtotime($this->created_at)),
|
|
||||||
'action_type' => strtolower(trans('general.'.str_replace(' ', '_', $this->action_type))),
|
|
||||||
'admin' => $this->admin(),
|
|
||||||
'target' => $this->target(),
|
|
||||||
'item' => $this->item(),
|
|
||||||
'item_type' => $this->itemType(),
|
|
||||||
'note' => e($this->note),
|
|
||||||
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function admin()
|
public function admin()
|
||||||
{
|
{
|
||||||
|
@ -35,9 +16,8 @@ class ActionlogPresenter extends Presenter
|
||||||
return $user->present()->nameUrl();
|
return $user->present()->nameUrl();
|
||||||
}
|
}
|
||||||
// The user was deleted
|
// The user was deleted
|
||||||
return '<del>'.$user->present()->name()."</del> (deleted)";
|
return '<del>'.$user->getFullNameAttribute()."</del> (deleted)";
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,11 +31,38 @@ class ActionlogPresenter extends Presenter
|
||||||
return $this->model->item->present()->nameUrl();
|
return $this->model->item->present()->nameUrl();
|
||||||
}
|
}
|
||||||
// The item was deleted
|
// The item was deleted
|
||||||
return '<del>'.$item->present()->name().'</del> (deleted)';
|
return '<del>'.$item->name.'</del> (deleted)';
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function icon()
|
||||||
|
{
|
||||||
|
if ($this->itemType() == "asset") {
|
||||||
|
$itemicon = 'fa fa-barcode';
|
||||||
|
} elseif ($this->itemType() == "accessory") {
|
||||||
|
$itemicon = 'fa fa-keyboard-o';
|
||||||
|
} elseif ($this->itemType()=="consumable") {
|
||||||
|
$itemicon = 'fa fa-tint';
|
||||||
|
} elseif ($this->itemType()=="license") {
|
||||||
|
$itemicon = 'fa fa-floppy-o';
|
||||||
|
} elseif ($this->itemType()=="component") {
|
||||||
|
$itemicon = 'fa fa-hdd-o';
|
||||||
|
} else {
|
||||||
|
$itemicon = 'fa fa-paperclip';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $itemicon;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function actionType() {
|
||||||
|
return strtolower(trans('general.'.str_replace(' ', '_', $this->action_type)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function target()
|
public function target()
|
||||||
{
|
{
|
||||||
$target = null;
|
$target = null;
|
||||||
|
|
Loading…
Reference in a new issue