diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-14 18:30:23 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-14 18:30:23 +0300 |
commit | 3d4d89f060f01b7993ef8e1839744c81b53293bf (patch) | |
tree | 807cf443e3184dd844924a06bee6e5f827377c31 /app/helpers/application_helper.rb | |
parent | 8dde52cc099af63e1bdc02ca6fc389e4a9ea9969 (diff) | |
download | gitlab-ce-3d4d89f060f01b7993ef8e1839744c81b53293bf.tar.gz |
Use count badges with number_with_delimiter helper for issue, commit count
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 672be54e66f..26bb3c66fd6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -324,12 +324,21 @@ module ApplicationHelper count = if project.nil? - "" + nil elsif current_controller?(:issues) - " (#{project.issues.send(entity).count})" + project.issues.send(entity).count elsif current_controller?(:merge_requests) - " (#{project.merge_requests.send(entity).count})" + project.merge_requests.send(entity).count end - "#{entity_title}#{count}" + + html = "" + html += content_tag :span, entity_title + html += " " + + if count.present? + html += content_tag :span, number_with_delimiter(count), class: 'badge' + end + + html.html_safe end end |