youlei 发表于 2012-10-10 20:21:56

Redmine:自动预览附件图片

在{BitNami Redmine Stack}\apps\redmine\htdocs\app\views\attachments\_links.html.erb 的最后面增加以下内容即可:


<% images = attachments.select { |a| a.image? } %>

<% unless images.empty? %>
<div class='images'>
<% images.each do |attachment| %>
<%= link_to image_tag(url_for({:controller => 'attachments', :action => 'show', :id => attachment, :filename => attachment.filename })),
{:controller => 'attachments', :action => 'show', :id => attachment, :filename => attachment.filename }, :class => 'lightbox', :rel => 'attachments', :title => "#{attachment.filename}#{ ('-' + attachment.description) unless attachment.description.blank? }" %>
<% end -%>
</div>
<% end -%>


页: [1]
查看完整版本: Redmine:自动预览附件图片