gitlabhq/app/views/graph/show.json.erb
Sato Hiroyuki 2f7f46b256 Refactor: replace "render :json = graph.to_json" to view template(show.json.erb).
Because model shouldn't know about view logic.
2013-03-07 15:19:32 +09:00

27 lines
613 B
Plaintext

<% self.formats = ["html"] %>
<%= raw(
{
days: @graph.days.compact.map { |d| [d.day, d.strftime("%b")] },
commits: @graph.commits.map do |c|
{
parents: c.parents.collect do |p|
[p.id,0,0]
end,
author: {
name: c.author.name,
email: c.author.email,
icon: gravatar_icon(c.author.email, 20)
},
time: c.time,
space: c.spaces.first,
parent_spaces: c.parent_spaces,
refs: join_with_space(c.refs),
id: c.sha,
date: c.date,
message: c.message,
}
end
}.to_json
) %>