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') |
||||
|
||||
@section('tab-content') |
||||
@if(user()->ownsTable($table)) |
||||
<a href="" class="btn btn-outline-success" @tooltip(Save the changes and apply them as a new table revision)> |
||||
@icon(fa-save fa-pr)Commit |
||||
</a> |
||||
@else |
||||
<a href="" class="btn btn-outline-success" @tooltip(Submit your changes for review by the table owner)> |
||||
@icon(fa-save fa-pr)Submit |
||||
</a> |
||||
@endif |
||||
<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)) |
||||
<a href="" class="btn btn-outline-success {{$anyChanges?'':'disabled'}}"> |
||||
@icon(fa-save fa-pr)Save & Apply |
||||
</a> |
||||
@else |
||||
<a href="" class="btn btn-outline-success {{$anyChanges?'':'disabled'}}"> |
||||
@icon(fa-paper-plane-o fa-pr)Submit for review |
||||
</a> |
||||
@endif |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
@stop |
||||
|
Loading…
Reference in new issue