attachment download support project package

project_pack
p31729568 6 years ago
parent 7c92a28494
commit 17b50cbb97

@ -895,6 +895,8 @@ class AttachmentsController < ApplicationController
@school = @attachment.container @school = @attachment.container
elsif @attachment.container_type == 'Library' elsif @attachment.container_type == 'Library'
@library = @attachment.container @library = @attachment.container
elsif @attachment.container_type == 'ProjectPackage'
@package = @attachment.container
else else
unless @attachment.container_type == 'Syllabus' || @attachment.container_type == 'Bid' || @attachment.container_type == 'Organization' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type == 'StudentWorksScore' || @attachment.container_type == 'StudentWork' || @attachment.container_type == 'Work'|| @attachment.container_type == 'ContestantWork'|| @attachment.container_type == 'Contest' || @attachment.container_type == 'HomeworkBank' || @attachment.container_type == 'Exercise' || @attachment.container_type == 'ExerciseBank' || @attachment.container_type == 'Career' || @attachment.container_type == 'EcTemplate' unless @attachment.container_type == 'Syllabus' || @attachment.container_type == 'Bid' || @attachment.container_type == 'Organization' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type == 'StudentWorksScore' || @attachment.container_type == 'StudentWork' || @attachment.container_type == 'Work'|| @attachment.container_type == 'ContestantWork'|| @attachment.container_type == 'Contest' || @attachment.container_type == 'HomeworkBank' || @attachment.container_type == 'Exercise' || @attachment.container_type == 'ExerciseBank' || @attachment.container_type == 'Career' || @attachment.container_type == 'EcTemplate'
@project = @attachment.project @project = @attachment.project

@ -4375,6 +4375,8 @@ module ApplicationHelper
candown = User.current.member_of_course?(attachment.container.courses.first) || (course.is_public == 1 && attachment.is_public == 1) candown = User.current.member_of_course?(attachment.container.courses.first) || (course.is_public == 1 && attachment.is_public == 1)
elsif attachment.container_type == "Library" #教学案例允许下载 elsif attachment.container_type == "Library" #教学案例允许下载
candown = true candown = true
elsif attachment.container_type == "ProjectPackage" #教学案例允许下载
candown = true
else else
candown = (attachment.is_public == 1 || attachment.is_public == true) candown = (attachment.is_public == 1 || attachment.is_public == true)
end end

Loading…
Cancel
Save