mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
[#1837] separate groups filter from "create new challenge"-available groups
This commit is contained in:
@@ -4,9 +4,10 @@ habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notifica
|
|||||||
function($scope, User, Challenges, Notification, $compile, Groups, $state) {
|
function($scope, User, Challenges, Notification, $compile, Groups, $state) {
|
||||||
|
|
||||||
// FIXME $scope.challenges needs to be resolved first (see app.js)
|
// FIXME $scope.challenges needs to be resolved first (see app.js)
|
||||||
|
$scope.groups = Groups.Group.query({type:'party,guilds,tavern'});
|
||||||
Challenges.Challenge.query(function(challenges){
|
Challenges.Challenge.query(function(challenges){
|
||||||
$scope.challenges = challenges;
|
$scope.challenges = challenges;
|
||||||
$scope.groups = _.uniq(_.pluck(challenges, 'group'), function(g){return g._id});
|
$scope.groupsFilter = _.uniq(_.pluck(challenges, 'group'), function(g){return g._id});
|
||||||
$scope.search = {
|
$scope.search = {
|
||||||
group: _.transform($scope.groups, function(m,g){m[g._id]=true;})
|
group: _.transform($scope.groups, function(m,g){m[g._id]=true;})
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ script(type='text/ng-template', id='partials/options.social.challenges.html')
|
|||||||
a.btn.btn-mini.pull-left(ng-click='selectAll()') All
|
a.btn.btn-mini.pull-left(ng-click='selectAll()') All
|
||||||
a.btn.btn-mini(ng-click='selectNone()') None
|
a.btn.btn-mini(ng-click='selectNone()') None
|
||||||
br
|
br
|
||||||
label.checkbox(ng-repeat='group in groups')
|
label.checkbox(ng-repeat='group in groupsFilter')
|
||||||
input(type='checkbox', ng-model='search.group[group._id]')
|
input(type='checkbox', ng-model='search.group[group._id]')
|
||||||
| {{group.name}}
|
| {{group.name}}
|
||||||
h4 Membership
|
h4 Membership
|
||||||
|
|||||||
Reference in New Issue
Block a user