Improved - Using presenters for column headers in location detail

This commit is contained in:
snipe 2018-01-11 15:16:09 -08:00
parent cf1b5a7685
commit a4ac53e2e9

View file

@ -30,29 +30,14 @@
<div class="table table-responsive">
<table
name="location_users"
id="table-users"
id="location_usersDetailTable"
class="table table-striped snipe-table"
data-url="{{route('api.users.index', ['location_id' => $location->id])}}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="location_usersDetailTable">
<thead>
<tr>
<th data-searchable="false" data-visible="false" data-sortable="true" data-field="id">{{ trans('general.id') }}</th>
<th data-searchable="false" data-sortable="false" data-formatter="imageFormatter" data-field="avatar">Avatar</th>
<th data-searchable="true" data-sortable="true" data-formatter="usersLinkFormatter" data-field="name">{{ trans('general.user') }}</th>
<th data-searchable="true" data-sortable="true" data-formatter="usersLinkFormatter" data-field="jobtitle">{{ trans('admin/users/table.title') }}</th>
<th data-searchable="true" data-sortable="true" data-formatter="emailFormatter" data-field="email">{{ trans('admin/users/table.email') }}</th>
<th data-searchable="true" data-visible="false" data-sortable="true" data-field="phone">{{ trans('admin/users/table.phone') }}</th>
<th data-searchable="true" data-visible="false" data-sortable="true" data-formatter="usersLinkObjFormatter" data-field="manager">{{ trans('admin/users/table.manager') }}</th>
<th data-searchable="true" data-sortable="true" data-field="assets_count"><span class="hidden-md hidden-lg">Assets</span><span class="hidden-xs"><i class="fa fa-barcode fa-lg"></i></span></th>
<th data-searchable="true" data-sortable="true" data-field="licenses_count"><span class="hidden-md hidden-lg">Licenses</span><span class="hidden-xs"><i class="fa fa-floppy-o fa-lg"></i></span></th>
<th data-searchable="true" data-sortable="true" data-field="consumables_count"><span class="hidden-md hidden-lg">Consumables</span><span class="hidden-xs"><i class="fa fa-tint fa-lg"></i></span></th>
<th data-searchable="true" data-sortable="true" data-field="accessories_count"><span class="hidden-md hidden-lg">Accessories</span><span class="hidden-xs"><i class="fa fa-keyboard-o fa-lg"></i></span></th>
<th data-searchable="true" data-sortable="true" data-formatter="departmentsLinkObjFormatter" data-field="department">{{ trans('general.department') }}</th>
<th data-searchable="true" data-sortable="true" data-formatter="usersActionsFormatter" data-field="actions">{{ trans('table.actions') }}</th>
</tr>
</thead>
data-cookie-id-table="location_usersDetailTable"
data-columns="{{ \App\Presenters\UserPresenter::dataTableLayout() }}">
</table>
</div><!-- /.table-responsive -->
</div><!-- /.box-body -->
@ -68,27 +53,12 @@
<div class="table table-responsive">
<table
name="location_assets"
id="table-assets"
id="location_assetsDetailTable"
data-url="{{route('api.assets.index', ['location_id' => $location->id]) }}"
class="table table-striped snipe-table"
data-cookie="true"
data-show-footer="true"
data-click-to-select="true"
data-cookie-id-table="location_assetsDetailTable">
<thead>
<tr>
<th data-searchable="false" data-visible="false" data-sortable="true" data-field="id">{{ trans('general.id') }}</th>
<th data-searchable="false" data-visible="true" data-sortable="false" data-formatter="imageFormatter" data-field="image">{{ trans('admin/hardware/table.image') }}</th>
<th data-searchable="true" data-sortable="true" data-formatter="hardwareLinkFormatter" data-field="name">{{ trans('general.name') }}</th>
<th data-searchable="true" data-formatter="modelsLinkObjFormatter" data-sortable="true" data-field="model">{{ trans('admin/hardware/form.model') }}</th>
<th data-searchable="true" data-sortable="true" data-field="asset_tag" data-formatter="hardwareLinkFormatter">{{ trans('admin/hardware/form.tag') }}</th>
<th data-searchable="true" data-sortable="true" data-field="serial">{{ trans('admin/hardware/form.serial') }}</th>
<th data-searchable="true" data-visible="false" data-sortable="true" data-field="category" data-formatter="categoriesLinkObjFormatter">{{ trans('general.category') }}</th>
<th data-field="purchase_cost" data-searchable="true" data-sortable="true" data-footer-formatter="sumFormatter">{{ trans('general.purchase_cost') }}</th>
<th data-searchable="false" data-sortable="false" data-field="checkincheckout" data-formatter="hardwareInOutFormatter">Checkin/Checkout</th>
<th data-searchable="false" data-sortable="false" data-field="actions" data-formatter="hardwareActionsFormatter">{{ trans('table.actions') }}</th>
</tr>
</thead>
data-cookie-id-table="location_assetsDetailTable"
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}">
</table>
</div><!-- /.table-responsive -->
</div><!-- /.box-body -->
@ -143,6 +113,9 @@
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', ['exportFile' => 'locations-export', 'search' => true])
@include ('partials.bootstrap-table', [
'exportFile' => 'locations-export',
'search' => true
])
@stop