diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-23 12:24:52 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-23 12:24:52 +0200 |
| commit | 932d4a4be40587fa6d489eca16a1ef6d6f2936d1 (patch) | |
| tree | a7512889db54347845ce8f72e5a2155d917b4500 /app/helpers | |
| parent | 6ef98ad444631b1d5ba67bb16aaaa2afdfa53ae0 (diff) | |
Witness asset uploads and out-of-band attaches in the action log
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/node_actions_helper.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/helpers/node_actions_helper.rb b/app/helpers/node_actions_helper.rb index 02d1ba83..ed8d0407 100644 --- a/app/helpers/node_actions_helper.rb +++ b/app/helpers/node_actions_helper.rb | |||
| @@ -13,6 +13,9 @@ module NodeActionsHelper | |||
| 13 | "destroy" => "trash-x", | 13 | "destroy" => "trash-x", |
| 14 | "discard_autosave" => "eraser", | 14 | "discard_autosave" => "eraser", |
| 15 | "destroy_draft" => "eraser", | 15 | "destroy_draft" => "eraser", |
| 16 | "asset_create" => "upload", | ||
| 17 | "asset_attach" => "paperclip", | ||
| 18 | "asset_destroy" => "file-x" | ||
| 16 | }.freeze | 19 | }.freeze |
| 17 | 20 | ||
| 18 | def verb_icon action | 21 | def verb_icon action |
| @@ -181,6 +184,18 @@ module NodeActionsHelper | |||
| 181 | :path => h(action.metadata["path"])).html_safe | 184 | :path => h(action.metadata["path"])).html_safe |
| 182 | end | 185 | end |
| 183 | 186 | ||
| 187 | def summarize_asset_create action | ||
| 188 | t("node_actions.asset_create", :actor => actor_ref(action), | ||
| 189 | :asset => h(action.metadata["asset_name"].presence || action.metadata["path"])).html_safe | ||
| 190 | end | ||
| 191 | |||
| 192 | def summarize_asset_attach action | ||
| 193 | m = action.metadata | ||
| 194 | key = m["headline"] ? "node_actions.asset_attach_headline" : "node_actions.asset_attach" | ||
| 195 | t(key, :actor => actor_ref(action), :subject => subject_ref(action), | ||
| 196 | :asset => h(m["asset_name"].presence || m["path"])).html_safe | ||
| 197 | end | ||
| 198 | |||
| 184 | def summarize_asset_destroy action | 199 | def summarize_asset_destroy action |
| 185 | m = action.metadata | 200 | m = action.metadata |
| 186 | parts = [t("node_actions.asset_destroy", :actor => actor_ref(action), | 201 | parts = [t("node_actions.asset_destroy", :actor => actor_ref(action), |
