diff options
| author | hukl <contact@smyck.org> | 2009-03-02 14:12:23 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-03-02 14:12:23 +0100 |
| commit | ddc961fd81b37b44078fba35f0769b661e1e81ce (patch) | |
| tree | 99c26aa563605efeed5194171bbfbcedbbcbb4ab | |
| parent | e453dce6ec96906306967ad124cee79d11cd24fa (diff) | |
put the rendering of titles in the node overview into the nodes_helper
| -rw-r--r-- | app/helpers/nodes_helper.rb | 8 | ||||
| -rw-r--r-- | app/views/nodes/index.html.erb | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/app/helpers/nodes_helper.rb b/app/helpers/nodes_helper.rb index 673b561..fc5b0a0 100644 --- a/app/helpers/nodes_helper.rb +++ b/app/helpers/nodes_helper.rb | |||
| @@ -1,2 +1,10 @@ | |||
| 1 | module NodesHelper | 1 | module NodesHelper |
| 2 | |||
| 3 | def title_for_node node | ||
| 4 | if node.head | ||
| 5 | truncate(node.head.title, :length => 50) | ||
| 6 | else | ||
| 7 | truncate(node.draft.title, :length => 50) | ||
| 8 | end | ||
| 9 | end | ||
| 2 | end | 10 | end |
diff --git a/app/views/nodes/index.html.erb b/app/views/nodes/index.html.erb index 5d59f5d..1429d1a 100644 --- a/app/views/nodes/index.html.erb +++ b/app/views/nodes/index.html.erb | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | <tr class="<%= cycle("even", "odd") %>"> | 16 | <tr class="<%= cycle("even", "odd") %>"> |
| 17 | <td> | 17 | <td> |
| 18 | <strong> | 18 | <strong> |
| 19 | <%= truncate(node.head.title, :length => 50) if node.head %> | 19 | <%= title_for_node node %> |
| 20 | </strong> | 20 | </strong> |
| 21 | </td> | 21 | </td> |
| 22 | <td><%= node.unique_name %></td> | 22 | <td><%= node.unique_name %></td> |
