diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-24 17:20:30 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-24 17:20:30 +0200 |
| commit | 0d2a8e4b61f4b79507519c73f127b7ab883d853c (patch) | |
| tree | d01e5b323be317d62a7e1bc14b997a9e81e4b462 | |
| parent | 5f26394947d1150e2656bb22c5858ae5edcdcac7 (diff) | |
Render the otp verbs properly in the action log
| -rw-r--r-- | app/helpers/node_actions_helper.rb | 24 | ||||
| -rw-r--r-- | config/locales/de.yml | 3 | ||||
| -rw-r--r-- | config/locales/en.yml | 3 |
3 files changed, 29 insertions, 1 deletions
diff --git a/app/helpers/node_actions_helper.rb b/app/helpers/node_actions_helper.rb index a4d13d22..4cbe741c 100644 --- a/app/helpers/node_actions_helper.rb +++ b/app/helpers/node_actions_helper.rb | |||
| @@ -15,7 +15,10 @@ module NodeActionsHelper | |||
| 15 | "destroy_draft" => "eraser", | 15 | "destroy_draft" => "eraser", |
| 16 | "asset_create" => "upload", | 16 | "asset_create" => "upload", |
| 17 | "asset_attach" => "paperclip", | 17 | "asset_attach" => "paperclip", |
| 18 | "asset_destroy" => "file-x" | 18 | "asset_destroy" => "file-x", |
| 19 | "otp_enroll" => "shield-lock", | ||
| 20 | "otp_disable" => "shield-off", | ||
| 21 | "otp_reset" => "shield-x" | ||
| 19 | }.freeze | 22 | }.freeze |
| 20 | 23 | ||
| 21 | def verb_icon action | 24 | def verb_icon action |
| @@ -174,6 +177,12 @@ module NodeActionsHelper | |||
| 174 | }, ", ") | 177 | }, ", ") |
| 175 | end | 178 | end |
| 176 | 179 | ||
| 180 | def user_participant_ref action | ||
| 181 | participant = action.action_participants.detect { |p| p.subject_type == "User" }&.subject | ||
| 182 | name = h(action.metadata["target_login"].presence || "unknown") | ||
| 183 | participant ? link_to(name, edit_user_path(participant)) : name | ||
| 184 | end | ||
| 185 | |||
| 177 | def summarize_publish action | 186 | def summarize_publish action |
| 178 | if action.metadata["via"] == "revision" | 187 | if action.metadata["via"] == "revision" |
| 179 | t("node_actions.publish_rollback", | 188 | t("node_actions.publish_rollback", |
| @@ -249,4 +258,17 @@ module NodeActionsHelper | |||
| 249 | :paths => h(Array(m["headline_removed_from"]).join(", "))) if m["headline_removed_from"].present? | 258 | :paths => h(Array(m["headline_removed_from"]).join(", "))) if m["headline_removed_from"].present? |
| 250 | safe_join(parts, " ") | 259 | safe_join(parts, " ") |
| 251 | end | 260 | end |
| 261 | |||
| 262 | def summarize_otp_enroll action | ||
| 263 | t("node_actions.otp_enroll", :actor => actor_ref(action)).html_safe | ||
| 264 | end | ||
| 265 | |||
| 266 | def summarize_otp_disable action | ||
| 267 | t("node_actions.otp_disable", :actor => actor_ref(action)).html_safe | ||
| 268 | end | ||
| 269 | |||
| 270 | def summarize_otp_reset action | ||
| 271 | t("node_actions.otp_reset", :actor => actor_ref(action), | ||
| 272 | :target => user_participant_ref(action)).html_safe | ||
| 273 | end | ||
| 252 | end | 274 | end |
diff --git a/config/locales/de.yml b/config/locales/de.yml index 7ffa0a59..ae955aa6 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml | |||
| @@ -127,6 +127,9 @@ de: | |||
| 127 | detail_assets_added: "Anhänge hinzugefügt: %{names}" | 127 | detail_assets_added: "Anhänge hinzugefügt: %{names}" |
| 128 | detail_assets_removed: "Anhänge entfernt: %{names}" | 128 | detail_assets_removed: "Anhänge entfernt: %{names}" |
| 129 | assets_reordered: "Anhänge umsortiert" | 129 | assets_reordered: "Anhänge umsortiert" |
| 130 | otp_enroll: "%{actor} hat einen zweiten Faktor eingerichtet" | ||
| 131 | otp_disable: "%{actor} hat den zweiten Faktor entfernt" | ||
| 132 | otp_reset: "%{actor} hat den zweiten Faktor von %{target} zurückgesetzt" | ||
| 130 | 133 | ||
| 131 | open_gallery: "Gallerie anzeigen" | 134 | open_gallery: "Gallerie anzeigen" |
| 132 | asset_licenses: | 135 | asset_licenses: |
diff --git a/config/locales/en.yml b/config/locales/en.yml index 732d5cd1..618f5164 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml | |||
| @@ -79,6 +79,9 @@ en: | |||
| 79 | detail_assets_added: "Attachments added: %{names}" | 79 | detail_assets_added: "Attachments added: %{names}" |
| 80 | detail_assets_removed: "Attachments removed: %{names}" | 80 | detail_assets_removed: "Attachments removed: %{names}" |
| 81 | assets_reordered: "Attachments reordered" | 81 | assets_reordered: "Attachments reordered" |
| 82 | otp_enroll: "%{actor} set up a second factor" | ||
| 83 | otp_disable: "%{actor} removed their second factor" | ||
| 84 | otp_reset: "%{actor} reset the second factor of %{target}" | ||
| 82 | 85 | ||
| 83 | open_gallery: "Open gallery" | 86 | open_gallery: "Open gallery" |
| 84 | asset_licenses: | 87 | asset_licenses: |
