use post_message in all mailer html views
This commit is contained in:
parent
a904b59a03
commit
1e7a2f327b
6 changed files with 7 additions and 6 deletions
|
|
@ -1,7 +1,8 @@
|
||||||
module NotifierHelper
|
module NotifierHelper
|
||||||
def post_message(post, opts={})
|
def post_message(post, opts={})
|
||||||
|
opts[:length] ||= 200
|
||||||
if post.respond_to? :formatted_message
|
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 = process_newlines(message) if opts[:process_newlines]
|
||||||
message
|
message
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%p
|
%p
|
||||||
= process_newlines(truncate(@comment.text, :length => 600))
|
= post_message(@comment, :process_newlines => true, :length => 600)
|
||||||
%p
|
%p
|
||||||
= link_to t('notifier.comment_on_post.reply', :name => @comment.post.author.first_name), post_url(@comment.post)
|
= link_to t('notifier.comment_on_post.reply', :name => @comment.post.author.first_name), post_url(@comment.post)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%p
|
%p
|
||||||
= process_newlines(truncate(@comment.text, :length => 600))
|
= post_message(@comment, :process_newlines => true, :length => 600)
|
||||||
%p
|
%p
|
||||||
= link_to t('notifier.comment_on_post.reply', :name => @comment.post.author.name), post_url(@comment.post)
|
= link_to t('notifier.comment_on_post.reply', :name => @comment.post.author.name), post_url(@comment.post)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%p
|
%p
|
||||||
= process_newlines(truncate(@post.formatted_message(:plain_text => true), :length => 600))
|
= post_message(@post, :process_newlines => true, :length => 600)
|
||||||
%p
|
%p
|
||||||
= link_to t('notifier.comment_on_post.reply', :name => @post.author.name), post_url(@post)
|
= link_to t('notifier.comment_on_post.reply', :name => @post.author.name), post_url(@post)
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
!= @post.formatted_message(:plain_text => true)
|
!= post_message(@post, :process_newlines => true, :length => 600)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%p
|
%p
|
||||||
= markdownify(@message.text)
|
= post_message(@message, :process_newlines => true, :length => 2000)
|
||||||
%p
|
%p
|
||||||
= link_to t('.reply_to_or_view'), conversations_url(:conversation_id => @conversation)
|
= link_to t('.reply_to_or_view'), conversations_url(:conversation_id => @conversation)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue