|
|
@ -32,13 +32,17 @@ class BoardsController < ApplicationController
|
|
|
|
#modify by nwb
|
|
|
|
#modify by nwb
|
|
|
|
@flag = params[:flag] || false
|
|
|
|
@flag = params[:flag] || false
|
|
|
|
if @project
|
|
|
|
if @project
|
|
|
|
@boards = @project.boards.includes(:last_message => :author).all
|
|
|
|
if !@project.is_public? && !User.current.member_of?(@project) && !User.current.admin?
|
|
|
|
@boards = [] << @boards[0] if @boards.any?
|
|
|
|
render_403
|
|
|
|
if @boards.size == 1
|
|
|
|
else
|
|
|
|
@board = @boards.first
|
|
|
|
@boards = @project.boards.includes(:last_message => :author).all
|
|
|
|
show and return
|
|
|
|
@boards = [] << @boards[0] if @boards.any?
|
|
|
|
|
|
|
|
if @boards.size == 1
|
|
|
|
|
|
|
|
@board = @boards.first
|
|
|
|
|
|
|
|
show and return
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
render :layout => false if request.xhr?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
render :layout => false if request.xhr?
|
|
|
|
|
|
|
|
elsif @course
|
|
|
|
elsif @course
|
|
|
|
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@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 = @course.boards.includes(:last_message => :author).all
|
|
|
|