左侧工具栏添加功能:左侧统计数目为零的手不显示

This commit is contained in:
huang 2015-03-12 19:29:44 +08:00
parent ab57e7e432
commit 47e1427ead
1 changed files with 17 additions and 6 deletions

View File

@ -140,12 +140,16 @@
<% end %>
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %>
<span class="subnav_num">(<%= ForgeActivity.where("project_id = ?", @project.id).count %>)</span>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
<span class="subnav_num">(<%= ForgeActivity.where("project_id = ?", @project.id).count %>)</span>
<% end %>
</div>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<div class="subNav">
<%= link_to l(:label_issue_tracking), project_issues_path(@project), :style => "color:#3CA5C6" %><span class="subnav_num">(<%= @project.issues.count %>)</span>
<span>
<%= link_to l(:label_issue_tracking), project_issues_path(@project), :style => "color:#3CA5C6" %>
<% unless @project.issues.count == 0 %>
<span class="subnav_num">(<%= @project.issues.count %>)</span><span>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %></span>
<% end %>
@ -154,7 +158,9 @@
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_boards), project_boards_path(@project), :style => "color:#3CA5C6" %>
<span class="subnav_num">(<%= @project.boards.first.topics.count %>)</span>
<% unless @project.boards.first.topics.count == 0 %>
<span class="subnav_num">(<%= @project.boards.first.topics.count %>)</span>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects',:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %>
<% end %>
@ -162,7 +168,10 @@
<% end%>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav">
<%= link_to l(:label_course_file), project_files_path(@project), :style => "color:#3CA5C6" %><span class="subnav_num">(<%= @project.attachments.count %>)</span>
<%= link_to l(:label_course_file), project_files_path(@project), :style => "color:#3CA5C6" %>
<% unless @project.attachments.count == 0 %>
<span class="subnav_num">(<%= @project.attachments.count %>)</span>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
<% end %>
@ -171,7 +180,9 @@
<% unless @project.enabled_modules.where("name = 'repository'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %>
<span class="subnav_num">(<%= @project.repositories.count %>)</span>
<% unless @project.repositories.count == 0 %>
<span class="subnav_num">(<%= @project.repositories.count %>)</span>
<% end %>
<%# if User.current.member_of?(@project) %>
<%#= link_to "+"+l(:project_module_create_repository), new_project_repository_path(@project),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
<%# end %>