use post_message in all mailer html views

This commit is contained in:
danielgrippi 2011-08-10 11:49:42 -07:00
parent a904b59a03
commit 1e7a2f327b
6 changed files with 7 additions and 6 deletions

View file

@ -1,7 +1,8 @@
module NotifierHelper
def post_message(post, opts={})
opts[:length] ||= 200
if post.respond_to? :formatted_message
message = truncate(post.formatted_message(:plain_text => true), :length => 200)
message = truncate(post.formatted_message(:plain_text => true), :length => opts[:length])
message = process_newlines(message) if opts[:process_newlines]
message
else

View file

@ -1,4 +1,4 @@
%p
= process_newlines(truncate(@comment.text, :length => 600))
= post_message(@comment, :process_newlines => true, :length => 600)
%p
= link_to t('notifier.comment_on_post.reply', :name => @comment.post.author.first_name), post_url(@comment.post)

View file

@ -1,4 +1,4 @@
%p
= process_newlines(truncate(@comment.text, :length => 600))
= post_message(@comment, :process_newlines => true, :length => 600)
%p
= link_to t('notifier.comment_on_post.reply', :name => @comment.post.author.name), post_url(@comment.post)

View file

@ -1,4 +1,4 @@
%p
= process_newlines(truncate(@post.formatted_message(:plain_text => true), :length => 600))
= post_message(@post, :process_newlines => true, :length => 600)
%p
= link_to t('notifier.comment_on_post.reply', :name => @post.author.name), post_url(@post)

View file

@ -1 +1 @@
!= @post.formatted_message(:plain_text => true)
!= post_message(@post, :process_newlines => true, :length => 600)

View file

@ -1,4 +1,4 @@
%p
= markdownify(@message.text)
= post_message(@message, :process_newlines => true, :length => 2000)
%p
= link_to t('.reply_to_or_view'), conversations_url(:conversation_id => @conversation)