|
|
|
@ -39,6 +39,7 @@ class BoardsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
render :layout => false if request.xhr?
|
|
|
|
|
elsif @course
|
|
|
|
|
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
|
|
|
|
|
@boards = @course.boards.includes(:last_message => :author).all
|
|
|
|
|
@boards = [] << @boards[0] if @boards.any?
|
|
|
|
|
if @boards.size == 1
|
|
|
|
@ -46,6 +47,10 @@ class BoardsController < ApplicationController
|
|
|
|
|
show and return
|
|
|
|
|
end
|
|
|
|
|
render :layout => 'base_courses'
|
|
|
|
|
else
|
|
|
|
|
render_403
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|