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

Conflicts:
	db/schema.rb
This commit is contained in:
cxt 2016-09-09 15:58:42 +08:00
commit 5d83c66949
9 changed files with 38 additions and 17 deletions

View File

@ -132,16 +132,13 @@ class IssuesController < ApplicationController
User.current.at_messages.unviewed('Journal', j.id).each {|x| x.viewed!}
end
# 缺陷状态更新
query_journals = @issue.journals
query_journals.each do |query_journal|
query_journal.forge_messages.each do |f|
if User.current.id == f.user_id
f.update_attributes(:viewed => true)
end
end
end
# end
# 缺陷状态消息更新
query_journals_ids = @issue.journals.map{|journal| journal.id}
if query_journals_ids.length > 0
query_journals = ForgeMessage.where("user_id =? and forge_message_type =? and forge_message_id in (#{query_journals_ids.join(",")})", User.current.id, "Journal")
query_journals.update_all(:viewed => true)
end
@jour_reply = Journal.new
@journals = @issue.journals.includes(:user, :details).reorder("#{Journal.table_name}.id ASC").all
@journals.each_with_index {|j,i| j.indice = i+1}

View File

@ -252,7 +252,7 @@ class QualityAnalysisController < ApplicationController
unresolved_issue_count = JSON.parse(unresolved_issues)["total"].to_i
all_issues = open(@sonar_address + "/api/issues/search?projectKeys=#{@resource_id}&authors=#{email}").read
all_issue_count = JSON.parse(all_issues)["total"].to_i
ratio = (changes == 0 ? 0 : format("%0.4f",unresolved_issue_count.to_f/changes.to_f))
ratio = ((changes == 0 || all_issue_count == 0) ? 0 : format("%0.4f",all_issue_count.to_f/changes.to_f))
@user_quality_infos << {:email => email, :changes => changes, :unresolved_issue_count => unresolved_issue_count, :ratio => ratio, :all_issue_count => all_issue_count}
end

View File

@ -423,7 +423,7 @@ module ApplicationHelper
else
s = link_to text, issue_path(issue), :class => "c_blue", :title => title
end
s << h(": #{subject}") if subject
s << h("<span style='width:450px;display:inline-block;' class='hidden'>: #{subject}</span>".html_safe) if subject
s = h("#{issue.project} - ") + s if options[:project]
s
end
@ -652,7 +652,7 @@ module ApplicationHelper
s << watcher_link(@project, User.current)#, ['whiteButton'])
s << "</span>"
end
s << (render :partial => 'projects/project', :locals => {:project => project}).to_s
s << (render :partial => 'projects/tracker_project', :locals => {:project => project}).to_s
else
s << (render :partial => 'projects/course', :locals => {:project => project}).to_s
end
@ -832,7 +832,13 @@ module ApplicationHelper
atts.count > 0 ? true :false
end
# 必须是项目成,项目必须提交过代码
# 如果Pull Request数量为0就显示在更多中
def allow_show_pull_request project
g = Gitlab.client
count = g.merge_requests(project.gpid).count
end
# 必须是项目成员,项目必须提交过代码
def allow_pull_request project
return false if project.gpid.nil?
g = Gitlab.client

View File

@ -64,7 +64,6 @@
<td class="buttons">
<%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock') unless project.archived? %>
<%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if project.archived? && (project.parent.nil? || !project.parent.archived?) %>
<%= link_to(l(:button_copy), { :controller => 'projects', :action => 'copy', :id => project }, :class => 'icon icon-copy') %>
<%= link_to(l(:button_delete), project_path(project), :method => :delete, :class => 'icon icon-del', :onClick=>"delcfm()" ) %>
</td>
</tr>

View File

@ -79,4 +79,11 @@
<%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %>
<% end %>
<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="blue_btn fl ml80" id="issue_confirm"> 确定</a>
<a href="javascript:void(0);" onclick="issueDetailShow();" class="grey_btn fl mr50 ml10" > 取消 </a>
<% if params[:action] == "new" %>
<% if @copy_from %>
<%= link_to "取消", issue_path(@copy_from), :class => "grey_btn fl mr50 ml10" %>
<% end %>
<% else %>
<a href="javascript:void(0);" onclick="issueDetailShow();" class="grey_btn fl mr50 ml10" > 取消 </a>
<% end %>

View File

@ -41,7 +41,7 @@
</div>
<% end %>
<% if allow_pull_request(@project) %>
<% if allow_pull_request(@project) > 0 && allow_show_pull_request(@project) > 0 %>
<div class="subNav">
<%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "f14 c_blue02" %>
<% if User.current.member_of?(@project) %>

View File

@ -1,3 +1,8 @@
<li>
<% if allow_pull_request(@project) > 0 && allow_show_pull_request(@project) == 0 %>
<%= link_to "Pull Requests", project_pull_requests_path(@project) %>
<% end %>
</li>
<li>
<% unless @project.enabled_modules.where("name = 'news'").empty? %>
<%= link_to l(:project_module_news), project_news_index_path(@project) %>

View File

@ -0,0 +1,6 @@
<div class="project-block">
<div class="wiki-description">
<p><%= textilizable(project.short_description.strip, :project => project) %></p>
</div>
</div>

View File

@ -47,6 +47,7 @@
<% issues.each do |issue| -%>
<li style="overflow:hidden">
<%= link_to_issue_version(issue, :project => (@project != issue.project)) %>
<span class="mr5 fr" >指派给:<%= link_to "#{User.find(issue.try(:assigned_to_id)).show_name}", user_path(issue.try(:assigned_to_id)), :class => "c_blue hidden" %></span>
</li>
<% end -%>
</ul>