Files
habitica/website/client-old/js/components/groupTaskMetaActions/groupTaskMetaActionsController.js
Keith Holliday ff08e8b586 [WIP] Group tasks claim (#8099)
* Added initial group tasks ui

* Changed group compnent directory

* Added group task checklist support

* Added checklist support to ui

* Fixed delete tags route

* Added checklist routes to support new group tasks

* Added assign user tag input

* Added new group members autocomplete directive

* Linked assign ui to api

* Added styles

* Limited tag use

* Fixed line endings

* Updated to new file structure

* Fixed failing task tests

* Updatd with new checklist logic and fixed columns

* Updated add task function

* Added userid check back to tag routes

* Added back routes accidently deleted

* Added locale strings

* Moved common task function to task service

* Removed files from manifest

* Added initial group tasks ui

* Changed group compnent directory

* Added checklist support to ui

* Added assign user tag input

* Added assign user tag input

* Added new group members autocomplete directive

* Added new group members autocomplete directive

* Removed group get tasks until live

* Linked assign ui to api

* Added styles

* Added server code for claiming a task

* ADded group task meta and claim button

* Adjusted styles, added local, and added confirm

* Updated claim with new file structures

* Fixed merge issue

* Removed extra file

* Removed duplicate functions

* Removed extra directive

* Removed dev items
2016-10-09 19:23:34 +02:00

16 lines
558 B
JavaScript

habitrpg.controller('GroupTaskMetaActionsCtrl', ['$scope', 'Shared', 'Tasks', 'User',
function ($scope, Shared, Tasks, User) {
$scope.assignedMembers = [];
$scope.user = User.user;
$scope.claim = function () {
if (!confirm("Are you sure you want to claim this task?")) return;
Tasks.assignTask($scope.task.id, $scope.user._id);
$scope.task.group.assignedUsers.push($scope.user._id);
};
$scope.userIsAssigned = function () {
return $scope.task.group.assignedUsers.indexOf($scope.user._id) !== -1;
};
}]);