mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Added support for grouping tasks by challenge (#8469)
* Added support for grouping tasks by chllenge * Fixed tests and updated default challenge model name * Fixed broken member test * Updated setting string * Changed to shortName * Began abstracting task grouping * Added initial task directive code * Added new directives to help with grouping of tasks * Removed random console.log
This commit is contained in:
@@ -167,8 +167,8 @@ window.habitrpg = angular.module('habitrpg',
|
||||
url: '/:gid',
|
||||
templateUrl: 'partials/options.social.guilds.detail.html',
|
||||
title: env.t('titleGuilds'),
|
||||
controller: ['$scope', 'Groups', 'Chat', '$stateParams', 'Members', 'Challenges', 'Tasks', 'User', '$location',
|
||||
function($scope, Groups, Chat, $stateParams, Members, Challenges, Tasks, User, $location) {
|
||||
controller: ['$scope', 'Groups', 'Chat', '$stateParams', 'Members', 'Challenges', 'Tasks', 'User', '$location', '$rootScope',
|
||||
function($scope, Groups, Chat, $stateParams, Members, Challenges, Tasks, User, $location, $rootScope) {
|
||||
$scope.groupPanel = 'chat';
|
||||
$scope.upgrade = false;
|
||||
|
||||
@@ -222,6 +222,7 @@ window.habitrpg = angular.module('habitrpg',
|
||||
}).value();
|
||||
|
||||
$scope.group.approvals = [];
|
||||
$rootScope.$broadcast('obj-updated', $scope.group);
|
||||
if (User.user._id === $scope.group.leader._id) {
|
||||
return Tasks.getGroupApprovals($scope.group._id);
|
||||
}
|
||||
@@ -257,7 +258,7 @@ window.habitrpg = angular.module('habitrpg',
|
||||
tasks.forEach(function (element, index, array) {
|
||||
if (!$scope.challenge[element.type + 's']) $scope.challenge[element.type + 's'] = [];
|
||||
$scope.challenge[element.type + 's'].push(element);
|
||||
})
|
||||
});
|
||||
|
||||
return Members.getChallengeMembers($scope.challenge._id);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user