This commit is contained in:
huang 2015-03-20 17:44:15 +08:00
commit 10518afa84
2 changed files with 9 additions and 2 deletions

View File

@ -14,9 +14,10 @@
</p> </p>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="for_img_thumbnails">
<% curse_attachments.each do |file| %> <% curse_attachments.each do |file| %>
<div class="re_con_box"> <div class="re_con_box">
<div class=" "> <div class="">
<%= 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" %> <%= 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 User.current.logged? %>
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %> <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
@ -50,6 +51,7 @@
<div class="cl"></div> <div class="cl"></div>
</div><!---re_con_box end--> </div><!---re_con_box end-->
<% end %> <% end %>
</div>
<ul class="wlist"> <ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%> <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul> </ul>

View File

@ -632,7 +632,12 @@ function img_thumbnails() {
if (/\.(jpg|png|gif|bmp|jpeg|PNG|BMP|GIF|JPG|JPEG)$/.test(href_value)) { if (/\.(jpg|png|gif|bmp|jpeg|PNG|BMP|GIF|JPG|JPEG)$/.test(href_value)) {
$(element).colorbox({rel:'nofollow'}); $(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); $(document).ready(img_thumbnails);