assign to me feature

codacy fix

codacy fix #2

revert translation files

coding style : spaces to tabs

Signed-off-by: Philippe Le Van <philippe.levan@kibatic.com>
This commit is contained in:
Philippe Le Van
2018-07-22 10:24:35 +02:00
parent 6313f24dc9
commit f25401e9fd
3 changed files with 39 additions and 6 deletions

View File

@@ -200,6 +200,27 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
CardService.archive(card);
StackService.removeCard(card);
};
$scope.isCurrentUserAssigned = function (card) {
if (! CardService.get(card.id).assignedUsers) {
return false;
}
var userList = CardService.get(card.id).assignedUsers.filter(function (obj) {
return obj.participant.uid === OC.getCurrentUser().uid;
});
return userList.length === 1;
};
$scope.cardAssignToMe = function (card) {
CardService.assignUser(card, OC.getCurrentUser().uid)
.then(
function() {StackService.updateCard(card);}
);
$('.popovermenu').addClass('hidden');
};
$scope.cardUnassignFromMe = function (card) {
CardService.unassignUser(card, OC.getCurrentUser().uid);
StackService.updateCard(card);
$('.popovermenu').addClass('hidden');
};
$scope.cardUnarchive = function (card) {
CardService.unarchive(card);
StackService.removeCard(card);