|
|
|
@ -57,25 +57,27 @@ module UsersHelper
|
|
|
|
|
def get_resource_origin attach
|
|
|
|
|
type = attach.container_type
|
|
|
|
|
content = attach.container
|
|
|
|
|
case type
|
|
|
|
|
when 'Course'
|
|
|
|
|
result = current_time_and_term_resource content
|
|
|
|
|
when 'Project'
|
|
|
|
|
result = content.name
|
|
|
|
|
when 'Issue'
|
|
|
|
|
result = content.subject
|
|
|
|
|
when 'Message'
|
|
|
|
|
result = content.subject
|
|
|
|
|
when 'News'
|
|
|
|
|
result = content.title
|
|
|
|
|
when 'HomewCommon'
|
|
|
|
|
result = content.name
|
|
|
|
|
when 'StudentWorkScore'
|
|
|
|
|
result = content.name
|
|
|
|
|
when 'Principal'
|
|
|
|
|
result = content.name
|
|
|
|
|
when 'OrgSubfield'
|
|
|
|
|
result = content.name
|
|
|
|
|
unless content.nil?
|
|
|
|
|
case type
|
|
|
|
|
when 'Course'
|
|
|
|
|
result = current_time_and_term_resource content
|
|
|
|
|
when 'Project'
|
|
|
|
|
result = content.name
|
|
|
|
|
when 'Issue'
|
|
|
|
|
result = content.subject
|
|
|
|
|
when 'Message'
|
|
|
|
|
result = content.subject
|
|
|
|
|
when 'News'
|
|
|
|
|
result = content.title
|
|
|
|
|
when 'HomewCommon'
|
|
|
|
|
result = content.name
|
|
|
|
|
when 'StudentWorkScore'
|
|
|
|
|
result = content.name
|
|
|
|
|
when 'Principal'
|
|
|
|
|
result = content.name
|
|
|
|
|
when 'OrgSubfield'
|
|
|
|
|
result = content.name
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|