Merge branch 'rep_quality' into develop

This commit is contained in:
Tim 2016-10-08 17:38:43 +08:00
commit e675050b21
9 changed files with 286 additions and 278 deletions

View File

@ -12,6 +12,6 @@
</div> </div>
<script> <script>
$("#RSide").css("width","730px"); $(".project_r_h").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
</script> </script>

View File

@ -16,7 +16,7 @@
<% end%> <% end%>
<% end%> <% end%>
$("div[nhname='pro_setting']").show(); $("div[nhname='pro_setting']").show();
$("#RSide").css('width',"730px"); $(".project_r_h").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
}); });
</script> </script>

View File

@ -26,5 +26,5 @@
<% html_title(l(:label_followers)) -%> <% html_title(l(:label_followers)) -%>
<script> <script>
$("#RSide").css("width","730px"); $(".project_r_h").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
</script> </script>

View File

@ -10,7 +10,7 @@
</div> </div>
<script> <script>
$("#pull_request_new_form").parent().css("width","730px"); $("#pull_request_new_form").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
$("#changed-files").toggle(function(){ $("#changed-files").toggle(function(){
$("#changed-files-detail").show(); $("#changed-files-detail").show();

View File

@ -67,7 +67,7 @@
<script> <script>
$("#pull_request_show").parent().css("width","730px"); $("#pull_request_show").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
$(".merge-record li a").click(function(){ $(".merge-record li a").click(function(){
$(".merge-record li a").removeClass("active"); $(".merge-record li a").removeClass("active");

View File

@ -162,6 +162,6 @@
<% end %> <% end %>
<script> <script>
$("#RSide").css("width","730px"); $(".project_r_h").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
</script> </script>

View File

@ -25,5 +25,5 @@
<% html_title(l(:label_change_plural)) -%> <% html_title(l(:label_change_plural)) -%>
<script> <script>
$("#RSide").css("width","730px"); $(".project_r_h").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
</script> </script>

View File

@ -1,76 +1,80 @@
<%= javascript_include_tag 'highcharts','highcharts-more' %> <%= javascript_include_tag 'highcharts','highcharts-more' %>
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2"><%= l(:label_quality_analyses) %></h2> <h2 class="project_h2"><%= l(:label_quality_analyses) %></h2>
</div> </div>
<div class="repository_con " style="line-height:1.9;"> <div class="repository_con " style="line-height:1.9;">
<%#= render :partial => 'navigation' %> <%#= render :partial => 'navigation' %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div id = "container"> <div id = "container">
</div> </div>
<div id = "container_quality" class="mt30"> <div id = "container_quality" class="mt30">
</div> </div>
<script> <script>
$(function () { $(function () {
$('#container').highcharts({ $('#container').highcharts({
chart: { chart: {
type: 'pie', type: 'pie',
options3d: { options3d: {
enabled: true, enabled: true,
alpha: 45, alpha: 45,
beta: 0 beta: 0
} }
}, },
title: { title: {
text: 'Browser market shares at a specific website, 2014' text: 'Browser market shares at a specific website, 2014'
}, },
tooltip: { tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
}, },
plotOptions: { plotOptions: {
pie: { pie: {
allowPointSelect: true, allowPointSelect: true,
cursor: 'pointer', cursor: 'pointer',
depth: 35, depth: 35,
dataLabels: { dataLabels: {
enabled: true, enabled: true,
format: '{point.name}' format: '{point.name}'
} }
} }
}, },
series: [{ series: [{
type: 'pie', type: 'pie',
name: 'Browser share', name: 'Browser share',
data: [ data: [
['Firefox', 45.0], ['Firefox', 45.0],
['IE', 26.8], ['IE', 26.8],
{ {
name: 'Chrome', name: 'Chrome',
y: 12.8, y: 12.8,
sliced: true, sliced: true,
selected: true selected: true
}, },
['Safari', 8.5], ['Safari', 8.5],
['Opera', 6.2], ['Opera', 6.2],
['Others', 0.7] ['Others', 0.7]
], ],
dataLabels: { dataLabels: {
enabled: true, enabled: true,
style: { style: {
fontSize: '13px', fontSize: '13px',
color: '#aaa', color: '#aaa',
fontFamily: 'Arial', fontFamily: 'Arial',
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)', textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
fontWeight: 'normal' fontWeight: 'normal'
} }
} }
}] }]
}); });
}); });
</script> </script>
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p> <p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>
<% html_title(l(:label_repository), l(:label_statistics)) -%> <% html_title(l(:label_repository), l(:label_statistics)) -%>
<script>
$(".project_r_h").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
</script>

View File

@ -1,195 +1,199 @@
<%= javascript_include_tag 'highcharts','highcharts-more' %> <%= javascript_include_tag 'highcharts','highcharts-more' %>
<div class="project_r_h" xmlns="http://www.w3.org/1999/html"> <div class="project_r_h" xmlns="http://www.w3.org/1999/html">
<h2 class="project_h2"><%= l(:label_statistics) %></h2> <h2 class="project_h2"><%= l(:label_statistics) %></h2>
</div> </div>
<% if false %> <% if false %>
<div class="flash notice">请在版本库中提交代码,统计信息将更准确</div> <div class="flash notice">请在版本库中提交代码,统计信息将更准确</div>
<% else %> <% else %>
<div class="repository_con " style="line-height:1.9;"> <div class="repository_con " style="line-height:1.9;">
<%= render :partial => 'navigation' %> <%= render :partial => 'navigation' %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div id = "container"> <div id = "container">
</div> </div>
<div id = "container_code" class="mt30"> <div id = "container_code" class="mt30">
</div> </div>
<script> <script>
$(function () { $(function () {
$('#container_code').highcharts({ $('#container_code').highcharts({
chart: { chart: {
type: 'line' type: 'line'
}, },
title: { title: {
text: '版本库代码提交行数', text: '版本库代码提交行数',
style:{ style:{
fontSize: '14px' fontSize: '14px'
} }
}, },
subtitle: { subtitle: {
// text: 'Source: WorldClimate.com' // text: 'Source: WorldClimate.com'
}, },
xAxis: { xAxis: {
// categories: ["Jan", "Jan", "Jan", 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] // categories: ["Jan", "Jan", "Jan", 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
categories: <%= raw(@static_total_per_user.map{|c| c.uname}) %> categories: <%= raw(@static_total_per_user.map{|c| c.uname}) %>
}, },
yAxis: { yAxis: {
title: { title: {
text: '代码行数' text: '代码行数'
} }
}, },
credits:{ credits:{
enabled: false enabled: false
}, },
tooltip: { tooltip: {
enabled: false, enabled: false,
formatter: function() { formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+this.x +': '+ this.y +'°C'; return '<b>'+ this.series.name +'</b><br/>'+this.x +': '+ this.y +'°C';
} }
}, },
plotOptions: { plotOptions: {
series: { series: {
marker: { marker: {
radius: 3, //曲线点半径默认是4 radius: 3, //曲线点半径默认是4
symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle" symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
} }
}, },
line: { line: {
dataLabels: { dataLabels: {
enabled: true enabled: true
}, },
enableMouseTracking: false enableMouseTracking: false
} }
}, },
series: [ series: [
{ {
name: '<b style="font-weight:normal ">总变更</b>', name: '<b style="font-weight:normal ">总变更</b>',
color: '#d05d5a', color: '#d05d5a',
fontWeight: 'normal', fontWeight: 'normal',
data: <%= @static_total_per_user.map{|c| c.changes.to_i} %>, data: <%= @static_total_per_user.map{|c| c.changes.to_i} %>,
dataLabels: { dataLabels: {
enabled: true, enabled: true,
style: { style: {
fontSize: '13px', fontSize: '13px',
color: '#aaa', color: '#aaa',
fontFamily: 'Arial', fontFamily: 'Arial',
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)', textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
fontWeight: 'normal' fontWeight: 'normal'
} }
}, },
lineWidth: 1.5 lineWidth: 1.5
}, },
{ {
name: '<b style="font-weight:normal ">改动或增加</b>', name: '<b style="font-weight:normal ">改动或增加</b>',
color: '#5b6b76', color: '#5b6b76',
data: <%= @static_total_per_user.map{|c| c.add.to_i} %>, data: <%= @static_total_per_user.map{|c| c.add.to_i} %>,
dataLabels: { dataLabels: {
enabled: true, enabled: true,
style: { style: {
fontSize: '13px', fontSize: '13px',
color: '#aaa', color: '#aaa',
fontFamily: 'Arial', fontFamily: 'Arial',
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)', textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
fontWeight: 'normal' fontWeight: 'normal'
} }
}, },
lineWidth: 1.5 lineWidth: 1.5
}, },
{ {
name: '<b style="font-weight:normal ">删除</b>', name: '<b style="font-weight:normal ">删除</b>',
color: '#84b5bb', color: '#84b5bb',
data: <%= @static_total_per_user.map{|c| c.del.to_i} %>, data: <%= @static_total_per_user.map{|c| c.del.to_i} %>,
dataLabels: { dataLabels: {
enabled: true, enabled: true,
style: { style: {
fontSize: '13px', fontSize: '13px',
color: '#aaa', color: '#aaa',
fontFamily: 'Arial', fontFamily: 'Arial',
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)', textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
fontWeight: 'normal' fontWeight: 'normal'
} }
}, },
lineWidth: 1.5 lineWidth: 1.5
}] }]
}); });
// 代码提交次数统计 // 代码提交次数统计
$('#container').highcharts({ $('#container').highcharts({
chart: { chart: {
type: 'line' type: 'line'
}, },
credits:{ credits:{
enabled: false enabled: false
}, },
title: { title: {
text: '版本库代码提交次数', text: '版本库代码提交次数',
style:{ style:{
fontSize: '14px' fontSize: '14px'
} }
}, },
subtitle: { subtitle: {
// text: 'Source: WorldClimate.com' // text: 'Source: WorldClimate.com'
}, },
xAxis: { xAxis: {
// categories: ["Jan", "Jan", "Jan", 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] // categories: ["Jan", "Jan", "Jan", 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
categories: <%= raw(@static_total_per_user.map{|c| c.uname}) %> categories: <%= raw(@static_total_per_user.map{|c| c.uname}) %>
}, },
yAxis: { yAxis: {
title: { title: {
text: '次' text: '次'
} }
}, },
tooltip: { tooltip: {
enabled: false, enabled: false,
formatter: function() { formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+this.x +': '+ this.y +'°C'; return '<b>'+ this.series.name +'</b><br/>'+this.x +': '+ this.y +'°C';
} }
}, },
plotOptions: { plotOptions: {
series: { series: {
marker: { marker: {
radius: 3, //曲线点半径默认是4 radius: 3, //曲线点半径默认是4
symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle" symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
} }
}, },
line: { line: {
dataLabels: { dataLabels: {
enabled: true enabled: true
}, },
enableMouseTracking: false enableMouseTracking: false
} }
}, },
series: [{ series: [{
name: '<b style="font-weight:normal ">提交次数</b>', name: '<b style="font-weight:normal ">提交次数</b>',
fontWeight: 'normal', fontWeight: 'normal',
color: '#d05d5a', color: '#d05d5a',
// 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: [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.commits_num.to_i} %>, data: <%= @static_total_per_user.map{|c| c.commits_num.to_i} %>,
dataLabels: { dataLabels: {
enabled: true, enabled: true,
style: { style: {
fontSize: '13px', fontSize: '13px',
color: '#aaa', color: '#aaa',
fontFamily: 'Arial', fontFamily: 'Arial',
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)', textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
fontWeight: 'normal' fontWeight: 'normal'
} }
}, },
lineWidth: 1.5 lineWidth: 1.5
} }
// { // {
// name: 'London', // name: 'London',
// data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8] // data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]
// } // }
] ]
}); });
}); });
</script> </script>
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p> <p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>
<% html_title(l(:label_repository), l(:label_statistics)) -%> <% html_title(l(:label_repository), l(:label_statistics)) -%>
<% end %> <% end %>
<script>
$(".project_r_h").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
</script>