diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-04 18:07:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-04 18:07:36 +0300 |
commit | aa542224bb345acf0cb9a1a606f0a802c16b0336 (patch) | |
tree | 496540a29aec55c6faeec7b0140824547046ae6c /app/helpers | |
parent | 2494b608a460c46c759ad84bb29e6cc3447499a1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/milestones_helper.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/helpers/milestones_helper.rb b/app/helpers/milestones_helper.rb index e769734f27b..60165e0d0a4 100644 --- a/app/helpers/milestones_helper.rb +++ b/app/helpers/milestones_helper.rb @@ -170,6 +170,15 @@ module MilestonesHelper content.join('<br />').html_safe end + def recent_releases_with_counts(milestone) + total_count = milestone.releases.size + return [[], 0, 0] if total_count == 0 + + recent_releases = milestone.releases.recent.to_a + more_count = total_count - recent_releases.size + [recent_releases, total_count, more_count] + end + def milestone_tooltip_due_date(milestone) if milestone.due_date "#{milestone.due_date.to_s(:medium)} (#{remaining_days_in_words(milestone.due_date, milestone.start_date)})" |