diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb
index 2d1d0bba7..dc4ccbc67 100644
--- a/app/controllers/boards_controller.rb
+++ b/app/controllers/boards_controller.rb
@@ -30,13 +30,15 @@ class BoardsController < ApplicationController
def index
@boards = @project.boards.includes(:last_message => :author).all
# show the board if there is only one
+ unless @project.project_type == 1
if @boards.size == 1
@board = @boards.first
show
end
+ end
if @project.project_type == 1
- render :layout => 'base_courses'
- else
+ render :layout => 'base_courses'
+ else
render :layout => false if request.xhr?
end
end
@@ -85,12 +87,10 @@ class BoardsController < ApplicationController
end
end
- def create
+ def create
@board = @project.boards.build
@board.safe_attributes = params[:board]
- if @project.project_type == 1
- render :layout => 'base_courses'
- end
+
if @board.save
flash[:notice] = l(:notice_successful_create)
#Modified by young
diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb
index 0a40e3d0e..ba6faa650 100644
--- a/app/views/bids/_homework_list.html.erb
+++ b/app/views/bids/_homework_list.html.erb
@@ -31,11 +31,13 @@
+ <% unless User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0) %>
<% options = {:author => true, :deletable => attach_delete(homework)} %>
<%= render :partial => 'attachments/links',
:locals => {:attachments => homework.attachments, :options => options} %>
+ <% end %>
|
diff --git a/app/views/boards/index.html.erb b/app/views/boards/index.html.erb
index c7e4f5b54..614066613 100644
--- a/app/views/boards/index.html.erb
+++ b/app/views/boards/index.html.erb
@@ -1,5 +1,5 @@
- <% if User.current.logged? %>
+ <% if User.current.logged? && User.current.member_of?(@project) %>
<%= link_to l(:label_board_new), new_project_board_path(@project), :class => 'icon icon-add' %>
<% end %>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index 145457a61..7bcb78ad5 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -210,20 +210,23 @@
-
- <%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview)%>
+ <%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview) %>
-
<%= link_to l(:label_homework), {:controller => 'projects', :action => 'homework'}, :class => link_class('Task')%>
+ -
+ <%= link_to l(:label_course_board), { :controller => 'boards', :action => 'index', :project_id => @project}, :class => link_class(:boards) %>
+
-
<%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%>
-
- <%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news)%>
+ <%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news) %>
-
<%= link_to l(:label_course_feedback), project_feedback_path(@project), :class => link_class('Feedback')%>
-
+
<% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 7, 9)).size >0))%>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 18f3127bb..5c529ee7f 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -623,6 +623,7 @@ zh:
label_homework_commit: 提交作业 #huang
label_homework_info: 作业情况 #huang
label_course_news: 课程通知
+ label_course_board: 讨论区
label_version: 版本
label_version_new: 新建版本
label_version_plural: 版本