Display note count on network graph.

This commit is contained in:
Sato Hiroyuki 2013-03-26 09:51:39 +09:00
parent 62ef763a80
commit b49c1cb161
2 changed files with 10 additions and 3 deletions

View file

@ -1,6 +1,13 @@
module GraphHelper module GraphHelper
def join_with_space(ary) def get_refs(commit)
ary.collect{|r|r.name}.join(" ") unless ary.nil? refs = ""
refs += commit.refs.collect{|r|r.name}.join(" ") if commit.refs
# append note count
notes = @project.notes.for_commit_id(commit.id)
refs += "[#{notes.count}]" if notes.any?
refs
end end
def parents_zip_spaces(parents, parent_spaces) def parents_zip_spaces(parents, parent_spaces)

View file

@ -13,7 +13,7 @@
}, },
time: c.time, time: c.time,
space: c.spaces.first, space: c.spaces.first,
refs: join_with_space(c.refs), refs: get_refs(c),
id: c.sha, id: c.sha,
date: c.date, date: c.date,
message: c.message, message: c.message,