Merge pull request #602 from ZmagoD/zd_SCI_1247

fixes pdf export and image size [fixes SCI-1247]
This commit is contained in:
Zmago Devetak 2017-05-10 09:31:55 +02:00 committed by GitHub
commit 13570ba5cb
2 changed files with 5 additions and 3 deletions

View file

@ -23,7 +23,9 @@ module TinyMceHelper
match = el.match(regex)
img = TinyMceAsset.find_by_id(match[1])
next unless img
image_tag img.url, data: { token: Base62.encode(img.id) }
image_tag img.url,
class: 'img-responsive',
data: { token: Base62.encode(img.id) }
end
end

View file

@ -25,7 +25,7 @@ class TinyMceAsset < ActiveRecord::Base
# When using S3 file upload, we can limit file accessibility with url signing
def presigned_url(style = :large,
download: false,
timeout: Constants::URL_SHORT_EXPIRE_TIME)
timeout: Constants::URL_LONG_EXPIRE_TIME)
if stored_on_s3?
if download
download_arg = 'attachment; filename=' + URI.escape(image_file_name)
@ -46,7 +46,7 @@ class TinyMceAsset < ActiveRecord::Base
image.options[:storage].to_sym == :s3
end
def url(style = :large, timeout: Constants::URL_SHORT_EXPIRE_TIME)
def url(style = :large, timeout: Constants::URL_LONG_EXPIRE_TIME)
if image.is_stored_on_s3?
presigned_url(style, timeout: timeout)
else