#2000 增加项目每个模块的访问控制

This commit is contained in:
sw 2015-03-11 15:14:23 +08:00
parent 0525b03e65
commit 27e72c1f39
3 changed files with 31 additions and 9 deletions

View File

@ -2,7 +2,7 @@
<h2 class="project_h2">问题跟踪</h2>
</div>
<div class="problem_top">
<% if @project.enabled_modules.where("name = 'issue_tracking'").count > 0 %>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<span>
<% if User.current.member_of?(@project) %>
<%= link_to l(:label_issue_new), {:controller => 'issues', :action => 'new', :copy_from => nil}, :param => :project_id, :caption => :label_issue_new,

View File

@ -137,13 +137,16 @@
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %>
</div>
<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>
<% if User.current.logged? && User.current.member_of?(@project) %>
<%= link_to "+发布问题", 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 %>
</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>
<% if User.current.logged? && User.current.member_of?(@project) %>
<%= link_to "+发布问题", 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 %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to "讨论区", project_boards_path(@project), :style => "color:#3CA5C6" %>
<span class="subnav_num">(<%= @project.boards.first.topics.count %>)</span>
@ -151,12 +154,16 @@
<%= link_to "+发贴", 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 %>
</div>
<% 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>
<% if User.current.logged? && User.current.member_of?(@project) %>
<%= link_to "+上传资源", new_project_file_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 %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'repository'").empty? %>
<div class="subNav">
<%= link_to l(:field_user_active_changeset), {:controller => 'repositories', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %>
<span class="subnav_num">(<%= @project.repositories.count %>)</span>
@ -164,6 +171,7 @@
<%= link_to "+创建版本库", 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 %>
</div>
<% end %>
<div class="subNav subNav_jiantou"><%= l(:label_more) %></div>
<ul class="navContent" style="padding-left: 0px">

View File

@ -4,27 +4,41 @@
<% end %>
</li>
<li>
<%= link_to l(:field_user_active_news), project_news_index_path(@project) %>
<% unless @project.enabled_modules.where("name = 'news'").empty? %>
<%= link_to l(:field_user_active_news), project_news_index_path(@project) %>
<% end%>
</li>
<li>
<% unless @project.enabled_modules.where("name = 'wiki'").empty? %>
<%= link_to l(:project_module_wiki), project_wiki_path(@project) %>
<% end %>
</li>
<li>
<% unless @project.enabled_modules.where("name = 'code_review'").empty? %>
<%= link_to l(:project_module_code_review), {controller: 'code_review', action: 'index', id: @project.id} %>
<% end %>
</li>
<li>
<% unless @project.enabled_modules.where("name = 'calendar'").empty? %>
<%= link_to l(:project_module_calendar),project_calendar_path(@project) %>
<% end %>
</li>
<li>
<% unless @project.enabled_modules.where("name = 'gantt'").empty? %>
<%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %>
<% end %>
</li>
<li>
<% unless @project.enabled_modules.where("name = 'documents'").empty? %>
<%= link_to l(:project_module_documents), project_documents_path(@project) %>
<% end %>
</li>
<li>
<%= link_to l(:label_project_tool_response) ,project_feedback_path(@project)%>
</li>
<li>
<% unless @project.enabled_modules.where("name = 'dts'").empty? %>
<%= link_to l(:label_module_share) ,share_show_path(@project) %>
<% end %>
</li>