Fixed quickEdit mode in agenda, motion, assignment.
Refresh motion object after cancel.
This commit is contained in:
parent
6ba47a64d3
commit
82f2c4f003
@ -126,6 +126,12 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
|
|||||||
$state.go(item.content_object.collection.replace('/','.')+'.detail',
|
$state.go(item.content_object.collection.replace('/','.')+'.detail',
|
||||||
{id: item.content_object.id});
|
{id: item.content_object.id});
|
||||||
};
|
};
|
||||||
|
// cancel QuickEdit mode
|
||||||
|
$scope.cancelQuickEdit = function (item) {
|
||||||
|
// revert all changes by restore (refresh) original item object from server
|
||||||
|
Agenda.refresh(item);
|
||||||
|
item.quickEdit = false;
|
||||||
|
};
|
||||||
// save changed item
|
// save changed item
|
||||||
$scope.save = function (item) {
|
$scope.save = function (item) {
|
||||||
Agenda.save(item).then(
|
Agenda.save(item).then(
|
||||||
|
@ -168,7 +168,6 @@
|
|||||||
<input os-perms="agenda.can_manage" type="checkbox" ng-model="item.closed" ng-change="save(item.id);">
|
<input os-perms="agenda.can_manage" type="checkbox" ng-model="item.closed" ng-change="save(item.id);">
|
||||||
<!-- quickEdit columns -->
|
<!-- quickEdit columns -->
|
||||||
<td ng-show="item.quickEdit" os-perms="agenda.can_manage" colspan="3">
|
<td ng-show="item.quickEdit" os-perms="agenda.can_manage" colspan="3">
|
||||||
<form ng-submit="save(item)">
|
|
||||||
<h4>{{ item.getTitle() }} <span class="text-muted">– QuickEdit</span></h4>
|
<h4>{{ item.getTitle() }} <span class="text-muted">– QuickEdit</span></h4>
|
||||||
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
{{ alert.msg }}
|
{{ alert.msg }}
|
||||||
@ -195,15 +194,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="spacer">
|
<div class="spacer">
|
||||||
<button ng-click="item.quickEdit=false" class="btn btn-default pull-left" translate>
|
<button ng-click="cancelQuickEdit(item)" class="btn btn-default pull-left" translate>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button type="submit" class="btn btn-primary" translate>
|
<button ng-click="save(item)" class="btn btn-primary" translate>
|
||||||
Update
|
Update
|
||||||
</button>
|
</button>
|
||||||
<a href="" ng-click="editDialog(item)" class="pull-right"><translate>Edit ...</translate></a>
|
<a href="" ng-click="editDialog(item)" class="pull-right"><translate>Edit ...</translate></a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
</table>
|
</table>
|
||||||
<uib-pagination total-items="itemsFiltered.length" items-per-page="itemsPerPage" ng-model="currentPage" ng-change="pageChanged()"></uib-pagination>
|
<uib-pagination total-items="itemsFiltered.length" items-per-page="itemsPerPage" ng-model="currentPage" ng-change="pageChanged()"></uib-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
@ -203,6 +203,12 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
|
|||||||
$scope.openDialog = function (assignment) {
|
$scope.openDialog = function (assignment) {
|
||||||
ngDialog.open(AssignmentForm.getDialog(assignment));
|
ngDialog.open(AssignmentForm.getDialog(assignment));
|
||||||
};
|
};
|
||||||
|
// cancel QuickEdit mode
|
||||||
|
$scope.cancelQuickEdit = function (assignment) {
|
||||||
|
// revert all changes by restore (refresh) original assignment object from server
|
||||||
|
Assignment.refresh(assignment);
|
||||||
|
assignment.quickEdit = false;
|
||||||
|
};
|
||||||
// save changed assignment
|
// save changed assignment
|
||||||
$scope.save = function (assignment) {
|
$scope.save = function (assignment) {
|
||||||
Assignment.save(assignment).then(
|
Assignment.save(assignment).then(
|
||||||
|
@ -162,7 +162,7 @@
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
<!-- quickEdit columns -->
|
<!-- quickEdit columns -->
|
||||||
<td ng-if="assignment.quickEdit" colspan="3">
|
<td ng-if="assignment.quickEdit" colspan="4">
|
||||||
<h4>{{ assignment.title }} <span class="text-muted">– Quick Edit</span></h4>
|
<h4>{{ assignment.title }} <span class="text-muted">– Quick Edit</span></h4>
|
||||||
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
{{ alert.msg }}
|
{{ alert.msg }}
|
||||||
@ -187,7 +187,7 @@
|
|||||||
<div class="col-xs-6"></div>
|
<div class="col-xs-6"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="spacer">
|
<div class="spacer">
|
||||||
<button ng-click="assignment.quickEdit=false" class="btn btn-default pull-left" translate>
|
<button ng-click="cancelQuickEdit(assignment)" class="btn btn-default pull-left" translate>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button ng-click="save(assignment)" class="btn btn-primary" translate>
|
<button ng-click="save(assignment)" class="btn btn-primary" translate>
|
||||||
|
@ -467,6 +467,12 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
$scope.openDialog = function (motion) {
|
$scope.openDialog = function (motion) {
|
||||||
ngDialog.open(MotionForm.getDialog(motion));
|
ngDialog.open(MotionForm.getDialog(motion));
|
||||||
};
|
};
|
||||||
|
// cancel QuickEdit mode
|
||||||
|
$scope.cancelQuickEdit = function (motion) {
|
||||||
|
// revert all changes by restore (refresh) original motion object from server
|
||||||
|
Motion.refresh(motion);
|
||||||
|
motion.quickEdit = false;
|
||||||
|
};
|
||||||
// save changed motion
|
// save changed motion
|
||||||
$scope.save = function (motion) {
|
$scope.save = function (motion) {
|
||||||
// get (unchanged) values from latest version for update method
|
// get (unchanged) values from latest version for update method
|
||||||
|
@ -197,7 +197,7 @@
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
<!-- quickEdit columns -->
|
<!-- quickEdit columns -->
|
||||||
<td ng-if="motion.quickEdit && motion.isAllowed('quickedit')" colspan="5">
|
<td ng-if="motion.quickEdit && motion.isAllowed('quickedit')" colspan="6">
|
||||||
<h4>{{ motion.getTitle() }} <span class="text-muted">– <translate>QuickEdit</translate></span></h4>
|
<h4>{{ motion.getTitle() }} <span class="text-muted">– <translate>QuickEdit</translate></span></h4>
|
||||||
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
{{ alert.msg }}
|
{{ alert.msg }}
|
||||||
@ -255,7 +255,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="spacer">
|
<div class="spacer">
|
||||||
<button ng-click="motion.quickEdit=false" class="btn btn-default pull-left" translate>
|
<button ng-click="cancelQuickEdit(motion)" class="btn btn-default pull-left" translate>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button ng-if="motion.isAllowed('update')" ng-click="save(motion)" class="btn btn-primary" translate>
|
<button ng-if="motion.isAllowed('update')" ng-click="save(motion)" class="btn btn-primary" translate>
|
||||||
|
Loading…
Reference in New Issue
Block a user