非项目成员添加新闻、添加讨论区按钮不可见

This commit is contained in:
sw 2015-03-07 14:43:54 +08:00
parent 945b9ff9cf
commit 3f3bb62678
2 changed files with 6 additions and 6 deletions

View File

@ -45,7 +45,7 @@
<%= link_to @topic_count,:controller => 'boards',:action => 'index' %> <%= link_to @topic_count,:controller => 'boards',:action => 'index' %>
个贴子 个贴子
</span> </span>
<% if @project.enabled_modules.where("name = 'boards'").count > 0 %> <% if @project.enabled_modules.where("name = 'boards'").count > 0 && User.current.member_of?(@project) %>
<span> <span>
<%= link_to l(:label_message_new), <%= link_to l(:label_message_new),
new_board_message_path(@board), new_board_message_path(@board),

View File

@ -70,11 +70,11 @@
<span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;"> <span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;">
<%= label_tips %> <%= label_tips %>
</span> </span>
<% if @project.enabled_modules.where("name = 'news'").count > 0 %> <% if @project.enabled_modules.where("name = 'news'").count > 0 && User.current.member_of?(@project) %>
<%= link_to(btn_tips, <%= link_to(btn_tips,
new_project_news_path(@project), new_project_news_path(@project),
:class => 'icon icon-add', :class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %> :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
<% end %> <% end %>
<% if @project && User.current.allowed_to?(:manage_news, @project) %> <% if @project && User.current.allowed_to?(:manage_news, @project) %>
<div id="add-news" class="add_frame" style="display:none;"> <div id="add-news" class="add_frame" style="display:none;">