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