mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-15 05:34:53 +08:00
Merge pull request #8002 from artoscinote/ma_SCI_11041
Enable file editing for inventory files [SCI-11041]
This commit is contained in:
commit
2af9ab7f5d
1 changed files with 1 additions and 2 deletions
|
@ -22,12 +22,11 @@ class AssetsController < ApplicationController
|
||||||
before_action :check_restore_permission, only: :restore_version
|
before_action :check_restore_permission, only: :restore_version
|
||||||
|
|
||||||
def file_preview
|
def file_preview
|
||||||
editable = can_manage_asset?(@asset) && @asset.repository_asset_value.blank?
|
|
||||||
render json: { html: render_to_string(
|
render json: { html: render_to_string(
|
||||||
partial: 'shared/file_preview/content',
|
partial: 'shared/file_preview/content',
|
||||||
locals: {
|
locals: {
|
||||||
asset: @asset,
|
asset: @asset,
|
||||||
can_edit: editable,
|
can_edit: can_manage_asset?(@asset),
|
||||||
gallery: params[:gallery],
|
gallery: params[:gallery],
|
||||||
preview: params[:preview]
|
preview: params[:preview]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue