mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-10 13:59:56 +08:00
Fix missing icon files in exported projects [SCI-9133]
This commit is contained in:
parent
2ad0d3a65f
commit
aa769f92f7
7 changed files with 13 additions and 35 deletions
|
@ -1,17 +0,0 @@
|
||||||
/* global Handsontable */
|
|
||||||
window.onload = function() {
|
|
||||||
var tables = document.getElementsByClassName('hot-table-container');
|
|
||||||
var tableVals = document.getElementsByClassName('hot-table-contents');
|
|
||||||
|
|
||||||
for (let i = 0; i < tables.length; i += 1) {
|
|
||||||
tables[i].innerHTML = '';
|
|
||||||
new Handsontable(tables[i], {
|
|
||||||
data: JSON.parse(tableVals[i].value).data,
|
|
||||||
rowHeaders: true,
|
|
||||||
colHeaders: true,
|
|
||||||
filters: true,
|
|
||||||
dropdownMenu: true,
|
|
||||||
formulas: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -48,11 +48,9 @@ module FileIconsHelper
|
||||||
image_link = Extends::FILE_ICON_MAPPINGS[file_ext] if Extends::FILE_ICON_MAPPINGS[file_ext]
|
image_link = Extends::FILE_ICON_MAPPINGS[file_ext] if Extends::FILE_ICON_MAPPINGS[file_ext]
|
||||||
|
|
||||||
if image_link
|
if image_link
|
||||||
if report
|
image_link = wicked_pdf_asset_base64(image_link) if report
|
||||||
wicked_pdf_image_tag(image_link, class: 'image-icon')
|
|
||||||
else
|
ActionController::Base.helpers.image_tag(image_link, class: 'image-icon')
|
||||||
ActionController::Base.helpers.image_tag(image_link, class: 'image-icon')
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
''
|
''
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require 'csv'
|
require 'csv'
|
||||||
|
require 'vips'
|
||||||
|
|
||||||
class TeamZipExportJob < ZipExportJob
|
class TeamZipExportJob < ZipExportJob
|
||||||
include StringUtility
|
include StringUtility
|
||||||
|
|
|
@ -3,15 +3,15 @@
|
||||||
<% timestamp = asset.created_at %>
|
<% timestamp = asset.created_at %>
|
||||||
<div class="report-element report-result-element report-result-asset-element">
|
<div class="report-element report-result-element report-result-asset-element">
|
||||||
<div class="report-element-header">
|
<div class="report-element-header">
|
||||||
<div class="result-icon">
|
<span class="result-icon">
|
||||||
<%= file_extension_icon_html(asset, true) %>
|
<%= file_extension_icon_html(asset, true) %>
|
||||||
</div>
|
</span>
|
||||||
<div class="result-name">
|
<span class="result-name">
|
||||||
<%= result.name %>
|
<%= result.name %>
|
||||||
<% if result.archived? %>
|
<% if result.archived? %>
|
||||||
<span class="label label-warning"><%= t('search.index.archived') %></span>
|
<span class="label label-warning"><%= t('search.index.archived') %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</span>
|
||||||
<div class="file-name">
|
<div class="file-name">
|
||||||
<% if defined? export_all and export_all %>
|
<% if defined? export_all and export_all %>
|
||||||
<% file_link = @obj_filenames.dig(:assets, asset.id, :file) %>
|
<% file_link = @obj_filenames.dig(:assets, asset.id, :file) %>
|
||||||
|
@ -54,4 +54,4 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
<% timestamp = asset.created_at %>
|
<% timestamp = asset.created_at %>
|
||||||
<div class="report-element report-step-attachment-element report-step-asset-element">
|
<div class="report-element report-step-attachment-element report-step-asset-element">
|
||||||
<div class="report-element-header">
|
<div class="report-element-header">
|
||||||
<div class="pull-left attachment-icon <%= defined?(export_all) && export_all ? 'export-all-icons' : '' %>">
|
<span class="pull-left attachment-icon <%= defined?(export_all) && export_all ? 'export-all-icons' : '' %>">
|
||||||
<%= file_extension_icon_html(asset, true) %>
|
<%= file_extension_icon_html(asset, true) %>
|
||||||
</div>
|
</span>
|
||||||
<div class="pull-left file-name">
|
<span class="pull-left file-name">
|
||||||
<% if defined? export_all and export_all %>
|
<% if defined? export_all and export_all %>
|
||||||
<% file_link = @obj_filenames.dig(:assets, asset.id, :file) %>
|
<% file_link = @obj_filenames.dig(:assets, asset.id, :file) %>
|
||||||
<a href="<%= file_link %>" class="export-all-link">
|
<a href="<%= file_link %>" class="export-all-link">
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
|
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
|
||||||
</em>
|
</em>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</span>
|
||||||
<div class="user-time">
|
<div class="user-time">
|
||||||
<%= t('projects.reports.elements.step_asset.user_time', timestamp: l(timestamp, format: :full)) %>
|
<%= t('projects.reports.elements.step_asset.user_time', timestamp: l(timestamp, format: :full)) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -23,9 +23,6 @@
|
||||||
nonce: true %>
|
nonce: true %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<!-- Init Handsontables -->
|
|
||||||
<%= javascript_include_tag 'team_zip_exports/load_handson' %>
|
|
||||||
|
|
||||||
<title><%= title %></title>
|
<title><%= title %></title>
|
||||||
</head>
|
</head>
|
||||||
<body class='print-report-body'>
|
<body class='print-report-body'>
|
||||||
|
|
|
@ -103,7 +103,6 @@ Rails.application.config.assets.precompile += %w(users/invitations/resource_erro
|
||||||
Rails.application.config.assets.precompile += %w(users/registrations/team_errors.js)
|
Rails.application.config.assets.precompile += %w(users/registrations/team_errors.js)
|
||||||
Rails.application.config.assets.precompile += %w(users/registrations/resource_errors.js)
|
Rails.application.config.assets.precompile += %w(users/registrations/resource_errors.js)
|
||||||
Rails.application.config.assets.precompile += %w(users/registrations/new_with_provider.js)
|
Rails.application.config.assets.precompile += %w(users/registrations/new_with_provider.js)
|
||||||
Rails.application.config.assets.precompile += %w(team_zip_exports/load_handson.js)
|
|
||||||
Rails.application.config.assets.precompile += %w(repository_columns/manage_column_partials/number.js)
|
Rails.application.config.assets.precompile += %w(repository_columns/manage_column_partials/number.js)
|
||||||
Rails.application.config.assets.precompile += %w(repository_columns/manage_column_partials/stock.js)
|
Rails.application.config.assets.precompile += %w(repository_columns/manage_column_partials/stock.js)
|
||||||
Rails.application.config.assets.precompile += %w(shared/file_preview.js)
|
Rails.application.config.assets.precompile += %w(shared/file_preview.js)
|
||||||
|
|
Loading…
Add table
Reference in a new issue