stub of the row editor

This commit is contained in:
2018-08-05 14:45:43 +02:00
parent e17548e5e7
commit bb8bc459dc
34 changed files with 724 additions and 175 deletions
@@ -0,0 +1,43 @@
@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')
@section('tab-content')
@if($rows->hasPages())
<div class="col-md-12 d-flex">
<nav class="text-center" aria-label="Pages of the table">
{{ $rows->links(null, ['ulClass' => 'mb-0']) }}
</nav>
</div>
@endif
<div class="col-12">
@php
$transformed = $rows->keyBy('_id')->map(function($r) use ($changeset) {
/** @var \App\Tables\Changeset $changeset */
return $changeset->transformRow($r, true);
});
@endphp
<table is="row-editor"
route="{{$table->getDraftRoute('update')}}"
:columns="{{toJSON($columns)}}"
:x-rows="{{toJSON($transformed)}}">
</table>
</div>
@if($rows->hasPages())
<div class="col-md-12 d-flex">
<nav class="text-center" aria-label="Pages of the table">
{{ $rows->links(null, ['ulClass' => 'mb-0']) }}
</nav>
</div>
@endif
@stop