|
|
|
@php
|
|
|
|
$tab = 'edit-rows';
|
|
|
|
/** @var \App\Tables\Column[] $columns */
|
|
|
|
/** @var \App\Tables\Changeset $changeset */
|
|
|
|
/** @var \App\Models\Row[]|Illuminate\Pagination\Paginator $rows */
|
|
|
|
/** @var \App\Models\Table $table */
|
|
|
|
@endphp
|
|
|
|
|
|
|
|
@extends('table.propose.layout-row-pagination')
|
|
|
|
|
|
|
|
@section('rows')
|
|
|
|
@php
|
|
|
|
$transformed = $rows->keyBy('_id')->map(function($r) use ($changeset) {
|
|
|
|
/** @var \App\Tables\Changeset $changeset */
|
|
|
|
return $changeset->transformRow($r, true);
|
|
|
|
});
|
|
|
|
@endphp
|
|
|
|
|
|
|
|
<div id="rows-editor"></div>
|
|
|
|
@stop
|
|
|
|
|
|
|
|
@push('scripts')
|
|
|
|
<script>
|
|
|
|
ready(function() {
|
|
|
|
app.RowsEditor('#rows-editor', {
|
|
|
|
hasPages: @json($rows->hasPages()),
|
|
|
|
pager:
|
|
|
|
'<nav class="text-center" aria-label="Table pages">' +
|
|
|
|
@json((string)$rows->links(null, ['ulClass' => 'mb-0'])) +
|
|
|
|
'</nav>',
|
|
|
|
route: {!! toJSON($table->draftUpdateRoute) !!},
|
|
|
|
columns: {!! toJSON($columns) !!},
|
|
|
|
xRows: {!! toJSON($transformed, true) !!},
|
|
|
|
xRowOrder: @json($transformed->keys()),
|
|
|
|
})
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endpush
|