mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Added fixes for party group plans (#8366)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
habitrpg.controller("PartyCtrl", ['$rootScope','$scope','Groups','Chat','User','Challenges','$state','$compile','Analytics','Quests','Social', 'Achievement',
|
habitrpg.controller("PartyCtrl", ['$rootScope','$scope','Groups','Chat','User','Challenges','$state','$compile','Analytics','Quests','Social', 'Achievement', 'Members', 'Tasks',
|
||||||
function($rootScope, $scope, Groups, Chat, User, Challenges, $state, $compile, Analytics, Quests, Social, Achievement) {
|
function($rootScope, $scope, Groups, Chat, User, Challenges, $state, $compile, Analytics, Quests, Social, Achievement, Members, Tasks) {
|
||||||
|
|
||||||
var PARTY_LOADING_MESSAGES = 4;
|
var PARTY_LOADING_MESSAGES = 4;
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ habitrpg.controller("PartyCtrl", ['$rootScope','$scope','Groups','Chat','User','
|
|||||||
function handlePartyResponse (group) {
|
function handlePartyResponse (group) {
|
||||||
// Assign and not replace so that all the references get the modifications
|
// Assign and not replace so that all the references get the modifications
|
||||||
_.assign($rootScope.party, group);
|
_.assign($rootScope.party, group);
|
||||||
$scope.group = $rootScope.party;
|
$scope.obj = $scope.group = $rootScope.party;
|
||||||
$scope.group.loadingParty = false;
|
$scope.group.loadingParty = false;
|
||||||
checkForNotifications();
|
checkForNotifications();
|
||||||
if ($state.is('options.social.party')) {
|
if ($state.is('options.social.party')) {
|
||||||
@@ -44,7 +44,40 @@ habitrpg.controller("PartyCtrl", ['$rootScope','$scope','Groups','Chat','User','
|
|||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
Chat.markChatSeen($scope.group._id);
|
Chat.markChatSeen($scope.group._id)
|
||||||
|
.then (function () {
|
||||||
|
return Members.getGroupMembers($scope.group._id);
|
||||||
|
})
|
||||||
|
.then(function (response) {
|
||||||
|
$scope.group.members = response.data.data;
|
||||||
|
|
||||||
|
return Members.getGroupInvites($scope.group._id);
|
||||||
|
})
|
||||||
|
.then(function (response) {
|
||||||
|
$scope.group.invites = response.data.data;
|
||||||
|
|
||||||
|
return Challenges.getGroupChallenges($scope.group._id);
|
||||||
|
})
|
||||||
|
.then(function (response) {
|
||||||
|
$scope.group.challenges = response.data.data;
|
||||||
|
|
||||||
|
return Tasks.getGroupTasks($scope.group._id);
|
||||||
|
})
|
||||||
|
.then(function (response) {
|
||||||
|
var tasks = response.data.data;
|
||||||
|
tasks.forEach(function (element, index, array) {
|
||||||
|
if (!$scope.group[element.type + 's']) $scope.group[element.type + 's'] = [];
|
||||||
|
$scope.group[element.type + 's'].unshift(element);
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.group.approvals = [];
|
||||||
|
if (User.user._id === $scope.group.leader._id) {
|
||||||
|
return Tasks.getGroupApprovals($scope.group._id);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(function (response) {
|
||||||
|
if (response) $scope.group.approvals = response.data.data;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ div(ng-if='::task.type!="reward"')
|
|||||||
input.form-control(ng-model='task._edit.alias' type='text' placeholder=env.t('taskAliasPlaceholder'))
|
input.form-control(ng-model='task._edit.alias' type='text' placeholder=env.t('taskAliasPlaceholder'))
|
||||||
|
|
||||||
fieldset.option-group.advanced-option(ng-show="task._edit._advanced")
|
fieldset.option-group.advanced-option(ng-show="task._edit._advanced")
|
||||||
group-tasks-actions(ng-if="obj.type == 'guild'", task='task', group='obj')
|
group-tasks-actions(ng-if="obj.purchased && obj.purchased.plan && obj.purchased.plan.customerId", task='task', group='obj')
|
||||||
|
|
||||||
div(ng-show='task._edit._advanced')
|
div(ng-show='task._edit._advanced')
|
||||||
div(ng-if='::task.type == "daily"')
|
div(ng-if='::task.type == "daily"')
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ include ./task_view/mixins
|
|||||||
script(id='templates/habitrpg-tasks.html', type="text/ng-template")
|
script(id='templates/habitrpg-tasks.html', type="text/ng-template")
|
||||||
.tasks-lists.container-fluid
|
.tasks-lists.container-fluid
|
||||||
.row
|
.row
|
||||||
.col-sm-6(ng-repeat='list in lists', ng-class='::{ "rewards-module": list.type==="reward", "new-row-md": list.type==="todo", "col-md-3": !obj.type }')
|
.col-sm-3(ng-repeat='list in lists', ng-class='::{ "rewards-module": list.type==="reward", "new-row-md": list.type==="todo" }')
|
||||||
.task-column(class='{{::list.type}}s')
|
.task-column(class='{{::list.type}}s')
|
||||||
|
|
||||||
include ./task_view/graph
|
include ./task_view/graph
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
// Icons only available if you own the tasks (aka, hidden from challenge stats)
|
// Icons only available if you own the tasks (aka, hidden from challenge stats)
|
||||||
span(ng-if='!obj._locked')
|
span(ng-if='!obj._locked')
|
||||||
group-task-meta-actions(ng-if="obj.type == 'guild'", task='task', group='obj')
|
group-task-meta-actions(ng-if="obj.purchased && obj.purchased.plan && obj.purchased.plan.customerId", task='task', group='obj')
|
||||||
|
|
||||||
a(ng-click='pushTask(task,$index,"top")', tooltip=env.t('pushTaskToTop'), ng-class="{'push-down': ctrlPressed}")
|
a(ng-click='pushTask(task,$index,"top")', tooltip=env.t('pushTaskToTop'), ng-class="{'push-down': ctrlPressed}")
|
||||||
span(ng-hide="ctrlPressed").glyphicon.glyphicon-open
|
span(ng-hide="ctrlPressed").glyphicon.glyphicon-open
|
||||||
|
|||||||
Reference in New Issue
Block a user