diff options
author | Dan Rowden <hello@danrowden.com> | 2016-07-22 12:18:38 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-09-07 23:27:14 +0300 |
commit | bb5a7ef08c1f7bcb2a1ef2c930a443014c3ac084 (patch) | |
tree | b95193a1ddaf0faa77be825d80a7f40350adfce5 /app/helpers/milestones_helper.rb | |
parent | 13a91b560e74b457eab20fe2c48e0af5afcf41b3 (diff) |
Show badges in Milestone tabs and padding in Milestone list (both to match Issues page)
Diffstat (limited to 'app/helpers/milestones_helper.rb')
-rw-r--r-- | app/helpers/milestones_helper.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/helpers/milestones_helper.rb b/app/helpers/milestones_helper.rb index b3e6e468ecd..9a71761a55c 100644 --- a/app/helpers/milestones_helper.rb +++ b/app/helpers/milestones_helper.rb @@ -35,6 +35,19 @@ module MilestonesHelper milestone.issues.with_label(label.title).send(state).size end + def milestone_count_by_state(project, state) + if project.nil? + nil + else + case state + when 'all' then @project.milestones.size + when 'closed' then @project.milestones.closed.size + when 'opened' then @project.milestones.active.size + else nil + end + end + end + def milestone_progress_bar(milestone) options = { class: 'progress-bar progress-bar-success', |