Skip to content

Commit

Permalink
Fixed some layout issues
Browse files Browse the repository at this point in the history
Signed-off-by: snipe <[email protected]>
  • Loading branch information
snipe committed Nov 2, 2022
1 parent fa79a6c commit 2106b64
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/Api/ConsumablesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ public function getDataView($consumableId)

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,
Expand Down
34 changes: 17 additions & 17 deletions resources/views/consumables/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@

<!-- Custom Tabs -->
<div class="nav-tabs-custom">

<ul class="nav nav-tabs hidden-print">


<li class="active">
<a href="#details" data-toggle="tab">
<a href="#checkedout" data-toggle="tab">
<span class="hidden-lg hidden-md">
<i class="fas fa-info-circle fa-2x" aria-hidden="true"></i>
</span>
Expand All @@ -47,19 +45,20 @@
</li>
@endcan

@can('update', \App\Models\Consumble::class)
<li class="pull-right"><a href="#" data-toggle="modal" data-target="#uploadFileModal">
<i class="fas fa-paperclip" aria-hidden="true"></i> {{ trans('button.upload') }}</a>
@can('update', Consumable::class)

<li class="pull-right">
<a href="#" data-toggle="modal" data-target="#uploadFileModal">
<i class="fas fa-paperclip" aria-hidden="true"></i> {{ trans('button.upload') }}
</a>
</li>
@endcan

</ul>

<div class="tab-content">

<div class="tab-pane active" id="details">


<div class="tab-pane active" id="checkedout">
<div class="table-responsive">

<table
Expand All @@ -83,16 +82,18 @@ class="table table-striped snipe-table"
}'>
<thead>
<tr>
<th data-searchable="false" data-sortable="false" data-field="name">{{ trans('general.user') }}</th>
<th data-searchable="false" data-sortable="false" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
<th data-searchable="false" data-sortable="false" data-field="avatar" data-formatter="imageFormatter">{{ trans('general.image') }}</th>
<th data-searchable="false" data-sortable="false" data-field="name" formatter="usersLinkFormatter">{{ trans('general.user') }}</th>
<th data-searchable="false" data-sortable="false" data-field="created_at" data-formatter="dateDisplayFormatter">
{{ trans('general.date') }}
</th>
<th data-searchable="false" data-sortable="false" data-field="note">{{ trans('general.notes') }}</th>
<th data-searchable="false" data-sortable="false" data-field="admin">{{ trans('general.admin') }}</th>
</tr>
</thead>
</table>
</div>

</div>
</div>
</div> <!-- close tab-pane div -->


@can('consumables.files', $consumable)
Expand Down Expand Up @@ -194,7 +195,6 @@ class="table table-striped snipe-table"

<div class="col-md-3">


<div class="box box-default">
<div class="box-body">
<div class="row">
Expand Down Expand Up @@ -286,12 +286,12 @@ class="table table-striped snipe-table"
</div> <!-- /.col-md-3-->
</div> <!-- /.row-->
@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])
Expand Down
8 changes: 6 additions & 2 deletions resources/views/partials/bootstrap-table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,10 +632,14 @@ function imageFormatter(value, row) {
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 '<a href="' + value + '" data-toggle="lightbox" data-type="image"><img src="' + value + '" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="' + altName + '"></a>';
Expand Down

0 comments on commit 2106b64

Please sign in to comment.