diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index 9a0a1127f..4f3f401c9 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -44,10 +44,10 @@ module FilesHelper File.new(zipfile_name,'w+') end - def courses_check_box_tags(name,courses,current_course) + def courses_check_box_tags(name,courses,current_course,attachment) s = '' courses.each do |course| - if course.id != current_course.id && is_course_teacher(User.current,course) + if !(attachment.container_type && attachment.container_id == course.id) && is_course_teacher(User.current,course) s << "
" end end diff --git a/app/views/files/_show_quote_resource.html.erb b/app/views/files/_show_quote_resource.html.erb index 8041802a5..ef907f40f 100644 --- a/app/views/files/_show_quote_resource.html.erb +++ b/app/views/files/_show_quote_resource.html.erb @@ -8,7 +8,7 @@ remote: true, id: "relation_file_form" do %> <%= hidden_field_tag(:file_id, file.id) %> - <%= content_tag('div', courses_check_box_tags('courses[course][]', User.current.courses,course), :id => 'courses')%> + <%= content_tag('div', courses_check_box_tags('courses[course][]', User.current.courses,course,file), :id => 'courses')%> 引  用取  消 <% end -%>