diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-15 01:10:17 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-15 01:10:17 +0200 |
| commit | 28a6999b55cbec555696df848d6e924aae3166ee (patch) | |
| tree | c93467bbaa23479727291fd5c37f9dcbbfc8b2fe | |
| parent | 32987915b21590a096ebd7a5239001c5969f8760 (diff) | |
Make the recent-changes page match the widget it links from
nodes/recent rendered the generic node-listing partial (id,
actions, current lock owner, revision number) -- nothing
resembling what 'See all recent changes' actually promised to
show more of. Both surfaces now render the same extracted
partial, so they can't tell two different stories again.
Also: head.editor correctly identifies who last wrote the content
sitting in head, but publish_draft! never touches editor at all
-- nobody has ever had the specific act of publishing recorded
anywhere. 'Published by X' was a claim the data never supported,
only incidentally true when the same person who drafted something
also happened to publish it. Relabeled to 'last edited by' -- same
data, accurately described. A real publish-actor is separate,
future work, once the action log exists.
Basic list styling added for the full page, which had never
rendered outside the widget's own compact five-line context
before.
| -rw-r--r-- | app/views/admin/index.html.erb | 12 | ||||
| -rw-r--r-- | app/views/nodes/_recent_change_item.html.erb | 9 | ||||
| -rw-r--r-- | app/views/nodes/recent.html.erb | 6 | ||||
| -rw-r--r-- | config/locales/de.yml | 2 | ||||
| -rw-r--r-- | config/locales/en.yml | 2 | ||||
| -rw-r--r-- | public/stylesheets/admin.css | 19 |
6 files changed, 38 insertions, 12 deletions
diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb index bdb555e..a9c0512 100644 --- a/app/views/admin/index.html.erb +++ b/app/views/admin/index.html.erb | |||
| @@ -43,17 +43,7 @@ | |||
| 43 | <div class="dashboard_widget"> | 43 | <div class="dashboard_widget"> |
| 44 | <h3>Recent changes</h3> | 44 | <h3>Recent changes</h3> |
| 45 | <ul> | 45 | <ul> |
| 46 | <% @recent_changes.each do |node| %> | 46 | <%= render partial: "nodes/recent_change_item", collection: @recent_changes, as: :node %> |
| 47 | <li> | ||
| 48 | <div> | ||
| 49 | <%= link_to title_for_node(node), node_path(node) %> | ||
| 50 | <span class="field_hint"><%= link_to_path("#{node.unique_name} ↗", node.unique_name) %></span> | ||
| 51 | </div> | ||
| 52 | <span class="dashboard_widget_meta"> | ||
| 53 | <%= (editor = node_head_editor(node)) ? t("published_by", editor: editor) : t("published") %>, <%= relative_time_phrase(node.head.updated_at) %> | ||
| 54 | </span> | ||
| 55 | </li> | ||
| 56 | <% end %> | ||
| 57 | </ul> | 47 | </ul> |
| 58 | <%= link_to "See all recent changes →", recent_nodes_path %> | 48 | <%= link_to "See all recent changes →", recent_nodes_path %> |
| 59 | </div> | 49 | </div> |
diff --git a/app/views/nodes/_recent_change_item.html.erb b/app/views/nodes/_recent_change_item.html.erb new file mode 100644 index 0000000..754a775 --- /dev/null +++ b/app/views/nodes/_recent_change_item.html.erb | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | <li> | ||
| 2 | <div> | ||
| 3 | <%= link_to title_for_node(node), node_path(node) %> | ||
| 4 | <span class="field_hint"><%= link_to_path("#{node.unique_name} ↗", node.unique_name) %></span> | ||
| 5 | </div> | ||
| 6 | <span class="dashboard_widget_meta"> | ||
| 7 | <%= (editor = node_head_editor(node)) ? t("last_edited_by", editor: editor) : t("last_edited") %>, <%= relative_time_phrase(node.head.updated_at) %> | ||
| 8 | </span> | ||
| 9 | </li> | ||
diff --git a/app/views/nodes/recent.html.erb b/app/views/nodes/recent.html.erb index 3602775..d256253 100644 --- a/app/views/nodes/recent.html.erb +++ b/app/views/nodes/recent.html.erb | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | <h1>Recently changed</h1> | 1 | <h1>Recently changed</h1> |
| 2 | 2 | ||
| 3 | <%= render 'node_list' %> | 3 | <%= will_paginate @nodes %> |
| 4 | <ul id="recent_changes_full_list"> | ||
| 5 | <%= render partial: "nodes/recent_change_item", collection: @nodes, as: :node %> | ||
| 6 | </ul> | ||
| 7 | <%= will_paginate @nodes %> | ||
diff --git a/config/locales/de.yml b/config/locales/de.yml index 550ccb3..74cd183 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml | |||
| @@ -16,6 +16,8 @@ de: | |||
| 16 | open_today: "Das Chaos, lokal und heute offen" | 16 | open_today: "Das Chaos, lokal und heute offen" |
| 17 | published: "veröffentlicht" | 17 | published: "veröffentlicht" |
| 18 | published_by: "veröffentlicht durch %{editor}" | 18 | published_by: "veröffentlicht durch %{editor}" |
| 19 | last_edited: "zuletzt bearbeitet" | ||
| 20 | last_edited_by: "zuletzt bearbeitet durch %{editor}" | ||
| 19 | editor_self: "du" | 21 | editor_self: "du" |
| 20 | publisher_self: "dich" | 22 | publisher_self: "dich" |
| 21 | date: | 23 | date: |
diff --git a/config/locales/en.yml b/config/locales/en.yml index 73271ed..c52280d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml | |||
| @@ -17,6 +17,8 @@ en: | |||
| 17 | open_today: "Open today" | 17 | open_today: "Open today" |
| 18 | published: "published" | 18 | published: "published" |
| 19 | published_by: "published by %{editor}" | 19 | published_by: "published by %{editor}" |
| 20 | last_edited: "last edited" | ||
| 21 | last_edited_by: "last edited by %{editor}" | ||
| 20 | publisher_self: "you" | 22 | publisher_self: "you" |
| 21 | editor_self: "you" | 23 | editor_self: "you" |
| 22 | 24 | ||
diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index b5b8707..5f0b165 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css | |||
| @@ -1121,6 +1121,25 @@ div#draft_list table td.actions a { | |||
| 1121 | font-size: 0.9em; | 1121 | font-size: 0.9em; |
| 1122 | } | 1122 | } |
| 1123 | 1123 | ||
| 1124 | #recent_changes_full_list { | ||
| 1125 | list-style: none; | ||
| 1126 | padding: 0; | ||
| 1127 | margin: 0; | ||
| 1128 | } | ||
| 1129 | |||
| 1130 | #recent_changes_full_list li { | ||
| 1131 | padding: 0.75rem 0; | ||
| 1132 | border-bottom: 1px solid #eee; | ||
| 1133 | } | ||
| 1134 | |||
| 1135 | #recent_changes_full_list li:last-child { | ||
| 1136 | border-bottom: none; | ||
| 1137 | } | ||
| 1138 | |||
| 1139 | #recent_changes_full_list li > div { | ||
| 1140 | margin-bottom: 0.25rem; | ||
| 1141 | } | ||
| 1142 | |||
| 1124 | /* ============================================================ | 1143 | /* ============================================================ |
| 1125 | Search widgets | 1144 | Search widgets |
| 1126 | ============================================================ */ | 1145 | ============================================================ */ |
