Clear code and add missed I18n translation

This commit is contained in:
aignatov-bio 2020-11-05 10:03:15 +01:00
parent 99b52e5d80
commit 8145a292fd
3 changed files with 4 additions and 13 deletions

View file

@ -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

View file

@ -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,

View file

@ -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"