mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
fixes pdf export and image size [fixes SCI-1247]
This commit is contained in:
parent
ccc640f2bc
commit
2d69896897
2 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue