summaryrefslogtreecommitdiff
path: root/app/helpers/node_actions_helper.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-08-09 03:35:48 +0200
committererdgeist <erdgeist@erdgeist.org>2026-08-09 03:35:48 +0200
commitd16161eab9029a509951146b80334c304c35fd34 (patch)
tree87dd7426389b0e27b31925dc28c76a442eb721b8 /app/helpers/node_actions_helper.rb
parent20c735b0c5a2db9b8984848253ad99332d6211a8 (diff)
Refuse destroying an asset that is still attached
Diffstat (limited to 'app/helpers/node_actions_helper.rb')
-rw-r--r--app/helpers/node_actions_helper.rb17
1 files changed, 2 insertions, 15 deletions
diff --git a/app/helpers/node_actions_helper.rb b/app/helpers/node_actions_helper.rb
index 960e28b3..09de4250 100644
--- a/app/helpers/node_actions_helper.rb
+++ b/app/helpers/node_actions_helper.rb
@@ -330,22 +330,9 @@ module NodeActionsHelper
330 :asset => asset_ref(action)).html_safe 330 :asset => asset_ref(action)).html_safe
331 end 331 end
332 332
333 def summarize_asset_attach action
334 m = action.metadata
335 key = m["headline"] ? "node_actions.asset_attach_headline" : "node_actions.asset_attach"
336 t(key, :actor => actor_ref(action), :subject => subject_ref(action),
337 :asset => asset_ref(action)).html_safe
338 end
339
340 def summarize_asset_destroy action 333 def summarize_asset_destroy action
341 m = action.metadata 334 t("node_actions.asset_destroy", :actor => actor_ref(action),
342 parts = [t("node_actions.asset_destroy", :actor => actor_ref(action), 335 :asset => asset_ref(action)).html_safe
343 :asset => asset_ref(action))]
344 parts << t("node_actions.asset_destroy_detached",
345 :paths => h(Array(m["detached_from"]).join(", "))) if m["detached_from"].present?
346 parts << t("node_actions.asset_destroy_headlines",
347 :paths => h(Array(m["headline_removed_from"]).join(", "))) if m["headline_removed_from"].present?
348 safe_join(parts, " ")
349 end 336 end
350 337
351 def summarize_otp_enroll action 338 def summarize_otp_enroll action