diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-07-05 10:13:08 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-07-05 10:13:08 +0000 |
commit | b12be8025d18156cca165e180862a8ebc9c89ada (patch) | |
tree | 9e5f4695170872b362ed8a140c3ed5ed5fe72edd /lib | |
parent | 7a59c03e3083cea287e234d93a9236e1d2894e93 (diff) | |
download | redmine-b12be8025d18156cca165e180862a8ebc9c89ada.tar.gz redmine-b12be8025d18156cca165e180862a8ebc9c89ada.zip |
Include host in macro generated thumbnails urls (#16989).
git-svn-id: http://svn.redmine.org/redmine/trunk@13218 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/wiki_formatting/macros.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/redmine/wiki_formatting/macros.rb b/lib/redmine/wiki_formatting/macros.rb index 731c1bc00..d3a728963 100644 --- a/lib/redmine/wiki_formatting/macros.rb +++ b/lib/redmine/wiki_formatting/macros.rb @@ -236,8 +236,11 @@ module Redmine size = nil unless size > 0 if obj && obj.respond_to?(:attachments) && attachment = Attachment.latest_attach(obj.attachments, filename) title = options[:title] || attachment.title - img = image_tag(url_for(:controller => 'attachments', :action => 'thumbnail', :id => attachment, :size => size), :alt => attachment.filename) - link_to(img, url_for(:controller => 'attachments', :action => 'show', :id => attachment), :class => 'thumbnail', :title => title) + thumbnail_url = url_for(:controller => 'attachments', :action => 'thumbnail', :id => attachment, :size => size, :only_path => false) + image_url = url_for(:controller => 'attachments', :action => 'show', :id => attachment, :only_path => false) + + img = image_tag(thumbnail_url, :alt => attachment.filename) + link_to(img, image_url, :class => 'thumbnail', :title => title) else raise "Attachment #{filename} not found" end |