|
|
|
@ -63,6 +63,7 @@ module CoursesHelper
|
|
|
|
|
# searchTeacherAndAssistant(project).count
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 统计数目
|
|
|
|
|
def show_nav?(count)
|
|
|
|
|
count == 0 ? true : false
|
|
|
|
|
end
|
|
|
|
@ -807,11 +808,12 @@ module CoursesHelper
|
|
|
|
|
link.html_safe
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 可以查看到资源库的资源
|
|
|
|
|
def visable_attachemnts_incourse course
|
|
|
|
|
return[] unless course
|
|
|
|
|
result = []
|
|
|
|
|
course.attachments.each do |attachment|
|
|
|
|
|
if (attachment.is_public? && attachment.is_publish == 1) ||User.current == attachment.author ||User.current.allowed_to?(:as_teacher,course)|| (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin?
|
|
|
|
|
if attachment.is_public? && attachment.is_publish == 1 || User.current == attachment.author || User.current.allowed_to?(:as_teacher,course) || (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin?
|
|
|
|
|
result << attachment
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|