socialforge/app/views/projects/_development_group.html.erb

80 lines
4.5 KiB
Plaintext

<% project_file_num = Attachment.where(:container_type => "Project", :container_id => @project.id).count %>
<% project_issue_count =Issue.where(:project_id => @project.id).count%>
<% acts_count = ForgeActivity.where("project_id = ?", @project.id).count %>
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless acts_count == 0 %>
<a class="subnav_num">(<%= acts_count %>)</a>
<% end %>
</div>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<div class="subNav">
<%= link_to l(:label_issue_tracking), project_issues_path(@project, :remote => true), :class => "f14 c_blue02" %>
<% if project_issue_count > 0 %>
<a class="subnav_num">(<%= project_issue_count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "", new_project_issue_path(@project) , :class => "publish-icon fr mr10 mt2", :title => "发布问题" %>
<% end %>
</div>
<% end %>
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
<% unless @project.project_score.board_num == 0 %>
<a class="subnav_num">(<%= @project.project_score.board_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "", project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "publish-icon fr mr10 mt2", :title => "发布新帖" %>
<% end %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless project_file_num == 0 %>
<%= link_to "(#{project_file_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
<% end %>
<% if User.current.member_of?(@project) %>
<%#= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<a class="publish-icon fr mr10 mt2" href="javascript:void(0);" onclick="project_files_upload();" title="上传资源"></a>
<% end %>
</div>
<% end %>
<% 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 => "publish-icon fr mr10 mt2", :title => "新建请求" %>
<% end %>
</div>
<% end %>
<%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %>
<% if visible_repository?(@project) %>
<div class="subNav">
<% if rep_is_gitlab?(@project) %>
<%= link_to l(:project_module_repository), {:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories'}, :class => "f14 c_blue02" %>
<% else %>
<%= link_to l(:project_module_repository),({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).identifier}), :class => "f14 c_blue02" %>
<% end %>
<% unless @project.project_score.changeset_num == 0 %>
<%= link_to "(#{@project.project_score.changeset_num})", ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).identifier}), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
<% end %>
<!--<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_gitlab_create_repository), url_for(:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories') , :class => "subnav_green" %>
<% end %>
</div>
<% end %>
<!-- more -->
<div class="subNav subNav_jiantou" id="expand_tools_expand"><%= l(:label_project_more) %></div>
<ul class="navContent" id="navContent">
<%= render 'projects/tools_expand' %>
</ul>