Check convert available by thumbnails #1357
This commit is contained in:
parent
6cba2f81b7
commit
e0f1b4cc54
@ -488,6 +488,10 @@ class DmsfFile < ActiveRecord::Base
|
||||
(image? || pdf? || video? || html?) ? 'inline' : 'attachment'
|
||||
end
|
||||
|
||||
def thumbnailable?
|
||||
image? && Redmine::Thumbnail.convert_available?
|
||||
end
|
||||
|
||||
def preview(limit)
|
||||
result = +'No preview available'
|
||||
if text?
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
<% # Thumbnails %>
|
||||
<% if defined?(thumbnails) && thumbnails %>
|
||||
<% images = links.map{ |x| x[0] }.select(&:image?) %>
|
||||
<% images = links.map{ |x| x[0] }.select(&:thumbnailable?) %>
|
||||
<% if images.any? %>
|
||||
<% if link_to # Redmine classic %>
|
||||
<div class="thumbnails">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user