show.html.haml 1.4 KB
Newer Older
1
- @no_container = true
2 3
- page_title "Contributors"
- content_for :page_specific_javascripts do
4
  = page_specific_javascript_bundle_tag('common_d3')
5 6
  = page_specific_javascript_bundle_tag('graphs')
= render 'projects/commits/head'
7

Valery Sizov's avatar
Valery Sizov committed
8
%div{ class: container_class }
9
  .sub-header-block
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
    .tree-ref-holder
      = render 'shared/ref_switcher', destination: 'graphs'
    %ul.breadcrumb.repo-breadcrumb
      = commits_breadcrumbs

  .loading-graph
    .center
      %h3.page-title
        %i.fa.fa-spinner.fa-spin
        Building repository graph.
      %p.slead Please wait a moment, this page will automatically refresh when ready.

  .stat-graph.hide
    .header.clearfix
      %h3#date_header.page-title
      %p.light
        Commits to #{@ref}, excluding merge commits. Limited to 6,000 commits.
27
      %input#brush_change{ :type => "hidden" }
Annabel Dunstone's avatar
Annabel Dunstone committed
28
    .graphs.row
29 30 31
      #contributors-master
      #contributors.clearfix
        %ol.contributors-list.clearfix
32 33


Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
34

35 36
:javascript
  $.ajax({
37
    type: "GET",
38
    url: "#{namespace_project_graph_path(@project.namespace, @project, current_ref, format: :json)}",
39 40 41 42
    dataType: "json",
    success: function (data) {
      var graph = new ContributorsStatGraph();
      graph.init(data);
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
43

44 45 46 47
      $("#brush_change").change(function(){
        graph.change_date_header();
        graph.redraw_authors();
      });
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
48

49
      $(".stat-graph").fadeIn();
50
      $(".loading-graph").hide();
51 52
    }
  });