From fee5e17fe04d9c7f990bdfab26afdfc98bdbbec9 Mon Sep 17 00:00:00 2001 From: Vladislav Kaverin Date: Thu, 31 Aug 2017 08:04:11 +0000 Subject: Print notes number explained. Printing just `[]` 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. --- app/helpers/graph_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/helpers') 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 -- cgit v1.2.3