Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2021-02-25 16:44:55 -08:00
commit 00a7c1e9e2
2 changed files with 26 additions and 40 deletions

View file

@ -96,8 +96,9 @@ class AssetModelsController extends Controller
break; break;
} }
$total = $assetmodels->count();
$assetmodels = $assetmodels->skip($offset)->take($limit)->get(); $assetmodels = $assetmodels->skip($offset)->take($limit)->get();
return (new AssetModelsTransformer)->transformAssetModels($assetmodels, $assetmodels->count()); return (new AssetModelsTransformer)->transformAssetModels($assetmodels, $total);
} }

View file

@ -15,7 +15,7 @@
{{-- Page title --}} {{-- Page title --}}
@section('header_right') @section('header_right')
@can('create', \App\Models\AssetModel::class) @can('create', \App\Models\AssetModel::class)
<a href="{{ route('models.create') }}" class="btn btn-primary pull-right"></i> {{ trans('general.create') }}</a> <a href="{{ route('models.create') }}" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
@endcan @endcan
@if (Request::get('status')=='deleted') @if (Request::get('status')=='deleted')
@ -46,7 +46,7 @@
@if (Request::get('status')!='deleted') @if (Request::get('status')!='deleted')
<div id="toolbar"> <div id="toolbar">
<label for="bulk_actions" class="sr-only">Bulk Actions</label> <label for="bulk_actions" class="sr-only">Bulk Actions</label>
<select name="bulk_actions" class="form-control select2" aria-label="bulk_actions" style="width: 300px;"> <select id="bulk_actions" name="bulk_actions" class="form-control select2" aria-label="bulk_actions" style="width: 300px;">
<option value="edit">Bulk Edit</option> <option value="edit">Bulk Edit</option>
<option value="delete">Bulk Delete</option> <option value="delete">Bulk Delete</option>
</select> </select>
@ -55,46 +55,31 @@
@endif @endif
<div class="table-responsive"> <div class="table-responsive">
<table <table
data-cookie-id-table="modelsTable" data-columns="{{ \App\Presenters\AssetModelPresenter::dataTableLayout() }}"
data-cookie-id-table="asssetModelsTable"
data-pagination="true" data-pagination="true"
data-id-table="modelsTable" data-id-table="asssetModelsTable"
data-search="true" data-search="true"
data-show-footer="true"
data-side-pagination="server" data-side-pagination="server"
data-show-columns="true" data-show-columns="true"
data-toolbar="#toolbar" data-toolbar="#toolbar"
data-show-export="true" data-show-export="true"
data-show-refresh="true" data-show-refresh="true"
data-sort-order="asc" data-sort-order="asc"
id="modelsTable" id="asssetModelsTable"
data-url="{{ route('api.models.index', ['status'=> e(Request::get('status'))]) }}"
class="table table-striped snipe-table" class="table table-striped snipe-table"
data-url="{{ route('api.models.index') }}"
data-export-options='{ data-export-options='{
"fileName": "export-asset-models-{{ date('Y-m-d') }}", "fileName": "export-models-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'> }'>
<thead>
<tr>
<th data-checkbox="true" data-field="checkbox"></th>
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-sortable="true" data-field="name" data-formatter="modelsLinkFormatter">{{ trans('general.name') }}</th>
<th data-sortable="true" data-field="image" data-formatter="imageFormatter" data-visible="false">{{ trans('admin/hardware/table.image') }}</th>
<th data-sortable="true" data-field="manufacturer" data-formatter="manufacturersLinkObjFormatter">{{ trans('general.manufacturer') }}</th>
<th data-sortable="true" data-field="model_number">{{ trans('admin/models/table.modelnumber') }}</th>
<th data-sortable="true" data-field="assets_count">{{ trans('admin/models/table.numassets') }}</th>
<th data-sortable="false" data-field="depreciation" data-formatter="depreciationsLinkObjFormatter">{{ trans('general.depreciation') }}</th>
<th data-sortable="true" data-field="category" data-formatter="categoriesLinkObjFormatter">{{ trans('general.category') }}</th>
<th data-sortable="true" data-field="eol">{{ trans('general.eol') }}</th>
<th data-sortable="false" data-field="fieldset" data-formatter="fieldsetsLinkObjFormatter">{{ trans('admin/models/general.fieldset') }}</th>
<th data-sortable="true" data-field="notes">{{ trans('general.notes') }}</th>
<th data-switchable="false" data-formatter="modelsActionsFormatter" data-searchable="false" data-sortable="false" data-field="actions">{{ trans('table.actions') }}</th>
</tr>
</thead>
</table> </table>
</div>
</div>
</div>
{{ Form::close() }} {{ Form::close() }}
</div>
</div>
</div>
</div><!-- /.box-body --> </div><!-- /.box-body -->
</div><!-- /.box --> </div><!-- /.box -->
</div> </div>