added auto scaling inline image functionality

This commit is contained in:
Christian Franke 2016-02-16 22:39:36 +01:00
parent 8955ac1b37
commit 5f01cbb178

View File

@ -181,7 +181,11 @@ Redmine::Plugin.register :redmine_dmsf do
end
raise 'Not supported image format' unless file.image?
url = url_for(:controller => :dmsf_files, :action => 'view', :id => file)
if size.include? "%"
image_tag(url, :alt => file.title, :width => size, :height => size)
else
image_tag(url, :alt => file.title, :size => size)
end
else
raise "Document ID #{file_id} not found"
end