From c87611dfec82c68e94ef27249010f8c302f24dd9 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 14 Apr 2016 11:18:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=B8=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 2 +- app/views/projects/_rep_static.html.erb | 111 ++++++++++++++++++++++++ app/views/projects/show.html.erb | 2 +- app/views/repositories/stats.html.erb | 2 +- 4 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 app/views/projects/_rep_static.html.erb diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index e3d089312..5c8d194b9 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -321,7 +321,7 @@ class ProjectsController < ApplicationController end g = Gitlab.client unless @project.gpid.nil? - @static_total_per_user = g.rep_stats(@project.gpid).map {|p| p.changes} + @static_total_per_user = g.rep_stats(@project.gpid) end # 根据对应的请求,返回对应的数据 respond_to do |format| diff --git a/app/views/projects/_rep_static.html.erb b/app/views/projects/_rep_static.html.erb new file mode 100644 index 000000000..0522fd34e --- /dev/null +++ b/app/views/projects/_rep_static.html.erb @@ -0,0 +1,111 @@ +<%= javascript_include_tag 'highcharts','highcharts-more' %> +
+
+
+
+ \ No newline at end of file diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 2adca9a41..63d7d583f 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -31,7 +31,7 @@
-

<%= @static_total_per_user %>



+ <%= render :partial => "rep_static" %>
diff --git a/app/views/repositories/stats.html.erb b/app/views/repositories/stats.html.erb index 9567f6a69..4a8bd9217 100644 --- a/app/views/repositories/stats.html.erb +++ b/app/views/repositories/stats.html.erb @@ -54,7 +54,7 @@ }, series: [{ name: '改动或增加', - + // data: [7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6] data: <%= @static_total_per_user.map{|c| c.add.to_i} %> },