- content_for :title do
  Commit Stats Over Past #{@days_ago} Days

%h2 #{@commit_set.count} commits
%table.table.table-striped.table-hover.table-bordered
  %thead
    %tr
      %th Total commits
      %th Author
      %th Breakdown by project
      %th &nbsp;
  %tbody
    - @commit_set.top_authors.each do |object|
      %tr
        %td= object[:commit_set].count
        %td
          %a{ href: name_to_slug(object[:author]) }= object[:author]
        %td= breakdown(object[:commit_set])
        %td
          %button.btn.btn-mini{ type: 'button',
            data: { toggle: 'modal', target: '#' + name_to_id(object[:author]) + '-details' }}
            Details
          .modal.hide.fade{ id: name_to_id(object[:author]) + '-details' }
            .modal-header
              %button(type='button' class='close' data-dismiss='modal' aria-hidden='true')
                &times;
              %h3 Details for #{object[:author]}
            .modal-body
              %table.table.table-hover.table-bordered.table-condensed
                %tbody
                  - object[:commit_set].commits.each do |commit|
                    %tr
                      %td +#{commit.stat[:additions]}
                      %td -#{commit.stat[:deletions]}
                      %td
                        %code= commit.subject
                      %td [#{commit.repo.name}]
            .modal-footer
              %a(href='#' class='btn' data-dismiss='modal') Close

- content_for :title do
  Commit Stats Over Past #{@days_ago} Days

%h2 #{@commit_set.count} commits
%table.table.table-striped.table-hover.table-bordered
  %thead
    %tr
      %th Total commits
      %th Author
      %th Breakdown by project
      %th &nbsp;
  %tbody
    - @commit_set.top_authors.each do |object|
      %tr
        %td= object[:commit_set].count
        %td
          %a{ href: name_to_slug(object[:author]) }= object[:author]
        %td= breakdown(object[:commit_set])
        %td
          %button.btn.btn-mini{ type: 'button',
            data: { toggle: 'modal', target: '#' + name_to_id(object[:author]) + '-details' }}
            Details
          .modal.hide.fade{ id: name_to_id(object[:author]) + '-details', tabindex: '-1' }
            .modal-header
              %button(type='button' class='close' data-dismiss='modal' aria-hidden='true')
                &times;
              %h3 Details for #{object[:author]}
            .modal-body
              %table.table.table-hover.table-bordered.table-condensed
                %tbody
                  - object[:commit_set].commits.each do |commit|
                    %tr
                      %td +#{commit.stat[:additions]}
                      %td -#{commit.stat[:deletions]}
                      %td
                        %code= commit.subject
                      %td [#{commit.repo.name}]
            .modal-footer
              %a(href='#' class='btn' data-dismiss='modal') Close

Allow modals to be closed with Escape key
Allow modals to be closed with Escape key

As per this suggestion:

  http://stackoverflow.com/questions/12630156

Change-Id: I62177fd11814442013b4ccb32adc40ac5e0ecaa4
Reviewed-on: https://gerrit.causes.com/24906
Reviewed-by: Greg Hurrell <79e2475f81a6317276bf7cbb3958b20d289b78df@causes.com>
Tested-by: Greg Hurrell <79e2475f81a6317276bf7cbb3958b20d289b78df@causes.com>
