mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
fix: Update client to remove completed todos immediately
closes #7549 closes #7685
This commit is contained in:
@@ -94,6 +94,7 @@
|
|||||||
"confirmFortify": "Are you sure?",
|
"confirmFortify": "Are you sure?",
|
||||||
"fortifyComplete": "Fortify complete!",
|
"fortifyComplete": "Fortify complete!",
|
||||||
"sureDelete": "Are you sure you want to delete the <%= taskType %> with the text \"<%= taskText %>\"?",
|
"sureDelete": "Are you sure you want to delete the <%= taskType %> with the text \"<%= taskText %>\"?",
|
||||||
|
"sureDeleteCompletedTodos": "Are you sure you want to delete your completed todos?",
|
||||||
"streakCoins": "Streak Bonus!",
|
"streakCoins": "Streak Bonus!",
|
||||||
"pushTaskToTop": "Push task to top. Hold ctrl or cmd to push to bottom.",
|
"pushTaskToTop": "Push task to top. Hold ctrl or cmd to push to bottom.",
|
||||||
"emptyTask": "Enter the task's title first.",
|
"emptyTask": "Enter the task's title first.",
|
||||||
|
|||||||
@@ -74,7 +74,11 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
|
|||||||
* Add the new task to the actions log
|
* Add the new task to the actions log
|
||||||
*/
|
*/
|
||||||
$scope.clearDoneTodos = function() {
|
$scope.clearDoneTodos = function() {
|
||||||
|
if (!confirm(window.env.t('sureDeleteCompletedTodos'))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Tasks.clearCompletedTodos();
|
Tasks.clearCompletedTodos();
|
||||||
|
User.user.todos = _.reject(User.user.todos, 'completed');
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ mixin taskColumnTabs(position)
|
|||||||
div(ng-show='list.view == "complete"')
|
div(ng-show='list.view == "complete"')
|
||||||
.alert
|
.alert
|
||||||
=env.t('lotOfToDos')
|
=env.t('lotOfToDos')
|
||||||
button.task-action-btn.tile.spacious.bright(ng-click='User.clearCompleted({})',popover=env.t('deleteToDosExplanation'),popover-trigger='mouseenter')=env.t('clearCompleted')
|
button.task-action-btn.tile.spacious.bright(ng-click='clearDoneTodos()',popover=env.t('deleteToDosExplanation'),popover-trigger='mouseenter')=env.t('clearCompleted')
|
||||||
// remaining/completed tabs
|
// remaining/completed tabs
|
||||||
ul.task-filter
|
ul.task-filter
|
||||||
li(ng-class='{active: list.view == "remaining"}')
|
li(ng-class='{active: list.view == "remaining"}')
|
||||||
|
|||||||
Reference in New Issue
Block a user