mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-29 03:01:58 +08:00
Clear code and add missed I18n translation
This commit is contained in:
parent
99b52e5d80
commit
8145a292fd
3 changed files with 4 additions and 13 deletions
|
@ -178,7 +178,7 @@ class AssetsController < ApplicationController
|
|||
|
||||
def destroy
|
||||
if @asset.destroy
|
||||
render json: { flash: 'File deleted' }
|
||||
render json: { flash: I18n.t("assets.file_deleted", file_name: @asset.file_name ) }
|
||||
else
|
||||
render json: {}, status: :unprocessable_entity
|
||||
end
|
||||
|
|
|
@ -1,17 +1,7 @@
|
|||
<%
|
||||
gallery_view_id = nil unless defined? gallery_view_id
|
||||
|
||||
unless defined? deletable
|
||||
deletable = if asset.step.present?
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
unless defined? editable
|
||||
editable = true
|
||||
end
|
||||
deletable = true if asset.step.present?
|
||||
editable = true
|
||||
|
||||
partial_locals = {
|
||||
asset: asset,
|
||||
|
|
|
@ -2088,6 +2088,7 @@ en:
|
|||
task_completed: "%{user} completed task %{module}. %{date} | Project: %{project} | Experiment: %{experiment}"
|
||||
|
||||
assets:
|
||||
file_deleted: "File \"%{file_name}\" deleted"
|
||||
head_title:
|
||||
edit: "SciNote | %{file_name} | Edit"
|
||||
view: "SciNote | %{file_name} | View"
|
||||
|
|
Loading…
Reference in a new issue