From 99bdf4c5410aa24d89ba1aaedd0670e34783ad2b Mon Sep 17 00:00:00 2001 From: Simon Gabler Date: Sat, 1 Aug 2015 19:12:35 +0200 Subject: [PATCH 1/4] Add hint for "Repeat every" option title. Fixes #5603 --- common/locales/en/tasks.json | 2 ++ website/views/shared/tasks/edit/dailies/repeat_options.jade | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common/locales/en/tasks.json b/common/locales/en/tasks.json index 650484181f..ecf0af5ec7 100644 --- a/common/locales/en/tasks.json +++ b/common/locales/en/tasks.json @@ -38,6 +38,8 @@ "streakCounter": "Streak Counter", "repeat": "Repeat", "repeatEvery": "Repeat Every", + "repeatEveryHelpTitle": "How often should this task be repeated?", + "repeatEveryHelpContent": "This task will be due on the highlighted days below. Click on a day to activate/deactivate it.", "repeatDays": "Every X Days", "repeatWeek": "On Certain Days of the Week", "day": "Day", diff --git a/website/views/shared/tasks/edit/dailies/repeat_options.jade b/website/views/shared/tasks/edit/dailies/repeat_options.jade index b27755bd03..d82a12b032 100644 --- a/website/views/shared/tasks/edit/dailies/repeat_options.jade +++ b/website/views/shared/tasks/edit/dailies/repeat_options.jade @@ -1,4 +1,6 @@ -legend.option-title=env.t('repeatEvery') +legend.option-title + span.hint(ng-if='task.frequency=="weekly"', popover-title=env.t('repeatEveryHelpTitle'), popover-trigger='mouseenter', popover=env.t('repeatEveryHelpContent'))=env.t('repeatEvery') + span(ng-if='task.frequency!="weekly"')=env.t('repeatEvery') // If frequency is daily ng-form.form-group(name='everyX' ng-if='task.frequency=="daily"') From 1997338751f185645d61e1de18abd6f59f8e1e7a Mon Sep 17 00:00:00 2001 From: Simon Gabler Date: Wed, 5 Aug 2015 22:23:41 +0200 Subject: [PATCH 2/4] Show popover for daily and weekly dailies --- common/locales/en/tasks.json | 3 ++- website/views/shared/tasks/edit/dailies/repeat_options.jade | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/locales/en/tasks.json b/common/locales/en/tasks.json index ecf0af5ec7..d5c188d2fb 100644 --- a/common/locales/en/tasks.json +++ b/common/locales/en/tasks.json @@ -39,7 +39,8 @@ "repeat": "Repeat", "repeatEvery": "Repeat Every", "repeatEveryHelpTitle": "How often should this task be repeated?", - "repeatEveryHelpContent": "This task will be due on the highlighted days below. Click on a day to activate/deactivate it.", + "repeatDailyHelpContent": "This task will be due every X days. You can set that value below.", + "repeatWeeklyHelpContent": "This task will be due on the highlighted days below. Click on a day to activate/deactivate it.", "repeatDays": "Every X Days", "repeatWeek": "On Certain Days of the Week", "day": "Day", diff --git a/website/views/shared/tasks/edit/dailies/repeat_options.jade b/website/views/shared/tasks/edit/dailies/repeat_options.jade index d82a12b032..1a591058bc 100644 --- a/website/views/shared/tasks/edit/dailies/repeat_options.jade +++ b/website/views/shared/tasks/edit/dailies/repeat_options.jade @@ -1,6 +1,5 @@ legend.option-title - span.hint(ng-if='task.frequency=="weekly"', popover-title=env.t('repeatEveryHelpTitle'), popover-trigger='mouseenter', popover=env.t('repeatEveryHelpContent'))=env.t('repeatEvery') - span(ng-if='task.frequency!="weekly"')=env.t('repeatEvery') + span.hint(popover-trigger='mouseenter', popover-title=env.t('repeatEveryHelpTitle'), popover='{{env.t((task.frequency==="daily") ? "repeatDailyHelpContent" : "repeatWeeklyHelpContent")}}')=env.t('repeatEvery') // If frequency is daily ng-form.form-group(name='everyX' ng-if='task.frequency=="daily"') From 2343e4720c3ca5b33c1a36a2cf2fd9b1cdc686c5 Mon Sep 17 00:00:00 2001 From: Simon Gabler Date: Wed, 5 Aug 2015 22:25:03 +0200 Subject: [PATCH 3/4] Add tooltips for day buttons to show "due" or "not due" --- common/locales/en/tasks.json | 1 + website/public/css/global-modules.styl | 2 ++ website/views/shared/tasks/edit/dailies/repeat_options.jade | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/common/locales/en/tasks.json b/common/locales/en/tasks.json index d5c188d2fb..f08aa399a4 100644 --- a/common/locales/en/tasks.json +++ b/common/locales/en/tasks.json @@ -54,6 +54,7 @@ "complete": "Done", "dated": "Dated", "due": "Due", + "notDue": "Not Due", "grey": "Grey", "score": "Score", "rewards": "Rewards", diff --git a/website/public/css/global-modules.styl b/website/public/css/global-modules.styl index 9aae889d4c..1c05319fbc 100644 --- a/website/public/css/global-modules.styl +++ b/website/public/css/global-modules.styl @@ -68,6 +68,8 @@ hrpg-button-color-mixin($hrpg-button-color, highlight=false) color: darken($hrpg-button-color, 70%) !important .glyphicon color:darken($hrpg-button-color, 60%) + .tooltip + border:0 &.active a, button background-color: darken($hrpg-button-color, 3.82%) !important diff --git a/website/views/shared/tasks/edit/dailies/repeat_options.jade b/website/views/shared/tasks/edit/dailies/repeat_options.jade index 1a591058bc..85832a9351 100644 --- a/website/views/shared/tasks/edit/dailies/repeat_options.jade +++ b/website/views/shared/tasks/edit/dailies/repeat_options.jade @@ -14,7 +14,7 @@ ng-form.form-group(name='everyX' ng-if='task.frequency=="daily"') mixin dayOfWeek(day, num) li button(type='button', ng-class='{active: task.repeat.#{day}}', - ng-disabled='task.challenge.id', ng-click='task.repeat.#{day} = !task.repeat.#{day}') + ng-disabled='task.challenge.id', ng-click='task.repeat.#{day} = !task.repeat.#{day}', tooltip='{{env.t((task.repeat.#{day}) ? "due" : "notDue")}}') | {{::moment.weekdaysMin(#{num})}} +dayOfWeek('su', 0) From 787cb6cabb59d03442b0ab59adde6bbe23ad6415 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Wed, 5 Aug 2015 18:27:08 -0500 Subject: [PATCH 4/4] Final adjustments to PR - Rename strings to make them easier to expand upon in the future - adjust line break formatting - remove terniary operator --- common/locales/en/tasks.json | 6 +++--- .../views/shared/tasks/edit/dailies/repeat_options.jade | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/common/locales/en/tasks.json b/common/locales/en/tasks.json index f08aa399a4..42c1a82508 100644 --- a/common/locales/en/tasks.json +++ b/common/locales/en/tasks.json @@ -38,9 +38,9 @@ "streakCounter": "Streak Counter", "repeat": "Repeat", "repeatEvery": "Repeat Every", - "repeatEveryHelpTitle": "How often should this task be repeated?", - "repeatDailyHelpContent": "This task will be due every X days. You can set that value below.", - "repeatWeeklyHelpContent": "This task will be due on the highlighted days below. Click on a day to activate/deactivate it.", + "repeatHelpTitle": "How often should this task be repeated?", + "dailyRepeatHelpContent": "This task will be due every X days. You can set that value below.", + "weeklyRepeatHelpContent": "This task will be due on the highlighted days below. Click on a day to activate/deactivate it.", "repeatDays": "Every X Days", "repeatWeek": "On Certain Days of the Week", "day": "Day", diff --git a/website/views/shared/tasks/edit/dailies/repeat_options.jade b/website/views/shared/tasks/edit/dailies/repeat_options.jade index 85832a9351..7f2127af71 100644 --- a/website/views/shared/tasks/edit/dailies/repeat_options.jade +++ b/website/views/shared/tasks/edit/dailies/repeat_options.jade @@ -1,5 +1,6 @@ legend.option-title - span.hint(popover-trigger='mouseenter', popover-title=env.t('repeatEveryHelpTitle'), popover='{{env.t((task.frequency==="daily") ? "repeatDailyHelpContent" : "repeatWeeklyHelpContent")}}')=env.t('repeatEvery') + span.hint(popover-trigger='mouseenter', popover-title=env.t('repeatHelpTitle'), + popover='{{env.t(task.frequency + "RepeatHelpContent")}}')=env.t('repeatEvery') // If frequency is daily ng-form.form-group(name='everyX' ng-if='task.frequency=="daily"') @@ -13,8 +14,9 @@ ng-form.form-group(name='everyX' ng-if='task.frequency=="daily"') // note, does not use data-toggle="buttons-checkbox" - it would interfere with our own click binding mixin dayOfWeek(day, num) li - button(type='button', ng-class='{active: task.repeat.#{day}}', - ng-disabled='task.challenge.id', ng-click='task.repeat.#{day} = !task.repeat.#{day}', tooltip='{{env.t((task.repeat.#{day}) ? "due" : "notDue")}}') + button(type='button', ng-class='{active: task.repeat.#{day}}', + ng-disabled='task.challenge.id', ng-click='task.repeat.#{day} = !task.repeat.#{day}', + tooltip='{{env.t((task.repeat.#{day}) ? "due" : "notDue")}}') | {{::moment.weekdaysMin(#{num})}} +dayOfWeek('su', 0)