2009-01-15 18:26:37 +01:00
|
|
|
module MessagesHelper
|
2009-01-15 20:10:50 +01:00
|
|
|
def format_subject(message, length)
|
2009-03-09 13:02:43 +01:00
|
|
|
if message.subject.length > length
|
|
|
|
subject = truncate(message.subject, :length => length)
|
|
|
|
body = ""
|
|
|
|
else
|
|
|
|
subject = message.subject
|
|
|
|
body = truncate(message.body, :length => length - subject.length)
|
|
|
|
end
|
2011-05-18 14:47:17 +02:00
|
|
|
"<b>#{link_to(h(subject), message)}</b> <span style='color:grey'>#{h(body)}</span>".html_safe
|
2009-01-15 18:26:37 +01:00
|
|
|
end
|
|
|
|
end
|