Note tab added
This commit is contained in:
@@ -48,13 +48,7 @@ if (!isset($tab) || $tab == '') $tab = 'edit-rows';
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="text-success nav-link {{ $tab=='review' ? 'active' : '' }}" href="{{ $table->getDraftRoute('review') }}">
|
||||
@if(user()->ownsTable($table))
|
||||
@icon(fa-save fa-pr){{--
|
||||
--}}Review & Apply
|
||||
@else
|
||||
@icon(fa-paper-plane-o fa-pr){{--
|
||||
--}}Review & Submit
|
||||
@endif
|
||||
@icon(fa-save fa-pr)Review & Confirm
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item pt-2 pr-2 opacity-fade ml-auto" style="opacity:0" id="draft-busy">
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user