1. PullRequest后面加入请求数目

This commit is contained in:
daiao 2016-09-14 13:15:00 +08:00
parent 3e38b09219
commit 41ab10410f
2 changed files with 7 additions and 0 deletions

View File

@ -925,6 +925,12 @@ module ApplicationHelper
s.html_safe
end
# 计算Pull Request的请求数目
def pull_request_count project
g = Gitlab.client
g.merge_requests(project.gpid).count
end
#项目成员列表复选框生成
def project_member_check_box_tags_ex name, principals
s = ''

View File

@ -44,6 +44,7 @@
<% 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" %>
<%= link_to "(#{pull_request_count(@project)})", project_pull_requests_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
<% if User.current.member_of?(@project) %>
<%= link_to "+新建请求", new_project_pull_request_path(:project_id => @project.id), :class => "subnav_green" %>
<% end %>