summaryrefslogtreecommitdiffstats
path: root/app/helpers/attachments_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-07 13:48:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-07 13:48:07 +0000
commita0c495b953b84d90f5c87f089eaefbf310b9dfeb (patch)
tree80206825ef5f1674b9330aa2688e3bb0d3c48f24 /app/helpers/attachments_helper.rb
parentb0bd50620195b19dcc1b7f2f82de73fceaa13692 (diff)
downloadredmine-a0c495b953b84d90f5c87f089eaefbf310b9dfeb.tar.gz
redmine-a0c495b953b84d90f5c87f089eaefbf310b9dfeb.zip
Displays thumbnails of attached images of the issue view (#1006).
This behaviour can be turned on/off in Settings -> Display (off by default). Thumbnail size can be configured there too. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9933 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/attachments_helper.rb')
-rw-r--r--app/helpers/attachments_helper.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/helpers/attachments_helper.rb b/app/helpers/attachments_helper.rb
index 73cbaf01d..7b7bdf5da 100644
--- a/app/helpers/attachments_helper.rb
+++ b/app/helpers/attachments_helper.rb
@@ -21,12 +21,14 @@ module AttachmentsHelper
# Displays view/delete links to the attachments of the given object
# Options:
# :author -- author names are not displayed if set to false
+ # :thumbails -- display thumbnails if enabled in settings
def link_to_attachments(container, options = {})
- options.assert_valid_keys(:author)
+ options.assert_valid_keys(:author, :thumbnails)
if container.attachments.any?
options = {:deletable => container.attachments_deletable?, :author => true}.merge(options)
- render :partial => 'attachments/links', :locals => {:attachments => container.attachments, :options => options}
+ render :partial => 'attachments/links',
+ :locals => {:attachments => container.attachments, :options => options, :thumbnails => (options[:thumbnails] && Setting.thumbnails_enabled?)}
end
end