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:
Keith Holliday
2017-02-27 11:34:03 -07:00
committed by GitHub
parent 44f23a7675
commit 30954fe7c5
21 changed files with 182 additions and 42 deletions

View File

@@ -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);
})