remove previous method for hiding/showing remaining/completed To-Dos, and add new method
This commit is contained in:
@@ -202,8 +202,6 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
|
||||
$scope.shouldShow = function(task, list, prefs){
|
||||
if (task._editing) // never hide a task while being edited
|
||||
return true;
|
||||
if (task.type == 'todo') // TODO: convert To-Dos to use this new system and probably add a "Dated" column (i.e., "Incomplete" (includes dated), "Dated" (has due date and is not complete), "Complete")
|
||||
return true;
|
||||
var shouldDo = task.type == 'daily' ? habitrpgShared.shouldDo(new Date, task.repeat, prefs) : true;
|
||||
switch (list.view) {
|
||||
case "yellowred": // Habits
|
||||
|
||||
@@ -81,8 +81,8 @@ habitrpg
|
||||
}, {
|
||||
header: window.env.t('todos'),
|
||||
type: 'todo',
|
||||
placeHolder: window.env.t('newTodo')
|
||||
// view: "remaining"
|
||||
placeHolder: window.env.t('newTodo'),
|
||||
view: "remaining"
|
||||
}, {
|
||||
header: window.env.t('rewards'),
|
||||
type: 'reward',
|
||||
|
||||
@@ -52,16 +52,16 @@ script(id='templates/habitrpg-tasks.html', type="text/ng-template")
|
||||
// Todo Tabs
|
||||
div(bo-if='main && list.type=="todo"', bo-class='{"tabbable tabs-below": list.type=="todo"}')
|
||||
if position=="bottom"
|
||||
div(ng-show='list.showCompleted')
|
||||
div(ng-show='list.view == "complete"')
|
||||
.alert
|
||||
=env.t('lotOfToDos')
|
||||
button.task-action-btn.tile.spacious.bright(ng-click='user.ops.clearCompleted({})',popover=env.t('deleteToDosExplanation'),popover-trigger='mouseenter')=env.t('clearCompleted')
|
||||
// remaining/completed tabs
|
||||
ul.nav.nav-tabs
|
||||
li(ng-class='{active: !list.showCompleted}')
|
||||
a(ng-click='list.showCompleted = false')=env.t('remaining')
|
||||
li(ng-class='{active: list.showCompleted}')
|
||||
a(ng-click='list.showCompleted= true')=env.t('complete')
|
||||
li(ng-class='{active: list.view == "remaining"}')
|
||||
a(ng-click='list.view = "remaining"')=env.t('remaining')
|
||||
li(ng-class='{active: list.view == "complete"}')
|
||||
a(ng-click='list.view = "complete"')=env.t('complete')
|
||||
// Rewards Tabs
|
||||
div(bo-if='main && list.type=="reward"', class='tabbable tabs-below')
|
||||
ul.nav.nav-tabs
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
li(bindonce='list', bo-id='"task-"+task.id', 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 && (list.type != "reward") && castEnd(task, "task", $event)', ng-class='{"cast-target":spell && (list.type != "reward")}', popover-trigger='mouseenter', data-popover-html="{{task.notes | markdown}}", data-popover-placement="top", ng-show='shouldShow(task, list, user.preferences)')
|
||||
li(bindonce='list', bo-id='"task-"+task.id', ng-repeat='task in obj[list.type+"s"]', class='task {{Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, main)}}', ng-click='spell && (list.type != "reward") && castEnd(task, "task", $event)', ng-class='{"cast-target":spell && (list.type != "reward")}', popover-trigger='mouseenter', data-popover-html="{{task.notes | markdown}}", data-popover-placement="top", ng-show='shouldShow(task, list, user.preferences)')
|
||||
// right-hand side control buttons
|
||||
.task-meta-controls
|
||||
|
||||
|
||||
Reference in New Issue
Block a user