Agenda list view: allow to delete also motion and assignment items.

Fixes #1943
This commit is contained in:
Emanuel Schuetze 2016-02-08 21:07:35 +01:00
parent f89f3a9933
commit 6ba47a64d3
2 changed files with 9 additions and 15 deletions

View File

@ -71,13 +71,13 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
'$scope',
'$http',
'$state',
'DS',
'operator',
'ngDialog',
'Agenda',
'AgendaTree',
'Customslide',
'Projector',
function($scope, $http, $state, operator, ngDialog, Agenda, AgendaTree, Customslide, Projector) {
function($scope, $http, $state, DS, operator, ngDialog, Agenda, AgendaTree, Projector) {
// Bind agenda tree to the scope
$scope.$watch(function () {
return Agenda.lastModified();
@ -143,9 +143,7 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
};
// delete related item
$scope.deleteRelatedItem = function (item) {
if (item.content_object.collection == 'core/customslide') {
Customslide.destroy(item.content_object.id);
}
DS.destroy(item.content_object.collection, item.content_object.id);
};
// *** delete mode functions ***
@ -169,9 +167,7 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
$scope.delete = function () {
angular.forEach($scope.items, function (item) {
if (item.selected) {
if (item.content_object.collection == 'core/customslide') {
Customslide.destroy(item.content_object.id);
}
DS.destroy(item.content_object.collection, item.content_object.id);
}
});
$scope.isDeleteMode = false;

View File

@ -151,14 +151,12 @@
<a ui-sref="agenda.item.detail({id: item.id})" translate>List of speakers</a>
<span os-perms="agenda.can_manage"> |
<a href="" ng-click="editDialog(item)" translate>Edit</a> |
<a href="" ng-click="item.quickEdit=true" translate>QuickEdit</a>
<span ng-if="item.content_object.collection == 'core/customslide'"> |
<a href="" ng-click="item.quickEdit=true" translate>QuickEdit</a> |
<a href="" class="text-danger"
ng-bootbox-confirm="{{ 'Are you sure you want to delete this entry?' | translate }}<br>
<b>{{ item.getTitle() }}</b>"
ng-bootbox-confirm-action="deleteRelatedItem(item)" translate>Delete</a>
</span>
</span>
</div>
<td ng-show="!item.quickEdit" os-perms="agenda.can_see_hidden_items" class="optional">
{{ item.duration }}