summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-26 11:26:24 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-26 11:26:24 +0000
commit12890945e527c2803ad5a85ca4afbe1017c34025 (patch)
tree92d49a3a9ec3d13eb520d2b2ee354e55c374f773 /app/helpers
parent0e58ee44ebec53a3ed3319f50b2808b4b48c96b3 (diff)
downloadredmine-12890945e527c2803ad5a85ca4afbe1017c34025.tar.gz
redmine-12890945e527c2803ad5a85ca4afbe1017c34025.zip
Allow attachment thumbnails from REST API (#18707).
git-svn-id: http://svn.redmine.org/redmine/trunk@13806 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/attachments_helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/helpers/attachments_helper.rb b/app/helpers/attachments_helper.rb
index 387ed99d7..ed362e2e8 100644
--- a/app/helpers/attachments_helper.rb
+++ b/app/helpers/attachments_helper.rb
@@ -54,6 +54,10 @@ module AttachmentsHelper
api.content_type attachment.content_type
api.description attachment.description
api.content_url download_named_attachment_url(attachment, attachment.filename)
+ if attachment.thumbnailable?
+ api.thumbnail_url thumbnail_url(attachment)
+ end
+ api.content_url download_named_attachment_url(attachment, attachment.filename)
api.author(:id => attachment.author.id, :name => attachment.author.name) if attachment.author
api.created_on attachment.created_on
end