调整选入课程弹框中列表的显示策略
This commit is contained in:
parent
1007134ced
commit
2348e063d1
|
@ -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 << "<label>#{ check_box_tag name, course.id, false, :id => nil } #{h course.name}</label><br/>"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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')%>
|
||||
<a id="submit_quote" href="javascript:void(0)" class="upload_btn" onclick="submit_quote();">引 用</a><a href="javascript:void(0)" class="upload_btn upload_btn_grey" onclick="closeModal();">取 消</a>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue