mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
[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
This commit is contained in:
committed by
Matteo Pagliazzi
parent
826d7b85d7
commit
ff08e8b586
@@ -0,0 +1,15 @@
|
||||
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;
|
||||
};
|
||||
}]);
|
||||
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
(function(){
|
||||
angular
|
||||
.module('habitrpg')
|
||||
.directive('groupTaskMetaActions', hrpgSortTags);
|
||||
|
||||
hrpgSortTags.$inject = [
|
||||
];
|
||||
|
||||
function hrpgSortTags() {
|
||||
|
||||
return {
|
||||
scope: {
|
||||
task: '=',
|
||||
group: '=',
|
||||
},
|
||||
templateUrl: 'partials/groups.tasks.meta.actions.html',
|
||||
controller: 'GroupTaskMetaActionsCtrl',
|
||||
};
|
||||
}
|
||||
}());
|
||||
Reference in New Issue
Block a user