diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index c9a232c36..e1aebefdc 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -86,7 +86,7 @@ module FilesHelper def visable_attachemnts attachments result = [] attachments.each do |attachment| - if attachment.is_public? || (attachment.container_type == "Course" && attachment.author.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id + if attachment.is_public? || (attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id result << attachment end end @@ -106,7 +106,7 @@ module FilesHelper def visable_attachemnts_insite attachments,course result = [] attachments.each do |attachment| - if attachment.is_public? || (attachment.container_type == "Course" && attachment.container_id == course.id && attachment.author.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id + if attachment.is_public? || (attachment.container_type == "Course" && attachment.container_id == course.id && User.current.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id result << attachment end end diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 04ce917c8..030b6cb24 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -4,55 +4,60 @@ <%= stylesheet_link_tag 'resource', :media => 'all' %>
-
-
+
+
<%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search f_l",:remote=>true) do %> <%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%> - <%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onclick => "presscss('incourse')"%> - <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onclick => "presscss('insite')" %> + <%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()" %> + <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> <% end %> - <% if is_course_teacher(User.current,@course) %> - 上传资源 - <% end %> -
-
+ <% if is_course_teacher(User.current,@course) %> + 上传资源 + <% end %> +
+
-
-<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@curse_attachments} %> -
+
+ <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@curse_attachments} %> +
-
+
<% html_title(l(:label_attachment_plural)) -%> \ No newline at end of file diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index 186166dc8..ba84abc68 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -189,7 +189,7 @@