FEATURE: properly style whisper email notifications

This commit is contained in:
Régis Hanol 2016-01-11 17:47:17 +01:00
parent 2a84db73b5
commit cf0558cd33
3 changed files with 6 additions and 1 deletions

View file

@ -90,6 +90,10 @@ class Post < ActiveRecord::Base
includes(:post_details).find_by(post_details: { key: key, value: value })
end
def whisper?
post_type == Post.types[:whisper]
end
def add_detail(key, value, extra = nil)
post_details.build(key: key, value: value, extra: extra)
end

View file

@ -1,4 +1,4 @@
<table class='post-wrapper'>
<table class='post-wrapper <%= post.whisper? ? "whisper" : "" %>'>
<tbody>
<tr>
<td class='user-avatar'>

View file

@ -89,6 +89,7 @@ module Email
style('hr', 'background-color: #ddd; height: 1px; border: 1px;')
style('.rtl', 'direction: rtl;')
style('td.body', 'padding-top:5px;', colspan: "2")
style('.whisper td.body', 'font-style: italic; color: #9c9c9c;')
correct_first_body_margin
correct_footer_style
reset_tables