Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

This commit is contained in:
daiao 2016-08-25 15:29:19 +08:00
commit 758aaca12a
9 changed files with 16 additions and 30 deletions

View File

@ -10,7 +10,7 @@ class AtController < ApplicationController
@users = users.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id }.sort{|x,y| to_pinyin(x.show_name) <=> to_pinyin(y.show_name)} if users
#加上all
if @user && @users.size > 0
if User.current.logged? && @users.size > 0
allUser = Struct.new(:id, :name).new
allUser.id = @users.map{|u| u.id}.join(",")
allUser.name = "all"

View File

@ -237,11 +237,6 @@ class QualityAnalysisController < ApplicationController
arr = JSON.parse(projects_date).map {|m| m["nm"]} # eg: ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"]
@quality_analyses = QualityAnalysis.where(:project_id => @project.id).select{|qa| arr.include?(qa.sonar_name)}
else
languate_arr = ['ruby', 'c#', 'c++', 'c']
qa_language = QualityAnalysis.where(:sonar_name => @resource_id).first.try(:language)
if !qa_language.blank? && languate_arr.include?(qa_language)
@language_flag = true
end
filter = "sqale_rating,function_complexity,duplicated_lines_density,comment_lines_density,sqale_index,lines,files,functions,classes,directories,blocker_violations,critical_violations,major_violations,minor_violations,info_violations,violations"
complexity_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=#{filter}").read
@complexity =JSON.parse(complexity_date).first

View File

@ -1,11 +1,11 @@
[
<% @users && @users.each_with_index do |person,index| %>
<% if index == 0 %>
{"id":<%=index%>, "userid": "<%=person.id%>", "name": "所有人", "login": "<%=person.name%>", "searchKey": "<%=person.name%>"}
<%= index != @users.size-1 ? ',' : '' %>
<% else %>
{"id":<%=index%>, "userid": <%=person.id%>, "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
<%= index != @users.size-1 ? ',' : '' %>
<% end %>
<% end %>
<% @users && @users.each_with_index do |person,index| %>
<% if index == 0 %>
{"id":<%=index%>, "userid": "<%=person.id%>", "name": "所有人", "login": "<%=person.name%>", "searchKey": "<%=person.name%>"}
<%= index != @users.size-1 ? ',' : '' %>
<% else %>
{"id":<%=index%>, "userid": "<%=person.id%>", "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
<%= index != @users.size-1 ? ',' : '' %>
<% end %>
<% end %>
]

View File

@ -12,7 +12,7 @@
</div>
<div class="mb10">
<div>
<%= select_tag :language, options_for_select(["java","python","ruby","c++","c#","c"], "#{@quality_analysis.language}"), :id => 'branch', :class => "analysis-option-box" %>
<%= select_tag :language, options_for_select(["java","python","c#"], "#{@quality_analysis.language}"), :id => 'branch', :class => "analysis-option-box" %>
</div>
</div>
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#quality_analyses_edit_form').submit();hideModal()">提交</a></div>

View File

@ -3,13 +3,6 @@
<h2 class="project_h2" style="width:180px;">质量分析</h2>
</div>
<% if @language_flag %>
<div class="flash warning">
本平台使用的代码质量分析工具是sonar开源质量数据报告工具目前ruby、c++、c#语言的分析结果可能存在一定的偏差,
建议结合其他数据质量分析工具进行综合判断。
</div>
<% end %>
<div class="button-rep">当前分支:<%= params[:branch] %></div>
<div class="cl"></div>
<div class="tac f20 fb mt35 mb30">项目代码质量分析报告</div>

View File

@ -12,7 +12,7 @@
</div>
<div class="mb10">
<div>
<%= select_tag :language, options_for_select(["java","python","ruby","c++","c#","c"]), :id => 'branch', :class => "analysis-option-box" %>
<%= select_tag :language, options_for_select(["java","python","c#"]), :id => 'branch', :class => "analysis-option-box" %>
</div>
</div>
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#ajax-indicator').css('opacity','0.8').text('正在分析中…………(大概需要30分钟请耐心等待)').show();$('#quality_analyses_form').submit();hideModal()">提交</a></div>

View File

@ -4,7 +4,7 @@
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5; background:#eaebec;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
table,tr,td{border:0;}
ol,ul,li{ list-style-type:none}
blockquote {
border:1px solid #d4d4d4;

View File

@ -372,7 +372,7 @@ tr.entry td.filename_no_report { width: 40%; }
tr.entry td.size { text-align: right; font-size: 90%; }
tr.entry td.revision, tr.entry td.author { text-align: center; }
tr.entry td.age { text-align: right; }
tr.entry.file td.filename a { margin-center: 16px; }
tr.entry.file td.filename a { }
tr.entry.file td.filename_no_report a { margin-left: 16px; }
tr span.expander {background-image: url(/images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;}

View File

@ -1,5 +1,3 @@
/*将header.css文件和public.css,new_user.css中的内容统一*/
@charset "utf-8";
/* CSS Document */
@ -34,7 +32,7 @@ a:hover.search_btn{ background: #0fa9bb;}
a.parent {background: url(/images/arrowList.png) -30px 3px no-repeat; width:95px; padding-right:50px;}
a.parent:hover {background: url(/images/arrowList.png) -30px -14px no-repeat; width:95px; padding-right:50px; color:#fe7d68;}
a.linkToOrange:hover {color:#fe7d68;}
#userInfo ul li {positon: relative;}
#userInfo ul li {position: relative;}
#userInfo ul li ul {display:none;}
#userInfo ul li:hover ul {display:block; position:absolute;}
#userInfo ul li:hover ul li ul {display:none;}
@ -383,7 +381,7 @@ ul.subNavArrow:hover li ul {display:block;}
.currentDd{color:#0781b4;}
.currentDt{background-color:#fff;}
.navContent{display: none;border-bottom:solid 1px #e5e3da; }
.navContent li a{display:block;width:240px;heigh:28px;text-align:center;font-size:12px;line-height:28px;color:#333}
.navContent li a{display:block;width:240px;height:28px;text-align:center;font-size:12px;line-height:28px;color:#333}
.navContent li a:hover{color:#fff;background-color:#b3e0ee}
a.subnav_num{ font-weight:normal; color:#ff7143; font-size:12px;}
a.subnav_green{ background:#28be6c; color:#fff; font-size:12px; font-weight:normal;height:18px; padding:0px 5px; padding-top:2px; display:block; margin-top:2px; margin-bottom:5px; float:right; margin-right:5px;line-height:1.4 !important;}