From 85a0e96ad6a5e9cff88301564314c2c96c4c36be Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 19 Jul 2017 07:00:27 +0000 Subject: Set a default size for macro thumbnails different from the preview thumbnails. git-svn-id: http://svn.redmine.org/redmine/trunk@16829 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/wiki_formatting/macros.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/redmine/wiki_formatting/macros.rb b/lib/redmine/wiki_formatting/macros.rb index f4700f242..9ef4ffd06 100644 --- a/lib/redmine/wiki_formatting/macros.rb +++ b/lib/redmine/wiki_formatting/macros.rb @@ -229,7 +229,8 @@ module Redmine out end - desc "Displays a clickable thumbnail of an attached image. Examples:\n\n" + + desc "Displays a clickable thumbnail of an attached image.\n" + + "Default size is 200 pixels. Examples:\n\n" + "{{thumbnail(image.png)}}\n" + "{{thumbnail(image.png, size=300, title=Thumbnail)}} -- with custom title and size" macro :thumbnail do |obj, args| @@ -239,7 +240,7 @@ module Redmine size = options[:size] raise 'Invalid size parameter' unless size.nil? || size.match(/^\d+$/) size = size.to_i - size = nil unless size > 0 + size = 200 unless size > 0 if obj && obj.respond_to?(:attachments) && attachment = Attachment.latest_attach(obj.attachments, filename) title = options[:title] || attachment.title thumbnail_url = url_for(:controller => 'attachments', :action => 'thumbnail', :id => attachment, :size => size, :only_path => @only_path) -- cgit v1.2.3