diff --git a/app/views/layouts/notifier.html.haml b/app/views/layouts/notifier.html.haml new file mode 100644 index 000000000..ab3ad44af --- /dev/null +++ b/app/views/layouts/notifier.html.haml @@ -0,0 +1,10 @@ +!!! +%html + %head + %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ + = render :partial => 'notifier_css' + %body + %header + = image_tag attachments['diaspora_white_on_grey.png'].url, :alt => "DIASPORA" + #container + = yield diff --git a/app/views/notifier/_notifier_css.haml b/app/views/notifier/_notifier_css.haml new file mode 100644 index 000000000..1c4154e5e --- /dev/null +++ b/app/views/notifier/_notifier_css.haml @@ -0,0 +1,39 @@ +:css + body{ + width:600px; + font-family:'Arial','Helvetica',sans-serif; + font-size:14px; + color:#333; + } + #container{ + margin-bottom:25px + min-height:400px; + padding-left:15px; + } + header{ + background-color:#333; + padding: 15px; + margin-bottom: 25px; + } + p{ + padding:5px; + } + p.small{ + font-size:smaller; + color:#999; + font-style:italic; + } + a{ + color:#107FC9; + font-weight:bold; + } + a:hover{ + color: #22AAE0; + } + a:active{ + color: #005D9C; + } + .large_text{ + font-size:21px; + font-family:"Helvetica Neue",Arial,Helvetica,sans-serif; + } diff --git a/app/views/notifier/new_request.html.haml b/app/views/notifier/new_request.html.haml index bf964dbda..288b2efe7 100644 --- a/app/views/notifier/new_request.html.haml +++ b/app/views/notifier/new_request.html.haml @@ -1,59 +1,12 @@ -!!! -%html - %head - %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ - :css - body{ - width:600px; - font-family:'Arial','Helvetica',sans-serif; - font-size:14px; - color:#333; - } - #container{ - margin-bottom:25px - min-height:400px; - padding-left:15px; - } - header{ - background-color:#333; - padding: 15px; - margin-bottom: 25px; - } - p{ - padding:5px; - } - p.small{ - font-size:smaller; - color:#999; - font-style:italic; - } - a{ - color:#107FC9; - font-weight:bold; - } - a:hover{ - color: #22AAE0; - } - a:active{ - color: #005D9C; - } - .large_text{ - font-size:21px; - font-family:"Helvetica Neue",Arial,Helvetica,sans-serif; - } - %body - %header - = image_tag attachments['diaspora_white_on_grey.png'].url, :alt => "DIASPORA" - #container - %p - = t('notifier.hello', => :name) - %p - = "#{@sender.real_name} (#{@sender.diaspora_handle})" - = t('.just_sent_you') - = t('.try_it_out') - %br - = link_to t('.sign_in'), new_user_session_url - %br - = t('notifier.love'), - %br - = t('notifier.diaspora') +%p + = t('notifier.hello', :name => @receiver.email) +%p + = "#{@sender.real_name} (#{@sender.diaspora_handle})" + = t('.just_sent_you') + = t('.try_it_out') + %br + = link_to t('.sign_in'), new_user_session_url + %br + = t('notifier.love') + %br + = t('notifier.diaspora') diff --git a/app/views/notifier/request_accepted.html.haml b/app/views/notifier/request_accepted.html.haml index 9c4468916..c6de766e9 100644 --- a/app/views/notifier/request_accepted.html.haml +++ b/app/views/notifier/request_accepted.html.haml @@ -1,59 +1,12 @@ -!!! -%html - %head - %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ - :css - body{ - width:600px; - font-family:'Arial','Helvetica',sans-serif; - font-size:14px; - color:#333; - } - #container{ - margin-bottom:25px - min-height:400px; - padding-left:15px; - } - header{ - background-color:#333; - padding: 15px; - margin-bottom: 25px; - } - p{ - padding:5px; - } - p.small{ - font-size:smaller; - color:#999; - font-style:italic; - } - a{ - color:#107FC9; - font-weight:bold; - } - a:hover{ - color: #22AAE0; - } - a:active{ - color: #005D9C; - } - .large_text{ - font-size:21px; - font-family:"Helvetica Neue",Arial,Helvetica,sans-serif; - } - %body - %header - = image_tag attachments['diaspora_white_on_grey.png'].url, :alt => "DIASPORA" - #container - %p - = t('notifier.hello', :name => @receiver.profile.first_name - %p - = "#{@sender.real_name} (#{@sender.diaspora_handle})" - = t('.accepted') - = link_to @aspect.name, aspect_url(@aspect) - = t('.aspect') +%p + = t('notifier.hello', :name => @receiver.profile.first_name) +%p + = "#{@sender.real_name} (#{@sender.diaspora_handle})" + = t('.accepted') + = link_to @aspect.name, aspect_url(@aspect) + = t('.aspect') - %br - = t('notifier.love') - %br - = t('notifier.diaspora') + %br + = t('notifier.love') + %br + = t('notifier.diaspora') diff --git a/app/views/notifier/request_accepted.text.haml b/app/views/notifier/request_accepted.text.haml index 334a68ddf..b0e9fa7a7 100644 --- a/app/views/notifier/request_accepted.text.haml +++ b/app/views/notifier/request_accepted.text.haml @@ -1,4 +1,4 @@ -= t('notifier.hello', :name => @receiver.profile.first_name += t('notifier.hello', :name => @receiver.profile.first_name) = "#{@sender.real_name} (#{@sender.diaspora_handle})" = t('notifier.request_accepted.accepted') = "#{@aspect.name} #{t('notifier.request_accepted.aspect')}\n" diff --git a/spec/mailers/notifier_spec.rb b/spec/mailers/notifier_spec.rb index c0b3a4aea..608a129bf 100644 --- a/spec/mailers/notifier_spec.rb +++ b/spec/mailers/notifier_spec.rb @@ -23,6 +23,10 @@ describe Notifier do it 'has the name of person sending the request' do request_mail.body.encoded.include?(person.real_name).should be true end + + it 'has the css' do + request_mail.body.encoded.include?("