diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-17 00:42:54 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-17 00:42:54 +0200 |
| commit | c810d1aa93a267dd8fcf8984c5d0b125629efa31 (patch) | |
| tree | b0dc135931390738b8965a47d33ba3b5dd16f251 /app | |
| parent | 855fc9c9c85720b5e0c6b9086083165492e2a864 (diff) | |
Cutover to new Recent Changes widget
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/admin_controller.rb | 1 | ||||
| -rw-r--r-- | app/views/admin/index.html.erb | 25 |
2 files changed, 25 insertions, 1 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 37fd78b..40cfbdc 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb | |||
| @@ -7,6 +7,7 @@ class AdminController < ApplicationController | |||
| 7 | def index | 7 | def index |
| 8 | @drafts = Node.drafts_and_autosaves(current_user_id: current_user.id).limit(5) | 8 | @drafts = Node.drafts_and_autosaves(current_user_id: current_user.id).limit(5) |
| 9 | @recent_changes = Node.recently_changed.limit(5) | 9 | @recent_changes = Node.recently_changed.limit(5) |
| 10 | @actions = NodeAction.order(:occurred_at => :desc, :id => :desc).limit(5) | ||
| 10 | end | 11 | end |
| 11 | 12 | ||
| 12 | def conventions | 13 | def conventions |
diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb index a9c0512..1b4a0a0 100644 --- a/app/views/admin/index.html.erb +++ b/app/views/admin/index.html.erb | |||
| @@ -40,13 +40,36 @@ | |||
| 40 | <%= link_to "See all drafts →", drafts_nodes_path %> | 40 | <%= link_to "See all drafts →", drafts_nodes_path %> |
| 41 | </div> | 41 | </div> |
| 42 | 42 | ||
| 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 | <%= render partial: "nodes/recent_change_item", collection: @recent_changes, as: :node %> | 46 | <%= render partial: "nodes/recent_change_item", collection: @recent_changes, as: :node %> |
| 47 | </ul> | 47 | </ul> |
| 48 | <%= link_to "See all recent changes →", recent_nodes_path %> | 48 | <%= link_to "See all recent changes →", recent_nodes_path %> |
| 49 | </div--> | ||
| 50 | |||
| 51 | <div class="dashboard_widget"> | ||
| 52 | <h3>Recent changes</h3> | ||
| 53 | <table id="node_action_list"> | ||
| 54 | <% @actions.each do |action| %> | ||
| 55 | <tr class="node_action node_action--<%= action.action %>"> | ||
| 56 | <td class="node_action_time"><%= raw(action.occurred_at.strftime("%Y-%m-%d %H:%M").gsub(" ", "<br/>")) %></td> | ||
| 57 | <td class="node_action_body"> | ||
| 58 | <%= action_summary(action) %> | ||
| 59 | <% if action.node_id && params[:node_id].blank? %> | ||
| 60 | <%= link_to t("node_actions.node_history"), admin_log_path(:node_id => action.node_id), :class => "node_action_zoom" %> | ||
| 61 | <% end %> | ||
| 62 | <% if action.inferred_from %> | ||
| 63 | <span class="node_action_inferred" title="<%= action.inferred_from %>"><%= t("node_actions.backfilled") %></span> | ||
| 64 | <% end %> | ||
| 65 | <%= render "node_actions/change_details", :action_entry => action if action_details?(action) %> | ||
| 66 | </td> | ||
| 67 | </tr> | ||
| 68 | <% end %> | ||
| 69 | </table> | ||
| 70 | <%= link_to "See all recent changes →", admin_log_path %> | ||
| 49 | </div> | 71 | </div> |
| 72 | |||
| 50 | </div> | 73 | </div> |
| 51 | 74 | ||
| 52 | <div id="dashboard_housekeeping"> | 75 | <div id="dashboard_housekeeping"> |
