Merge pull request #3193 from aignatov-bio/ai-sci-5490-fix-empty-office-files-in-step

Add empty office files placeholder [SCI-5490]
This commit is contained in:
aignatov-bio 2021-03-08 11:36:00 +01:00 committed by GitHub
commit ebc2ca4897
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 1 deletions

View file

@ -223,6 +223,11 @@
margin-left: auto;
}
}
.empty-office-file {
padding: 5em 1em 1em;
text-align: center;
}
}
.list-attachment-container {

View file

@ -25,7 +25,20 @@
<%= render partial: 'assets/asset_context_menu.html.erb', locals: { asset: asset, deletable: deletable, editable: editable } %>
</div>
<% if wopi_enabled? && wopi_file?(asset) %>
<div class="iframe-placeholder" data-iframe-url="<%= asset.get_action_url(current_user, 'embedview') %>"></div>
<% if asset.file_size.positive? %>
<div class="iframe-placeholder" data-iframe-url="<%= asset.get_action_url(current_user, 'embedview') %>"></div>
<% else %>
<div class="empty-office-file">
<h2><%= t('assets.empty_office_file.description') %></h2>
<%= button_to(toggle_view_mode_path(asset),
method: :patch,
remote: true,
class: 'btn btn-primary',
params: { asset: {view_mode: asset.view_mode }}) do %>
<%= t('assets.empty_office_file.reload') %>
<% end %>
</div>
<% end %>
<% elsif asset.pdf_previewable? %>
<%= render partial: 'shared/pdf_viewer.html.erb', locals: { asset: asset } %>
<% elsif asset.previewable? %>

View file

@ -2290,6 +2290,9 @@ en:
description_1_html: "You are about to delete <b>%{file_name}</b></p>"
description_2: "Are you sure you want to continue?"
confirm_button: "Delete attachment"
empty_office_file:
description: "The file is empty. Please add some data before saving the file."
reload: "Reload file"
atwho:
no_results: