From 43d2d1355e6b0569fa977fb4c9d9874cc32b0dcf Mon Sep 17 00:00:00 2001 From: Alice Harris Date: Thu, 9 Oct 2014 20:04:03 +1000 Subject: [PATCH] renamed Daily tabs to save space, removed To-Dos from new code because compled/all tabs were blank, decoupled To-Do code from Dailes code to allow future changes (e.g., "Dated" tab for To-Dos) --- public/js/controllers/tasksCtrl.js | 2 +- public/js/directives/directives.js | 4 ++-- views/shared/tasks/lists.jade | 28 +++++++++++++++++++--------- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/public/js/controllers/tasksCtrl.js b/public/js/controllers/tasksCtrl.js index cad6de1b91..312675df7b 100644 --- a/public/js/controllers/tasksCtrl.js +++ b/public/js/controllers/tasksCtrl.js @@ -193,7 +193,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N */ $scope.shouldShow = function(task, list, prefs){ - if (task.type == 'habit' || task.type == 'reward') + if (task.type == 'habit' || task.type == 'todo' || task.type == 'reward') return true; var shouldDo = task.type == 'daily' ? habitrpgShared.shouldDo(new Date, task.repeat, prefs) : true; switch (list.view) { diff --git a/public/js/directives/directives.js b/public/js/directives/directives.js index ba0270d019..60a226732b 100644 --- a/public/js/directives/directives.js +++ b/public/js/directives/directives.js @@ -74,8 +74,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', diff --git a/views/shared/tasks/lists.jade b/views/shared/tasks/lists.jade index 5cd803d480..db842b93d7 100644 --- a/views/shared/tasks/lists.jade +++ b/views/shared/tasks/lists.jade @@ -101,17 +101,27 @@ script(id='templates/habitrpg-tasks.html', type="text/ng-template") // Habit3 ins.adsbygoogle(ng-init='initAds()', style='display: inline-block; width: 234px; height: 60px;', data-ad-client='ca-pub-3242350243827794', data-ad-slot='9529624576') - // Todo/Daily Tabs - div(bo-if='main && (list.type=="daily" || list.type=="todo")', class='tabbable tabs-below') - div(ng-show='(list.view == "complete" || list.view == "all") && list.type == todo') + // Daily Tabs + div(bo-if='main && list.type=="daily"', class='tabbable tabs-below') + // remaining/completed tabs + ul.nav.nav-tabs + li(ng-class='{active: list.view == "remaining"}') + a(ng-click='list.view = "remaining"')=env.t('due') + li(ng-class='{active: list.view == "complete"}') + a(ng-click='list.view = "complete"')=env.t('grey') + li(ng-class='{active: list.view == "all"}') + a(ng-click='list.view = "all"')=env.t('all') + + // Todo Tabs + div(bo-if='main && list.type=="todo"', bo-class='{"tabbable tabs-below": list.type=="todo"}') + // div(ng-show='list.view == "complete" || list.view == "all"') + div(ng-show='list.showCompleted') .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.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') - li(ng-class='{active: list.view == "all"}') - a(ng-click='list.view = "all"')=env.t('all') + 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')