From ea8778457511960690d094abef2361daf3fcdf7b Mon Sep 17 00:00:00 2001 From: Keith Holliday Date: Sun, 29 Nov 2015 14:30:22 -0600 Subject: [PATCH] tasks-fix-delete-message --- common/locales/en/tasks.json | 4 ++-- website/public/js/controllers/challengesCtrl.js | 2 +- website/public/js/controllers/tasksCtrl.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/locales/en/tasks.json b/common/locales/en/tasks.json index f40797789b..50e92d2cd7 100644 --- a/common/locales/en/tasks.json +++ b/common/locales/en/tasks.json @@ -54,7 +54,7 @@ "complete": "Done", "dated": "Dated", "due": "Due", - "notDue": "Not Due", + "notDue": "Not Due", "grey": "Grey", "score": "Score", "rewards": "Rewards", @@ -86,7 +86,7 @@ "fortifyPop": "Return all tasks to neutral value (yellow color), and restore all lost Health.", "fortify": "Fortify", "fortifyText": "Fortify will return all your tasks to a neutral (yellow) state, as if you'd just added them, and top your Health off to full. This is great if all your red tasks are making the game too hard, or all your blue tasks are making the game too easy. If starting fresh sounds much more motivating, spend the Gems and catch a reprieve!", - "sureDelete": "Are you sure you want to delete this task?", + "sureDelete": "Are you sure you want to delete the <%= taskType %> with the text \"<%= taskText %>\"?", "streakCoins": "Streak Bonus!", "pushTaskToTop": "Push task to top", "pushTaskToBottom": "Push task to bottom", diff --git a/website/public/js/controllers/challengesCtrl.js b/website/public/js/controllers/challengesCtrl.js index 1cafe40d44..5840d2fbee 100644 --- a/website/public/js/controllers/challengesCtrl.js +++ b/website/public/js/controllers/challengesCtrl.js @@ -212,7 +212,7 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User', }; $scope.removeTask = function(task, list) { - if (!confirm(window.env.t('sureDelete'))) return; + if (!confirm(window.env.t('sureDelete', {taskType: task.type, taskText: task.text}))) return; //TODO persist // User.log({op: "delTask", data: task}); _.remove(list, task); diff --git a/website/public/js/controllers/tasksCtrl.js b/website/public/js/controllers/tasksCtrl.js index 7eee145e37..d0e82acd1d 100644 --- a/website/public/js/controllers/tasksCtrl.js +++ b/website/public/js/controllers/tasksCtrl.js @@ -92,7 +92,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N }; $scope.removeTask = function(task) { - if (!confirm(window.env.t('sureDelete'))) return; + if (!confirm(window.env.t('sureDelete', {taskType: task.type, taskText: task.text}))) return; User.user.ops.deleteTask({params:{id:task.id}}) };