improve interactivity in Review page

This commit is contained in:
2018-08-11 11:41:10 +02:00
parent 70cff26719
commit 69dabab6cc
3 changed files with 69 additions and 10 deletions
+13 -4
View File
@@ -16,7 +16,7 @@
$anyColChanges = $numChangedColumns || $numNewColumns || $numRemovedColumns || $colsReordered;
$anyChanges = $anyRowChanges || $anyColChanges;
$anyChanges = ($anyRowChanges || $anyColChanges) && strlen(trim($changeset->note)) > 0;
@endphp
@extends('table.propose.layout')
@@ -123,14 +123,20 @@
<div class="row">
<div class="col-md-7 offset-md-3">
@if(user()->ownsTable($table))
<a href="" class="btn btn-outline-success {{$anyChanges?'':'disabled'}}">
<a href="" id="submit-button" 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'}}">
<a href="" id="submit-button" class="btn btn-outline-success {{$anyChanges?'':'disabled'}}">
@icon(fa-paper-plane-o fa-pr)Submit for review
</a>
@endif
@if($anyRowChanges || $anyColChanges)
<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>
@@ -141,7 +147,10 @@
@push('scripts')
<script>
ready(function () {
app.DraftNotePage(@json($table->draftUpdateRoute))
app.DraftNotePage({
route: @json($table->draftUpdateRoute),
anyChanges: @json($anyRowChanges || $anyColChanges)
})
})
</script>
@endpush