From 24cad588bd11adeeb298d9dd0e2e693b46f0434a Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 29 Sep 2017 17:32:16 -0700 Subject: [PATCH] Added preceding icons in polymorphic formatter --- resources/views/partials/bootstrap-table.blade.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index c89ba826e..d3e911849 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -205,26 +205,34 @@ $('.snipe-table').bootstrapTable({ function polymorphicItemFormatter(value) { var item_destination = ''; + var item_icon; if ((value) && (value.type)) { if (value.type == 'asset') { item_destination = 'hardware'; + item_icon = 'fa-barcode'; } else if (value.type == 'accessory') { item_destination = 'accessories'; + item_icon = 'fa-keyboard-o'; } else if (value.type == 'component') { item_destination = 'components'; + item_icon = 'fa-hdd-o'; } else if (value.type == 'consumable') { item_destination = 'consumables'; + item_icon = 'fa-tint'; } else if (value.type == 'license') { item_destination = 'licenses'; + item_icon = 'fa-floppy-o'; } else if (value.type == 'user') { item_destination = 'users'; + item_icon = 'fa-user'; } else if (value.type == 'location') { item_destination = 'locations' + item_icon = 'fa-map-marker'; } - return ' ' + value.name + ''; + return ' ' + value.name + ''; } else { return '';