mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-03 19:24:48 +08:00
adds file link
This commit is contained in:
parent
52878e0989
commit
95a0f596b7
2 changed files with 12 additions and 5 deletions
|
@ -34,8 +34,8 @@ function setupAssetsLoading() {
|
|||
data['preview-url'] + "'><p>" +
|
||||
data.filename + '</p></a>'
|
||||
);
|
||||
} else if(data.type === "wopi") {
|
||||
if(data['wopi-edit']) {
|
||||
} else if (data.type === 'wopi') {
|
||||
if (data['wopi-edit']) {
|
||||
wopiBtns = data['wopi-file-name'] +
|
||||
data['wopi-view'] +
|
||||
data['wopi-edit'];
|
||||
|
|
|
@ -54,9 +54,16 @@ module WopiHelper
|
|||
def wopi_asset_file_name(asset)
|
||||
html = '<p style="display: inline-block">'
|
||||
html += "#{file_extension_icon(asset)} "
|
||||
html += truncate(asset.file_file_name,
|
||||
length: Constants::FILENAME_TRUNCATION_LENGTH)
|
||||
html += link_to download_asset_path(asset),
|
||||
data: { no_turbolink: true,
|
||||
id: true,
|
||||
status: 'asset-present' } do
|
||||
truncate(
|
||||
asset.file_file_name,
|
||||
length: Constants::FILENAME_TRUNCATION_LENGTH
|
||||
)
|
||||
end
|
||||
html += ' </p>'
|
||||
sanitize_input(html, %w(img))
|
||||
sanitize_input(html, %w(img a))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue