Sha256: bdae5c3b0a2c5dd0609309e939622afec74a20ee8c0c1d4ae7a5c9aae7362fbb

Contents?: true

Size: 1.18 KB

Versions: 3

Compression:

Stored size: 1.18 KB

Contents

- i = 0
- block(:top_authors_of_year) do
  .blocktable
    %table
      %thead
        %th Year
        %th Author
        %th Commits
        %th Total
      %tbody
        - stats.year_stats.sort{ |a, b| b[0] <=> a[0] }.each do |year, authorstats|
          - authors = authorstats.sort{ |a, b| b[1].commits <=> a[1].commits }[0, top_author_count]
          - authors.each do |author|
            - c = author[1].commits
            - first = author == authors.first
            - i += 1 if first
            %tr{:class => first ? 'top' : "yearauthor_sub#{i}"}
              %td{:class => first ? "yearauthor_top#{i}" : ""}&= first ? year : ''
              %td{:class => first ? "yearauthor_top#{i}" : ""}&= author[0]
              %td{:class => first ? "yearauthor_top#{i}" : ""}&= '%d of %d (%.2f%%)' % [c, authorstats.commits.to_f, c * 100.0 / authorstats.commits.to_f]
              %td{:class => first ? "yearauthor_top#{i}" : ""}&= first ? authorstats.count : ''
- for j in 1..i
  :javascript
    $(document).ready(function() {
      $(".yearauthor_sub#{j}").hide();
      $(".yearauthor_top#{j}").click(function() {
        $(".yearauthor_sub#{j}").toggle();
        return false;
      });
    });

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
gitstats-rb-2.0.0 template/gnuplot/partials/top_authors_of_year.haml
gitstats-ruby-1.0.1 template/partials/top_authors_of_year.haml
gitstats-ruby-1.0.0 template/partials/top_authors_of_year.haml