From 0c221abd6175ebbb6efb603e840c0ef58ad4ef90 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 31 Aug 2016 09:18:05 +0800 Subject: [PATCH] =?UTF-8?q?PULL=20REQUEST=20=E9=BB=98=E8=AE=A4=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 6 +----- app/views/projects/_development_group.html.erb | 14 ++++++++------ app/views/pull_requests/index.html.erb | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1ff7fc2d9..6588d15f3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -830,11 +830,7 @@ module ApplicationHelper return false if project.gpid.nil? g = Gitlab.client count = g.user_static(project.gpid, :rev => "master").count - if User.current.member_of?(project) && count > 0 - true - else - false - end + count end # 判断版本库是否初始为gitlab diff --git a/app/views/projects/_development_group.html.erb b/app/views/projects/_development_group.html.erb index 82bcb5501..52f4e002a 100644 --- a/app/views/projects/_development_group.html.erb +++ b/app/views/projects/_development_group.html.erb @@ -40,12 +40,14 @@ <% end %> - +<% if allow_pull_request(@project) %> + +<% end %> <%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %> <% if visible_repository?(@project) %> diff --git a/app/views/pull_requests/index.html.erb b/app/views/pull_requests/index.html.erb index f4fe0725e..2af67293f 100644 --- a/app/views/pull_requests/index.html.erb +++ b/app/views/pull_requests/index.html.erb @@ -3,7 +3,7 @@
  • <%= link_to "待处理#{@requests_opened_count}".html_safe, project_pull_requests_path(:type => "1"), :remote => true %>
  • <%= link_to "已处理#{@requests_merged_count}".html_safe, project_pull_requests_path(:type => "2"), :remote => true %>
  • <%= link_to "已关闭#{@requests_closed_count}".html_safe, project_pull_requests_path(:type => "3"), :remote => true %>
  • - <% if allow_pull_request(@project) %> + <% if allow_pull_request(@project) && User.current.member_of?(@project) %> <%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %> <% end %>