authoriod

This commit is contained in:
txz 2016-07-01 20:16:06 +08:00
parent 8cc4b7a878
commit 134aa55e04
2 changed files with 8 additions and 2 deletions

View File

@ -21,7 +21,13 @@
<li class="analysis-result-version fl fontBlue2" title="分支名"><%= qa.branch %></li>
<li class="analysis-result-loc fl fontBlue2" title="语言"><%= qa.language %></li>
<li class="analysis-result-debt fl fontBlue2" title="时间"><%= qa.path %></li>
<li class="analysis-result-time fl fontBlue2" title="编辑"><%=link_to "编辑", edit_project_quality_analysi_path(qa, :project_id => @project.id), :remote => true %></li>
<% if User.current.try(:login) == qa.author_login %>
<li class="analysis-result-time fl" title="编辑">
<%=link_to "编辑", edit_project_quality_analysi_path(qa, :project_id => @project.id), :remote => true, :class => "fontBlue2" %>
</li>
<% else %>
<li class="analysis-result-time fl" style="color: #888" title="编辑">编辑</li>
<% end %>
<div class="cl"></div>
</ul>
<% end %>

View File

@ -5,7 +5,7 @@
<a href="<%= @zip_path %>" class="btn_zipdown fr" onclick="">ZIP下载</a>
<%# if is_project_manager?(User.current, @project.id) && QualityAnalysis.where(:project_id => @project.id).first.nil? %>
<%# if User.current.member_of?(@project) %>
<% if quality_analysis(User.current.try(:login), @repository.id).nil? && is_project_manager?(User.current.id, @project.id) && @project.is_public? %>
<% if quality_analysis(User.current.try(:login), @repository.id).nil? && User.current.member_of?(@project) && @project.is_public? %>
<%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch ), :remote => true, :class => "btn_zipdown fr" %>
<% end %>
<%# end %>