Submit route, fixes in col editor
This commit is contained in:
@@ -283,6 +283,7 @@ export default {
|
||||
}, (resp) => {
|
||||
resp.data._editing = true;
|
||||
this.columns.push(resp.data)
|
||||
this.initColLoadvals(resp.data)
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -405,15 +406,21 @@ export default {
|
||||
if (!editing) {
|
||||
this.submitColChange(col)
|
||||
} else {
|
||||
let origvals = {};
|
||||
_.each(col, (v, k) => {
|
||||
if (k[0] != '_') origvals[k] = v
|
||||
})
|
||||
this.$set(this.columns[n], '_loadvals', origvals)
|
||||
this.initColLoadvals(col)
|
||||
this.$set(this.columns[n], '_editing', true)
|
||||
}
|
||||
},
|
||||
|
||||
initColLoadvals(col) {
|
||||
let n = this.colPos(col)
|
||||
|
||||
let origvals = {};
|
||||
_.each(col, (v, k) => {
|
||||
if (k[0] != '_') origvals[k] = v
|
||||
})
|
||||
this.$set(this.columns[n], '_loadvals', origvals)
|
||||
},
|
||||
|
||||
/** Test if a value cell is changed */
|
||||
isChanged (col, cell) {
|
||||
return col._changed && col._changed.indexOf(cell) > -1
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
|
||||
@section('tab-content')
|
||||
<div class="my-3 col-md-12">
|
||||
<div class="mx-3">
|
||||
<form class="mx-3 form" method="POST" action="{{$table->draftSubmitRoute}}">
|
||||
@csrf
|
||||
|
||||
<?php Widget::setLayout(3,7) ?>
|
||||
|
||||
@@ -122,15 +123,13 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-7 offset-md-3">
|
||||
@if(user()->ownsTable($table))
|
||||
<a href="" id="submit-button" class="btn btn-outline-success {{$anyChanges?'':'disabled'}}">
|
||||
<button type="submit" id="submit-button" class="btn btn-outline-success {{$anyChanges?'':'disabled'}}">
|
||||
@if(user()->ownsTable($table))
|
||||
@icon(fa-save fa-pr)Save & Apply
|
||||
</a>
|
||||
@else
|
||||
<a href="" id="submit-button" class="btn btn-outline-success {{$anyChanges?'':'disabled'}}">
|
||||
@else
|
||||
@icon(fa-paper-plane-o fa-pr)Submit for review
|
||||
</a>
|
||||
@endif
|
||||
@endif
|
||||
</button>
|
||||
|
||||
@if($anyRowChanges || $anyColChanges)
|
||||
<span class="text-muted ml-3" id="empty-note-prompt">Write a summary to submit your changes.</span>
|
||||
@@ -140,7 +139,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
|
||||
Reference in New Issue
Block a user