项目管理员---项目左侧添加新建版本库入口

This commit is contained in:
huang 2015-11-02 14:26:23 +08:00
parent 05bb40c8a7
commit eb3c65f1c6
2 changed files with 4 additions and 1 deletions

View File

@ -117,7 +117,7 @@ module ProjectsHelper
end
end
# 判断版本库是否为gitlab
# 判断版本库是否初始为gitlab
def rep_is_gitlab?(project)
rep = Repository.where("project_id =? and type =?", project, "Repository::Gitlab")
return rep.blank? ? true :false

View File

@ -43,6 +43,9 @@
<div class="subNav">
<%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id, to: 'gitlab'}, :class => "f14 c_blue02" %>
<a class="subnav_num">(<%= @project.repositories.count %>)</a>
<% if (User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project)) && rep_is_gitlab?(@project) %>
<%= link_to "+"+l(:project_module_create_repository), url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'repositories') , :class => "subnav_green" %>
<% end %>
</div>
<% end %>
<!-- more -->