diff --git a/app/controllers/assets_controller.rb b/app/controllers/assets_controller.rb index ff2df9844..a6259e650 100644 --- a/app/controllers/assets_controller.rb +++ b/app/controllers/assets_controller.rb @@ -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 diff --git a/app/views/assets/_asset.html.erb b/app/views/assets/_asset.html.erb index 9d9b1de43..08be9a957 100644 --- a/app/views/assets/_asset.html.erb +++ b/app/views/assets/_asset.html.erb @@ -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, diff --git a/config/locales/en.yml b/config/locales/en.yml index 089fb14d0..91ae4b39c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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"