mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-10 23:25:31 +08:00
Open HELM files in bio eddie [SCI-5890] (#3442)
This commit is contained in:
parent
53456988ba
commit
4de35c983a
2 changed files with 8 additions and 3 deletions
|
@ -236,6 +236,10 @@ class Asset < ApplicationRecord
|
||||||
file.metadata[:asset_type] == 'marvinjs'
|
file.metadata[:asset_type] == 'marvinjs'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def bio_eddie?
|
||||||
|
file.metadata[:asset_type] == 'bio_eddie' || File.extname(file_name) == '.helm'
|
||||||
|
end
|
||||||
|
|
||||||
def pdf_preview_ready?
|
def pdf_preview_ready?
|
||||||
return false if pdf_preview_processing
|
return false if pdf_preview_processing
|
||||||
|
|
||||||
|
|
|
@ -21,13 +21,14 @@
|
||||||
<span class="fas fa-pencil-alt"></span>
|
<span class="fas fa-pencil-alt"></span>
|
||||||
<%= t('assets.file_preview.edit_in_marvinjs') %>
|
<%= t('assets.file_preview.edit_in_marvinjs') %>
|
||||||
</button>
|
</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"
|
<button class="btn btn-light bio-eddie-edit-button"
|
||||||
data-molecule-id="<%= asset.id %>"
|
data-molecule-id="<%= asset.id %>"
|
||||||
data-update-url="<%= bio_eddie_asset_path(asset) %>"
|
data-update-url="<%= bio_eddie_asset_path(asset) %>"
|
||||||
data-edit-url="<%= start_editing_bio_eddie_asset_path(asset) %>"
|
data-edit-url="<%= start_editing_bio_eddie_asset_path(asset) %>"
|
||||||
data-molecule-name="<%= asset.file.metadata[:name] %>"
|
data-molecule-name="<%= asset.file.metadata[:name] || asset.file_name %>"
|
||||||
data-molecule-description="<%= asset.file.metadata[:description] %>"
|
data-molecule-description="<%= asset.file.metadata[:description] || asset.file.download %>"
|
||||||
>
|
>
|
||||||
<span class="fas fa-pencil-alt"></span>
|
<span class="fas fa-pencil-alt"></span>
|
||||||
<%= t('assets.file_preview.edit_in_bio_eddie') %>
|
<%= t('assets.file_preview.edit_in_bio_eddie') %>
|
||||||
|
|
Loading…
Add table
Reference in a new issue