diff options
author | Michael <seraph890@gmail.com> | 2017-03-16 11:34:46 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-03-16 11:34:46 +0000 |
commit | 6924b4d336c7498e1100153514bf29e217ae9239 (patch) | |
tree | ec0d9b32780c504ecb8328f2079cfa2e2942cde5 /app | |
parent | 774e0e3bfe2d35e8b7eb704ab856549559965dfe (diff) | |
download | gitlab-ce-6924b4d336c7498e1100153514bf29e217ae9239.tar.gz |
Issue milestone remaining time tooltip
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/milestones_helper.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/helpers/milestones_helper.rb b/app/helpers/milestones_helper.rb index 7011e670cee..5053b937c02 100644 --- a/app/helpers/milestones_helper.rb +++ b/app/helpers/milestones_helper.rb @@ -82,12 +82,13 @@ module MilestonesHelper def milestone_remaining_days(milestone) if milestone.expired? content_tag(:strong, 'Past due') - elsif milestone.due_date - days = milestone.remaining_days - content = content_tag(:strong, days) - content << " #{'day'.pluralize(days)} remaining" elsif milestone.upcoming? content_tag(:strong, 'Upcoming') + elsif milestone.due_date + time_ago = time_ago_in_words(milestone.due_date) + content = time_ago.gsub(/\d+/) { |match| "<strong>#{match}</strong>" } + content.slice!("about ") + content << " remaining" elsif milestone.start_date && milestone.start_date.past? days = milestone.elapsed_days content = content_tag(:strong, days) |