pull request 列表增加源项目/姓名 目标项目/姓名

This commit is contained in:
huang 2016-11-25 20:34:59 +08:00
parent 99ac546782
commit ecf5101ef2
2 changed files with 6 additions and 3 deletions

View File

@ -19,6 +19,11 @@ module PullRequestsHelper
PullRequest.where(:pull_request_id => pull_request_id).first PullRequest.where(:pull_request_id => pull_request_id).first
end end
# 通过gitlab项目id获取Trustie项目的用户名
def find_gitlab_project gitlab_project_id
Project.find_by_gpid(gitlab_project_id).owner.try(:show_name)
end
def get_state state def get_state state
case state case state
when "open","reopened" when "open","reopened"

View File

@ -14,10 +14,8 @@
<div class="c_grey clear mt5"> <div class="c_grey clear mt5">
<p class="fl">由 <%= link_to request.author.try(:username), user_path(get_user_by_login_and(request.author.try(:username))), :class => "linkBlue2" %> 创建于<%= time_tag(request.created_at) %>前</p> <p class="fl">由 <%= link_to request.author.try(:username), user_path(get_user_by_login_and(request.author.try(:username))), :class => "linkBlue2" %> 创建于<%= time_tag(request.created_at) %>前</p>
<span class="fl ml10"><%= time_tag(request.updated_at) %>前更新</span> <span class="fl ml10"><%= time_tag(request.updated_at) %>前更新</span>
<p class="fr"><%= @project.name+"/"+request.source_branch %><span class="c_grey02 ml10 mr10">合并到</span><%= request.target_branch %></p> <p class="fr"><%= find_gitlab_project(request.source_project_id)+"/"+request.source_branch %><span class="c_grey02 ml10 mr10">合并到</span><%= find_gitlab_project(request.target_project_id)+"/"+request.target_branch %></p>
</div> </div>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>