项目文档浏览BUG修改
This commit is contained in:
parent
b49344107c
commit
518edeac68
|
@ -70,7 +70,7 @@ class BoardsController < ApplicationController
|
||||||
@message = Message.new(:board => @board)
|
@message = Message.new(:board => @board)
|
||||||
#modify by nwb
|
#modify by nwb
|
||||||
if @project
|
if @project
|
||||||
render :action => 'show', :layout => !request.xhr?
|
render :action => 'show', :layout => 'base_projects'
|
||||||
elsif @course
|
elsif @course
|
||||||
render :action => 'show', :layout => 'base_courses'
|
render :action => 'show', :layout => 'base_courses'
|
||||||
end
|
end
|
||||||
|
|
|
@ -105,7 +105,7 @@ class DocumentsController < ApplicationController
|
||||||
# 权限判断
|
# 权限判断
|
||||||
# add by nwb
|
# add by nwb
|
||||||
def authorize_document
|
def authorize_document
|
||||||
if !(User.current.admin? || User.current.member_of?(@project) || @document.is_public==1)
|
if !(User.current.admin? || User.current.member_of?(@project) || @document == nil || (@document != nil && @document.is_public==1))
|
||||||
render_403 :message => :notice_not_authorized
|
render_403 :message => :notice_not_authorized
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1138,13 +1138,13 @@ class Project < ActiveRecord::Base
|
||||||
# 创建项目后在项目下同步创建一个讨论区
|
# 创建项目后在项目下同步创建一个讨论区
|
||||||
def create_board_sync
|
def create_board_sync
|
||||||
@board = self.boards.build
|
@board = self.boards.build
|
||||||
self.name=" #{l(:label_borad_course) }"
|
self.name=" #{l(:label_borad_project) }"
|
||||||
@board.name = self.name
|
@board.name = self.name
|
||||||
@board.description = self.name.to_s
|
@board.description = self.name.to_s
|
||||||
if @board.save
|
if @board.save
|
||||||
logger.debug "[Course Model] ===> #{@board.to_json}"
|
logger.debug "[Project Model] ===> #{@board.to_json}"
|
||||||
else
|
else
|
||||||
logger.error "[Course Model] ===> Auto create board when Course saved, because #{@board.full_messages}"
|
logger.error "[Project Model] ===> Auto create board when Project saved, because #{@board.full_messages}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue