<script type="text/javascript">
    //        $("#ajax-indicator span").text("载入中...");
    $("#ajax-indicator").show();
</script>
<div class="project_r_h" style="width:730px;">
  <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 %>
    <% @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 "编辑", edit_project_quality_analysi_path(qa, :project_id => @project.id), :remote => true, :class => "fontBlue2" %><span style="color: #888"> / </span>
                <%=link_to "删除", delete_project_quality_analysi_path(qa, :project_id => @project.id), :method => "delete", :confirm => "删除会一并删除分析结果，确定删除吗？", :class => "fontBlue2" %>
            </li>
          <% end %>
          <div class="cl"></div>
        </ul>
    <% end %>
<% else %>
    <%#= 数据为空时候界面，待完善 %>
<% end %>

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


