summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorVladislav Kaverin <vladislav.v.kaverin@gmail.com>2017-08-31 08:04:11 +0000
committerVladislav Kaverin <vladislav.kaverin@netcracker.com>2017-09-08 11:36:58 +0400
commitfee5e17fe04d9c7f990bdfab26afdfc98bdbbec9 (patch)
treebe75587541c0a99845766e4d2a323d82fdf70d74 /app
parentbce1c50928e4885d54dd11221a9c8197a7fb1a7d (diff)
downloadgitlab-ce-fee5e17fe04d9c7f990bdfab26afdfc98bdbbec9.tar.gz
Print notes number explained.
Printing just `[<number>]` was confusing - it looks like a ghost branch or something. Add `note` (or `notes`, depending on number of notes) to give some details of what this number means. Refactor code to follow DRY principle.
Diffstat (limited to 'app')
-rw-r--r--app/helpers/graph_helper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/helpers/graph_helper.rb b/app/helpers/graph_helper.rb
index c53ea4519da..f7e17f5cc01 100644
--- a/app/helpers/graph_helper.rb
+++ b/app/helpers/graph_helper.rb
@@ -7,7 +7,8 @@ module GraphHelper
refs << commit_refs.join(' ')
# append note count
- refs << "[#{@graph.notes[commit.id]}]" if @graph.notes[commit.id] > 0
+ notes_count = @graph.notes[commit.id]
+ refs << "[#{notes_count} #{pluralize(notes_count, 'note')}]" if notes_count > 0
refs
end