#1499 add list filter on tasks to not display completed todos at all

until "completed" tab clicked
This commit is contained in:
Tyler Renelle
2013-12-29 00:12:15 -07:00
parent 34a955665c
commit b20a3b7381
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -8,4 +8,10 @@ angular.module('habitrpg')
return function (gp) {
return Math.floor((gp - Math.floor(gp))*100);
}
})
.filter('completedFilter', function(){
return function(tasks,_showCompleted) {
if (tasks[0].type != 'todo') return tasks;
return _.where(tasks, {completed:!!_showCompleted});
}
})
+1 -1
View File
@@ -1,4 +1,4 @@
li(bindonce='list', ng-repeat='task in obj[list.type+"s"]', class='task {{Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', ng-click='spell && castEnd(task, "task", $event)', ng-class='{"cast-target":spell}')
li(bindonce='list', ng-repeat='task in obj[list.type+"s"] | completedFilter: list.showCompleted', class='task {{Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', ng-click='spell && castEnd(task, "task", $event)', ng-class='{"cast-target":spell}')
// right-hand side control buttons
.task-meta-controls