API-ify the managed locations tab in user view

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-02-20 16:44:20 +00:00
parent 50b841d54d
commit 0383938536

View file

@ -1015,23 +1015,36 @@
</div><!-- /.tab-pane -->
<div class="tab-pane" id="managed">
<div class="table-responsive">
<table class="table display table-striped">
<thead>
<tr>
<th class="col-md-8">{{ trans('general.name') }}</th>
<th class="col-md-4">{{ trans('general.date') }}</th>
</tr>
</thead>
<tbody>
@foreach ($user->managedLocations as $location)
<tr>
<td>{!! $location->present()->nameUrl() !!}</td>
<td>{{ $location->created_at }}</td>
</tr>
@endforeach
</tbody>
</table>
@include('partials.locations-bulk-actions')
<table
data-columns="{{ \App\Presenters\LocationPresenter::dataTableLayout() }}"
data-cookie-id-table="locationTable"
data-click-to-select="true"
data-pagination="true"
data-id-table="locationTable"
data-toolbar="#locationsBulkEditToolbar"
data-bulk-button-id="#bulkLocationsEditButton"
data-bulk-form-id="#locationsBulkForm"
data-search="true"
data-show-footer="true"
data-side-pagination="server"
data-show-columns="true"
data-show-fullscreen="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="locationTable"
class="table table-striped snipe-table"
data-url="{{ route('api.locations.index', ['manager_id' => $user->id]) }}"
data-export-options='{
"fileName": "export-locations-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>
</div><!-- /consumables-tab -->
</div><!-- /.tab-content -->