代码质量分析列表优化

This commit is contained in:
huang 2016-11-15 15:34:15 +08:00
parent 0adde560ba
commit 3ab5ab4e4b
2 changed files with 33 additions and 62 deletions

View File

@ -3,74 +3,39 @@
$("#ajax-indicator").show();
</script>
<div class="quality_info mb10">
<h2><a href="javascript:history.go(-1)" class="fl linkBlue2 mr5" >
<span class="new_roadmap_icons_back mr5"></span>
返回</a> <span class="fl mr5">|</span> <span class="fl">分析结果</span>
<h2>
<%= link_to "<span class='new_roadmap_icons_back mr5'></span>返回".html_safe, {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).try(:identifier)}, :class => "fl linkBlue2 mr5 mt1" %>
<span class="fl mr5">|</span> <span class="fl mt1">分析结果</span>
</h2>
</div>
<div class="container-big mb10">
<table>
<tbody>
<tr>
<td>名称</td>
<td>分支</td>
<td>语言</td>
<td>路径</td>
<td>时间</td>
<td></td>
</tr>
</tbody>
<tbody>
<% if @quality_analyses && @quality_analyses.count > 0 %>
<% @quality_analyses.each do |qa| %>
<tr>
<td></td>
<td><%= qa.branch %></td>
<td><%= qa.language %></td>
<td><%= qa.path %></td>
<td><%= format_time(qa.created_at) %></td>
<td><%=link_to "删除", delete_project_quality_analysi_path(qa, :project_id => @project.id), :method => "delete", :confirm => "删除会一并删除分析结果,确定删除吗?", :class => "fontBlue2" %></td>
</tr>
<% end %>
<% else %>
<% end %>
</tbody>
</table>
</div>
<div class="container-big mb10">
<div class="project_r_h" style="width:970px;">
<h2 class="project_h2">分析结果</h2>
</div>
<ul class="analysis-result-list">
<li class="analysis-result-name fl fontBlue2" >名称</li>
<li class="analysis-result-version fl fontBlue2" >分支</li>
<li class="analysis-result-loc fl fontBlue2" >语言</li>
<li class="analysis-result-debt fl fontBlue2" >路径</li>
<li class="analysis-result-time fl fontBlue2" >最近更新</li>
<li class="analysis-result-edit fl fontBlue2" ></li>
<div class="cl"></div>
</ul>
<% if @quality_analyses && @quality_analyses.count >0 %>
<table class="sy_new_table " cellpadding="0" cellspacing="0">
<thead>
<tr>
<td style="width:15%;">名称</td>
<td style="width:10%;">分支</td>
<td style="width:10%;">语言</td>
<td style="width:25%;">路径</td>
<td style="width:20%;">时间</td>
<td style="width:10%;"></td>
</tr>
</thead>
<tbody>
<% if @quality_analyses && @quality_analyses.count > 0 %>
<% @quality_analyses.each do |qa| %>
<ul class="analysis-result-list">
<li title="<%= qa.author_login+ ':' +qa.rep_identifier %>"><%=link_to "#{qa.author_login}:#{qa.rep_identifier}", project_quality_analysis_path(:resource_id => qa.sonar_name, :branch => (qa.branch.nil? ? "master" : qa.branch)), :class => "analysis-result-name fl fontBlue2 hidden" %></li>
<li class="analysis-result-version fl fontBlue2 hidden" title="<%= qa.branch %>"><%= qa.branch %></li>
<li class="analysis-result-loc fl fontBlue2 hidden" title="<%= qa.language %>"><%= qa.language %></li>
<li class="analysis-result-debt fl fontBlue2 hidden" title="<%= qa.path %>"><%= qa.path %></li>
<li class="analysis-result-time fl fontBlue2 hidden" title="<%= sonar_time(qa.sonar_name).blank? ? qa.created_at : sonar_time(qa.sonar_name) %>"><%= format_time(sonar_time(qa.sonar_name).blank? ? qa.created_at : sonar_time(qa.sonar_name)) %></li>
<% if User.current.try(:login) == qa.author_login || User.current.admin? || is_project_manager?(User.current.id, @project.id) %>
<li class="analysis-result-edit fl fontBlue2 hidden" title="<%= qa.path %>">
<%=link_to "删除", delete_project_quality_analysi_path(qa, :project_id => @project.id), :method => "delete", :confirm => "删除会一并删除分析结果,确定删除吗?", :class => "fontBlue2" %>
</li>
<% end %>
<div class="cl"></div>
</ul>
<tr>
<td style="width:15%;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" title="<%= qa.sonar_name %>"><%=link_to qa.sonar_name, project_quality_analysis_path(:resource_id => qa.sonar_name, :branch => (qa.branch.nil? ? "master" : qa.branch)), :class => "analysis-result-name fl fontBlue2 hidden" %></td>
<td style="width:10%;"><%= qa.branch %></td>
<td style="width:10%;"><%= qa.language %></td>
<td style="width:25%;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" title="<%= qa.path %>"><%= qa.path %></td>
<td style="width:20%;"><%= format_time(qa.created_at) %></td>
<td style="width:10%;"><%=link_to "删除", delete_project_quality_analysi_path(qa, :project_id => @project.id), :method => "delete", :confirm => "删除会一并删除分析结果,确定删除吗?", :class => "fontBlue2" %></td>
</tr>
<% end %>
<% else %>
<%#= 数据为空时候界面,待完善 %>
<% end %>
</tbody>
</table>
</div>

View File

@ -1035,3 +1035,9 @@ a:hover.pro_new_users {color: #3b94d6}
/*质量分析*/
.quality_info{ border:1px solid #ddd; background-color:#fff; width: 998px;}
.quality_info h2{ background: #fff; font-size: 14px; color: #333; height: 40px; line-height: 40px; padding-left: 15px; border-bottom:1px solid #e5e5e5;}
table.quality_list{ border:none; border-collapse: collapse; width: 100%; margin-bottom: 4px; }
table.quality_list tbody td, table.quality_list tbody tr td {
border-bottom: solid 1px #ddd;
font-size: 11px;
padding: 4px 10px 4px 3px;
}