summaryrefslogtreecommitdiff
path: root/app/views/graph/show.json.erb
blob: 0531bc3c920e442dc170b09ae989e73a833a7fdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<% 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
) %>