diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index 8af369558..a90d47b5a 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -14,9 +14,10 @@

+
<% curse_attachments.each do |file| %>
-
+
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> <% if User.current.logged? %> <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %> @@ -50,6 +51,7 @@
<% end %> +
diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 18afa7f67..5d2423238 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -632,7 +632,12 @@ function img_thumbnails() { if (/\.(jpg|png|gif|bmp|jpeg|PNG|BMP|GIF|JPG|JPEG)$/.test(href_value)) { $(element).colorbox({rel:'nofollow'}); } - + }); + $('.for_img_thumbnails').find('a').each(function(index, element) { + var href_value = $(element).attr('href'); + if (/\.(jpg|png|gif|bmp|jpeg|PNG|BMP|GIF|JPG|JPEG)$/.test(href_value)) { + $(element).colorbox({rel:'nofollow'}); + } }); } $(document).ready(img_thumbnails);