diff --git a/app/Http/Controllers/Api/ConsumablesController.php b/app/Http/Controllers/Api/ConsumablesController.php
index ebc27c608..fc6620df4 100644
--- a/app/Http/Controllers/Api/ConsumablesController.php
+++ b/app/Http/Controllers/Api/ConsumablesController.php
@@ -228,6 +228,7 @@ class ConsumablesController extends Controller
foreach ($consumable->consumableAssignments as $consumable_assignment) {
$rows[] = [
+ 'avatar' => ($consumable_assignment->user) ? e($consumable_assignment->user->present()->gravatar) : '',
'name' => ($consumable_assignment->user) ? $consumable_assignment->user->present()->nameUrl() : 'Deleted User',
'created_at' => Helper::getFormattedDateObject($consumable_assignment->created_at, 'datetime'),
'note' => ($consumable_assignment->note) ? e($consumable_assignment->note) : null,
diff --git a/resources/views/consumables/view.blade.php b/resources/views/consumables/view.blade.php
index 70b30d89d..406d3b4bd 100644
--- a/resources/views/consumables/view.blade.php
+++ b/resources/views/consumables/view.blade.php
@@ -21,12 +21,10 @@
-
-
-
-
+
@@ -47,9 +45,12 @@
@endcan
- @can('update', \App\Models\Consumble::class)
- -
- {{ trans('button.upload') }}
+ @can('update', Consumable::class)
+
+
-
+
+ {{ trans('button.upload') }}
+
@endcan
@@ -57,9 +58,7 @@
-
-
-
+
- {{ trans('general.user') }} |
- {{ trans('general.date') }} |
+ {{ trans('general.image') }} |
+ {{ trans('general.user') }} |
+
+ {{ trans('general.date') }}
+ |
{{ trans('general.notes') }} |
{{ trans('general.admin') }} |
-
-
-
+
+
@can('consumables.files', $consumable)
@@ -194,7 +195,6 @@
-
-@stop
+
@can('update', \App\Models\Consumable::class)
@include ('modals.upload-file', ['item_type' => 'consumable', 'item_id' => $consumable->id])
@endcan
-
+@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', ['exportFile' => 'consumable' . $consumable->name . '-export', 'search' => false])
diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php
index 57ac6a4d7..ef29f8370 100644
--- a/resources/views/partials/bootstrap-table.blade.php
+++ b/resources/views/partials/bootstrap-table.blade.php
@@ -632,10 +632,14 @@
if (value) {
- if (row.name) {
+ // This is a clunky override to handle unusual API responses where we're presenting a link instead of an array
+ if (row.avatar) {
+ var altName = '';
+ }
+ else if (row.name) {
var altName = row.name;
}
- else if ((row) && (row.model)) {
+ else if ((row) && (row.model)) {
var altName = row.model.name;
}
return '

';