Open HELM files in bio eddie [SCI-5890] (#3442)

This commit is contained in:
aignatov-bio 2021-07-20 13:06:47 +02:00 committed by GitHub
parent 53456988ba
commit 4de35c983a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -236,6 +236,10 @@ class Asset < ApplicationRecord
file.metadata[:asset_type] == 'marvinjs'
end
def bio_eddie?
file.metadata[:asset_type] == 'bio_eddie' || File.extname(file_name) == '.helm'
end
def pdf_preview_ready?
return false if pdf_preview_processing

View file

@ -21,13 +21,14 @@
<span class="fas fa-pencil-alt"></span>
<%= t('assets.file_preview.edit_in_marvinjs') %>
</button>
<% elsif asset.file.metadata[:asset_type] == 'bio_eddie' && BioEddieService.enabled?(current_user) %>
<% elsif asset.bio_eddie? && BioEddieService.enabled?(current_user) %>
<button class="btn btn-light bio-eddie-edit-button"
data-molecule-id="<%= asset.id %>"
data-update-url="<%= bio_eddie_asset_path(asset) %>"
data-edit-url="<%= start_editing_bio_eddie_asset_path(asset) %>"
data-molecule-name="<%= asset.file.metadata[:name] %>"
data-molecule-description="<%= asset.file.metadata[:description] %>"
data-molecule-name="<%= asset.file.metadata[:name] || asset.file_name %>"
data-molecule-description="<%= asset.file.metadata[:description] || asset.file.download %>"
>
<span class="fas fa-pencil-alt"></span>
<%= t('assets.file_preview.edit_in_bio_eddie') %>