diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-18 15:28:30 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-18 15:28:30 +0200 |
| commit | 6b6e50909cc77de1797e88be5445c5b643b008a9 (patch) | |
| tree | 3b72081f0ae4428c1c346c267681115d42e22855 /app | |
| parent | 49de2e14972030a7ef0ca36a94ab55a23a2f3596 (diff) | |
Give action log entries per-verb icons
A muted glyph before each sentence makes both log surfaces
scannable by verb: create, publish, move, trash, restore,
destroy, and the discard pair. Rollback publishes get their own
icon (history) distinct from ordinary promotion. Unknown verbs
fall back to a dashed circle.
Diffstat (limited to 'app')
| -rw-r--r-- | app/helpers/node_actions_helper.rb | 25 | ||||
| -rw-r--r-- | app/views/node_actions/_action_row.html.erb | 1 |
2 files changed, 26 insertions, 0 deletions
diff --git a/app/helpers/node_actions_helper.rb b/app/helpers/node_actions_helper.rb index eb761e3..fd8cc36 100644 --- a/app/helpers/node_actions_helper.rb +++ b/app/helpers/node_actions_helper.rb | |||
| @@ -1,6 +1,31 @@ | |||
| 1 | module NodeActionsHelper | 1 | module NodeActionsHelper |
| 2 | include ERB::Util | 2 | include ERB::Util |
| 3 | 3 | ||
| 4 | # One glyph per verb, rendered before the sentence in _action_row. | ||
| 5 | # Unknown verbs get the dashed circle -- the unknown-verb principle | ||
| 6 | # extended to iconography: the log outlives its vocabulary. | ||
| 7 | VERB_ICONS = { | ||
| 8 | "create" => "file-plus", | ||
| 9 | "publish" => "send", | ||
| 10 | "move" => "arrows-move", | ||
| 11 | "trash" => "trash", | ||
| 12 | "restore_from_trash" => "arrow-back-up", | ||
| 13 | "destroy" => "trash-x", | ||
| 14 | "discard_autosave" => "eraser", | ||
| 15 | "destroy_draft" => "eraser", | ||
| 16 | }.freeze | ||
| 17 | |||
| 18 | def verb_icon action | ||
| 19 | name = if action.action == "publish" && action.metadata["via"] == "revision" | ||
| 20 | "history" | ||
| 21 | else | ||
| 22 | VERB_ICONS.fetch(action.action, "circle-dashed") | ||
| 23 | end | ||
| 24 | content_tag(:span, icon(name, library: "tabler", "aria-hidden": true), | ||
| 25 | :class => "node_action_icon node_action_icon--#{name}", | ||
| 26 | :title => action.action) | ||
| 27 | end | ||
| 28 | |||
| 4 | # One sentence per entry, rendered from metadata alone, so entries | 29 | # One sentence per entry, rendered from metadata alone, so entries |
| 5 | # stay renderable after the rows they reference are gone. Live | 30 | # stay renderable after the rows they reference are gone. Live |
| 6 | # associations only upgrade plain names to links. Every metadata | 31 | # associations only upgrade plain names to links. Every metadata |
diff --git a/app/views/node_actions/_action_row.html.erb b/app/views/node_actions/_action_row.html.erb index 5b5488b..c640f0d 100644 --- a/app/views/node_actions/_action_row.html.erb +++ b/app/views/node_actions/_action_row.html.erb | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | <span class="node_action_clock"><%= action.occurred_at.strftime("%H:%M") %></span> | 4 | <span class="node_action_clock"><%= action.occurred_at.strftime("%H:%M") %></span> |
| 5 | </td> | 5 | </td> |
| 6 | <td class="node_action_body"> | 6 | <td class="node_action_body"> |
| 7 | <%= verb_icon(action) %> | ||
| 7 | <%= action_summary(action) %> | 8 | <%= action_summary(action) %> |
| 8 | <% if action.node_id && params[:node_id].blank? %> | 9 | <% if action.node_id && params[:node_id].blank? %> |
| 9 | <%= link_to t("node_actions.node_history"), admin_log_path(:node_id => action.node_id), :class => "node_action_zoom" %> | 10 | <%= link_to t("node_actions.node_history"), admin_log_path(:node_id => action.node_id), :class => "node_action_zoom" %> |
