From 2d698968972bd058b459e3750478df2071d13813 Mon Sep 17 00:00:00 2001 From: zmagod Date: Tue, 9 May 2017 13:59:59 +0200 Subject: [PATCH] fixes pdf export and image size [fixes SCI-1247] --- app/helpers/tiny_mce_helper.rb | 4 +++- app/models/tiny_mce_asset.rb | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/helpers/tiny_mce_helper.rb b/app/helpers/tiny_mce_helper.rb index 73d76cadf..0b9da187e 100644 --- a/app/helpers/tiny_mce_helper.rb +++ b/app/helpers/tiny_mce_helper.rb @@ -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 diff --git a/app/models/tiny_mce_asset.rb b/app/models/tiny_mce_asset.rb index 6898c1ea5..b38004a11 100644 --- a/app/models/tiny_mce_asset.rb +++ b/app/models/tiny_mce_asset.rb @@ -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