diff options
Diffstat (limited to 'app/views/nodes/trashed.html.erb')
| -rw-r--r-- | app/views/nodes/trashed.html.erb | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/app/views/nodes/trashed.html.erb b/app/views/nodes/trashed.html.erb index 9a4808e6..a3c2cf41 100644 --- a/app/views/nodes/trashed.html.erb +++ b/app/views/nodes/trashed.html.erb | |||
| @@ -1,42 +1,40 @@ | |||
| 1 | <h1>Trash</h1> | 1 | <h1><%= t(".title") %></h1> |
| 2 | 2 | ||
| 3 | <% if @nodes.empty? %> | 3 | <% if @nodes.empty? %> |
| 4 | <p class="field_hint">The Trash is empty.</p> | 4 | <p class="field_hint"><%= t(".empty") %></p> |
| 5 | <% else %> | 5 | <% else %> |
| 6 | <%= will_paginate @nodes %> | 6 | <%= will_paginate @nodes %> |
| 7 | <table id="trashed_node_list"> | 7 | <table id="trashed_node_list"> |
| 8 | <tr> | 8 | <tr> |
| 9 | <th>Title</th> | 9 | <th><%= t("admin.columns.title") %></th> |
| 10 | <th>Was at</th> | 10 | <th><%= t(".was_at") %></th> |
| 11 | <th>Trashed</th> | 11 | <th><%= t(".trashed") %></th> |
| 12 | <th>Actions</th> | 12 | <th><%= t("admin.columns.actions") %></th> |
| 13 | </tr> | 13 | </tr> |
| 14 | <% @nodes.each do |node| %> | 14 | <% @nodes.each do |node| %> |
| 15 | <% entry = node.last_trash_entry %> | 15 | <% entry = node.last_trash_entry %> |
| 16 | <tr> | 16 | <tr> |
| 17 | <% doomed_below = node.descendants.count %> | 17 | <% doomed_below = node.descendants.count %> |
| 18 | <td> | 18 | <td> |
| 19 | <%= link_to (node.draft&.title || node.slug), node_path(node) %><%= " (+ #{doomed_below} beneath)" if doomed_below > 0 %> | 19 | <%= link_to (node.draft&.title || node.slug), node_path(node) %><%= " " + t(".beneath", :count => doomed_below) if doomed_below > 0 %> |
| 20 | </td> | 20 | </td> |
| 21 | <td><%= entry&.metadata&.dig("path", "from") %></td> | 21 | <td><%= entry&.metadata&.dig("path", "from") %></td> |
| 22 | <td> | 22 | <td> |
| 23 | <% if entry %> | 23 | <% if entry %> |
| 24 | <%= entry.occurred_at.strftime("%Y-%m-%d %H:%M") %> by <%= entry.actor_name %> | 24 | <%= t(".trashed_by", :time => entry.occurred_at.strftime("%Y-%m-%d %H:%M"), :actor => entry.actor_name) %> |
| 25 | <% end %> | 25 | <% end %> |
| 26 | </td> | 26 | </td> |
| 27 | <td> | 27 | <td> |
| 28 | <%= button_to node_path(node), method: :delete, | 28 | <%= button_to node_path(node), method: :delete, |
| 29 | form: { data: { confirm: doomed_below > 0 ? | 29 | form: { data: { confirm: t(".confirm_delete", :title => (node.draft&.title || node.slug), :count => doomed_below) }, |
| 30 | "Delete \"#{node.draft&.title || node.slug}\" and the #{doomed_below} pages beneath it permanently? This cannot be undone." : | ||
| 31 | "Delete \"#{node.draft&.title || node.slug}\" permanently? This cannot be undone." }, | ||
| 32 | class: 'button_to destructive' } do %> | 30 | class: 'button_to destructive' } do %> |
| 33 | <%= icon("trash-x", library: "tabler", "aria-hidden": true) %> | 31 | <%= icon("trash-x", library: "tabler", "aria-hidden": true) %> |
| 34 | Delete permanently | 32 | <%= t(".delete_permanently") %> |
| 35 | <% end %> | 33 | <% end %> |
| 36 | </td> | 34 | </td> |
| 37 | </tr> | 35 | </tr> |
| 38 | <% end %> | 36 | <% end %> |
| 39 | </table> | 37 | </table> |
| 40 | <%= will_paginate @nodes %> | 38 | <%= will_paginate @nodes %> |
| 41 | <p class="field_hint">To restore a page, open it and pick a new parent in its Trash section.</p> | 39 | <p class="field_hint"><%= t(".restore_hint") %></p> |
| 42 | <% end %> | 40 | <% end %> |
