diff options
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/assets_controller.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/assets_controller.rb b/app/controllers/assets_controller.rb index f8a7d1e4..d86370f4 100644 --- a/app/controllers/assets_controller.rb +++ b/app/controllers/assets_controller.rb | |||
| @@ -111,8 +111,10 @@ class AssetsController < ApplicationController | |||
| 111 | flash[:notice] = | 111 | flash[:notice] = |
| 112 | if result[:attached].zero? | 112 | if result[:attached].zero? |
| 113 | t("flash.assets.already_attached", :title => node.title) | 113 | t("flash.assets.already_attached", :title => node.title) |
| 114 | elsif result[:draft_created] | ||
| 115 | t("flash.assets.attached_new_draft", :title => node.title) | ||
| 114 | else | 116 | else |
| 115 | t("flash.assets.attached", :title => node.title) | 117 | t("flash.assets.attached_to_draft", :title => node.title) |
| 116 | end | 118 | end |
| 117 | case result[:headline] | 119 | case result[:headline] |
| 118 | when :set then flash[:notice] += " " + t("flash.common.now_headline") | 120 | when :set then flash[:notice] += " " + t("flash.common.now_headline") |
| @@ -122,5 +124,8 @@ class AssetsController < ApplicationController | |||
| 122 | rescue LockedByAnotherUser | 124 | rescue LockedByAnotherUser |
| 123 | flash[:locked_by] = node.lock_owner&.login | 125 | flash[:locked_by] = node.lock_owner&.login |
| 124 | flash[:locked_node_path] = node_path(node) | 126 | flash[:locked_node_path] = node_path(node) |
| 127 | rescue ActiveRecord::RecordInvalid => e | ||
| 128 | flash[:error] = e.record.errors.full_messages.to_sentence | ||
| 129 | flash[:resolve_node_path] = node_path(node) | ||
| 125 | end | 130 | end |
| 126 | end | 131 | end |
