parent
c952798e66
commit
b1d1fa4880
@ -1,14 +1,111 @@ |
|||||||
@php($tab='review') |
@php |
||||||
|
$tab = 'review'; |
||||||
|
/** @var \App\Tables\Changeset $changeset */ |
||||||
|
/** @var \App\Models\Table $table */ |
||||||
|
|
||||||
|
$numChangedRows = count($changeset->rowUpdates); |
||||||
|
$numNewRows = count($changeset->newRows); |
||||||
|
$numRemovedRows = count($changeset->removedRows); |
||||||
|
|
||||||
|
$anyRowChanges = $numChangedRows || $numNewRows || $numRemovedRows; |
||||||
|
|
||||||
|
$numChangedColumns = count($changeset->columnUpdates); |
||||||
|
$numNewColumns = count($changeset->newColumns); |
||||||
|
$numRemovedColumns = count($changeset->removedColumns); |
||||||
|
$colsReordered = !empty($changeset->columnOrder); |
||||||
|
|
||||||
|
$anyColChanges = $numChangedColumns || $numNewColumns || $numRemovedColumns || $colsReordered; |
||||||
|
|
||||||
|
$anyChanges = $anyRowChanges || $anyColChanges; |
||||||
|
@endphp |
||||||
|
|
||||||
@extends('table.propose.layout') |
@extends('table.propose.layout') |
||||||
|
|
||||||
@section('tab-content') |
@section('tab-content') |
||||||
|
<div class="my-3 col-md-12"> |
||||||
|
<div class="mx-3"> |
||||||
|
|
||||||
|
<?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($anyRowChanges) |
||||||
|
|
||||||
|
@if($numChangedRows) |
||||||
|
<div class="text-info"><b>{{ $numChangedRows }}</b> changed</div> |
||||||
|
@endif |
||||||
|
|
||||||
|
@if($numNewRows) |
||||||
|
<div class="text-success"><b>{{ $numNewRows }}</b> new</div> |
||||||
|
@endif |
||||||
|
|
||||||
|
@if($numRemovedRows) |
||||||
|
<div class="text-danger"><b>{{ $numRemovedRows }}</b> removed</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($anyColChanges) |
||||||
|
|
||||||
|
@if($numChangedColumns) |
||||||
|
<div class="text-info"><b>{{ $numChangedColumns }}</b> changed</div> |
||||||
|
@endif |
||||||
|
|
||||||
|
@if($numNewColumns) |
||||||
|
<div class="text-success"><b>{{ $numNewColumns }}</b> new</div> |
||||||
|
@endif |
||||||
|
|
||||||
|
@if($numRemovedColumns) |
||||||
|
<div class="text-danger"><b>{{ $numRemovedColumns }}</b> removed</div> |
||||||
|
@endif |
||||||
|
|
||||||
|
@if($colsReordered) |
||||||
|
<div class="text-info">Order changed</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"> |
||||||
@if(user()->ownsTable($table)) |
@if(user()->ownsTable($table)) |
||||||
<a href="" class="btn btn-outline-success" @tooltip(Save the changes and apply them as a new table revision)> |
<a href="" class="btn btn-outline-success {{$anyChanges?'':'disabled'}}"> |
||||||
@icon(fa-save fa-pr)Commit |
@icon(fa-save fa-pr)Save & Apply |
||||||
</a> |
</a> |
||||||
@else |
@else |
||||||
<a href="" class="btn btn-outline-success" @tooltip(Submit your changes for review by the table owner)> |
<a href="" class="btn btn-outline-success {{$anyChanges?'':'disabled'}}"> |
||||||
@icon(fa-save fa-pr)Submit |
@icon(fa-paper-plane-o fa-pr)Submit for review |
||||||
</a> |
</a> |
||||||
@endif |
@endif |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
</div> |
||||||
|
</div> |
||||||
@stop |
@stop |
||||||
|
Loading…
Reference in new issue