diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 672be54e66f5a50fb1c2340dbb418b0bd1e903c4..26bb3c66fd6b5728b3fbdd3dcf0bd530571a31b9 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 diff --git a/app/views/projects/commits/_head.html.haml b/app/views/projects/commits/_head.html.haml index 66261c7336df97d867b06da9867bd5c5b00e36f5..e3d8cd0fdd5a1ace16786bf1190f216779330592 100644 --- a/app/views/projects/commits/_head.html.haml +++ b/app/views/projects/commits/_head.html.haml @@ -3,7 +3,7 @@ = link_to namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref) do = icon("history") Commits - %span.badge= number_with_precision(@repository.commit_count, precision: 0, delimiter: ',') + %span.badge= number_with_delimiter(@repository.commit_count) = nav_link(controller: :compare) do = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref) do = icon("exchange")