datatable.directory codebase
https://datatable.directory/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
145 lines
4.8 KiB
145 lines
4.8 KiB
@php
|
|
$tab = 'review';
|
|
/** @var \App\Tables\Changeset $changeset */
|
|
/** @var \App\Models\Table $table */
|
|
|
|
$rowChanges = $changeset->getRowChangeCounts();
|
|
$columnChanges = $changeset->getColumnChangeCounts();
|
|
|
|
$anyChanges = ($rowChanges->any || $columnChanges->any) && strlen(trim($changeset->note)) > 0;
|
|
@endphp
|
|
|
|
@extends('table.propose.layout')
|
|
|
|
@section('tab-content')
|
|
<div class="my-3 col-md-12">
|
|
<form class="mx-3 form" method="POST" action="{{$table->draftSubmitRoute}}">
|
|
@csrf
|
|
|
|
<?php Widget::setLayout(3,7) ?>
|
|
|
|
{!! Widget::header(3, 'Change Summary') !!}
|
|
|
|
<div class="row border-bottom border-top py-3">
|
|
<div class="col-md-3 text-right">
|
|
Rows
|
|
</div>
|
|
<div class="col-md-7">
|
|
@if($rowChanges->any)
|
|
|
|
@if($rowChanges->changed)
|
|
<div class="text-info">
|
|
<b>{{ $rowChanges->changed }}</b> changed
|
|
<a href="{{$table->draftUpdateRoute}}?action=reset.row-update" class="ml-2"
|
|
data-confirm="Revert all row changes?">Reset</a>
|
|
</div>
|
|
@endif
|
|
|
|
@if($rowChanges->new)
|
|
<div class="text-success">
|
|
<b>{{ $rowChanges->new }}</b> new
|
|
<a href="{{$table->draftUpdateRoute}}?action=reset.row-add" class="ml-2"
|
|
data-confirm="Discard all added rows?">Reset</a>
|
|
</div>
|
|
@endif
|
|
|
|
@if($rowChanges->removed)
|
|
<div class="text-danger">
|
|
<b>{{ $rowChanges->removed }}</b> removed
|
|
<a href="{{$table->draftUpdateRoute}}?action=reset.row-remove" class="ml-2"
|
|
data-confirm="Undo row removals?">Reset</a>
|
|
</div>
|
|
@endif
|
|
|
|
@else
|
|
<span class="text-muted">No changes</span>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row border-bottom py-3 mb-3">
|
|
<div class="col-md-3 text-right">
|
|
Columns
|
|
</div>
|
|
<div class="col-md-7">
|
|
@if($columnChanges->any)
|
|
|
|
@if($columnChanges->changed)
|
|
<div class="text-info">
|
|
<b>{{ $columnChanges->changed }}</b> changed
|
|
<a href="{{$table->draftUpdateRoute}}?action=reset.col-update" class="ml-2"
|
|
data-confirm="Revert all column changes?">Reset</a>
|
|
</div>
|
|
@endif
|
|
|
|
@if($columnChanges->new)
|
|
<div class="text-success">
|
|
<b>{{ $columnChanges->new }}</b> new
|
|
<a href="{{$table->draftUpdateRoute}}?action=reset.col-add" class="ml-2"
|
|
data-confirm="Discard all added columns?">Reset</a>
|
|
</div>
|
|
@endif
|
|
|
|
@if($columnChanges->removed)
|
|
<div class="text-danger">
|
|
<b>{{ $columnChanges->removed }}</b> removed
|
|
<a href="{{$table->draftUpdateRoute}}?action=reset.col-remove" class="ml-2"
|
|
data-confirm="Undo column removals?">Reset</a>
|
|
</div>
|
|
@endif
|
|
|
|
@if($columnChanges->reordered)
|
|
<div class="text-info">
|
|
Order changed
|
|
<a href="{{$table->draftUpdateRoute}}?action=reset.col-order" class="ml-2"
|
|
data-confirm="Reset column order changes?">Reset</a>
|
|
</div>
|
|
@endif
|
|
|
|
@else
|
|
<span class="text-muted">No changes</span>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
{!! Widget::textarea('note', 'Summary')->value($changeset->note)
|
|
->help(user()->ownsTable($table) ?
|
|
"Describe changes you made to the table; this message will annotate the
|
|
new table revision." :
|
|
"Describe you suggested changes. The table owner will read this message
|
|
and review your changes before deciding whether to accept the proposal."
|
|
)->minHeight('8em')
|
|
!!}
|
|
|
|
<div class="row">
|
|
<div class="col-md-7 offset-md-3">
|
|
<button type="submit" id="submit-button" class="btn btn-outline-success {{$anyChanges?'':'disabled'}}">
|
|
@if(user()->ownsTable($table))
|
|
@icon(fa-save fa-pr)Save & Apply
|
|
@else
|
|
@icon(fa-paper-plane-o fa-pr)Submit for review
|
|
@endif
|
|
</button>
|
|
|
|
@if($rowChanges->any || $columnChanges->any)
|
|
<span class="text-muted ml-3" id="empty-note-prompt">Write a summary to submit your changes.</span>
|
|
@else
|
|
<span class="text-danger ml-3">No changes to submit.</span>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
@stop
|
|
|
|
@push('scripts')
|
|
<script>
|
|
ready(function () {
|
|
app.DraftNotePage({
|
|
route: @json($table->draftUpdateRoute),
|
|
anyChanges: @json($rowChanges->any || $columnChanges->any)
|
|
})
|
|
})
|
|
</script>
|
|
@endpush
|
|
|