diff options
| -rw-r--r-- | app/helpers/nodes_helper.rb | 9 | ||||
| -rw-r--r-- | app/views/admin/_recent_changes.html.erb | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/app/helpers/nodes_helper.rb b/app/helpers/nodes_helper.rb index 12ce392..cc8dc18 100644 --- a/app/helpers/nodes_helper.rb +++ b/app/helpers/nodes_helper.rb | |||
| @@ -8,6 +8,15 @@ module NodesHelper | |||
| 8 | end | 8 | end |
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | |||
| 12 | def truncated_title_for_node node | ||
| 13 | if (title = title_for_node node) && title.size > 20 | ||
| 14 | "<span title='#{title}'>#{truncate(title, 40)}</span>" | ||
| 15 | else | ||
| 16 | title | ||
| 17 | end | ||
| 18 | end | ||
| 19 | |||
| 11 | def custom_page_templates | 20 | def custom_page_templates |
| 12 | Page.custom_templates.map {|x| [x.gsub("_", " ").titlecase, x]} | 21 | Page.custom_templates.map {|x| [x.gsub("_", " ").titlecase, x]} |
| 13 | end | 22 | end |
diff --git a/app/views/admin/_recent_changes.html.erb b/app/views/admin/_recent_changes.html.erb index 1bb14a6..300d088 100644 --- a/app/views/admin/_recent_changes.html.erb +++ b/app/views/admin/_recent_changes.html.erb | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | </tr> | 10 | </tr> |
| 11 | <% @recent_changes.each do |node| %> | 11 | <% @recent_changes.each do |node| %> |
| 12 | <tr> | 12 | <tr> |
| 13 | <td><%= node.draft.try(:title) %></td> | 13 | <td><%= truncated_title_for_node node %></td> |
| 14 | <td><%= node.unique_name %></td> | 14 | <td><%= node.unique_name %></td> |
| 15 | <td><%= node.draft.user.login rescue "" %></td> | 15 | <td><%= node.draft.user.login rescue "" %></td> |
| 16 | <td><%= node.updated_at.to_s(:db) %></td> | 16 | <td><%= node.updated_at.to_s(:db) %></td> |
