From d3a9b46ba5c863a0ff377dcffae9a494fe476e02 Mon Sep 17 00:00:00 2001 From: hukl Date: Mon, 27 Apr 2009 16:29:32 +0200 Subject: truncated titles with title attribute in recent changes view --- app/helpers/nodes_helper.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/helpers') 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 end end + + def truncated_title_for_node node + if (title = title_for_node node) && title.size > 20 + "#{truncate(title, 40)}" + else + title + end + end + def custom_page_templates Page.custom_templates.map {|x| [x.gsub("_", " ").titlecase, x]} end -- cgit v1.3