stats.html.haml 979 Bytes
Newer Older
randx's avatar
randx committed
1 2 3 4
= render "commits/head"
.row
  .span5
    %h4
5
      Stats:
randx's avatar
randx committed
6 7 8 9
    %p
      %b Total commits:
      %span= @stats.commits_count
    %p
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
10
      %b Total files in #{@repository.root_ref}:
randx's avatar
randx committed
11 12 13 14 15 16 17 18
      %span= @stats.files_count
    %p
      %b Authors:
      %span= @stats.authors_count

    %br
    %div#activity-chart
  .span7
randx's avatar
randx committed
19
    %h4 Top 50 Committers:
randx's avatar
randx committed
20
    %ol.styled
randx's avatar
randx committed
21
      - @stats.authors[0...50].each do |author|
randx's avatar
randx committed
22 23 24 25 26 27 28 29 30 31 32
        %li
          = image_tag gravatar_icon(author.email, 16), class: 'avatar s16'
          = author.name
          %small.light= author.email
          .right
            = author.commits


:javascript
  $(function(){
    var labels = [#{@graph.labels.to_json}];
33
    var commits = [#{@graph.commits.join(', ')}];
randx's avatar
randx committed
34 35 36 37
    var r = Raphael('activity-chart');
    r.text(160, 10, "Commit activity for last #{@graph.weeks} weeks").attr({ font: "13px sans-serif" });
    r.barchart(
      10, 10, 400, 160,
38 39
      [commits],
      {colors:["#456"]}
randx's avatar
randx committed
40 41
    ).label(labels, true);
  })