diff --git a/Changelog.md b/Changelog.md index 1921d4501..80c250a7b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -24,6 +24,7 @@ * Mark all unread post-related notifications as read, if one of this gets opened. [#3787](https://github.com/diaspora/diaspora/pull/3787) * Add flash-notice when sending messages to non-contacts. [#3723](https://github.com/diaspora/diaspora/pull/3723) * Re-add hovercards [#3802](https://github.com/diaspora/diaspora/pull/3802) +* Add images to notifications [#3821](https://github.com/diaspora/diaspora/pull/3821) ## Bug Fixes diff --git a/app/assets/stylesheets/application.css.sass b/app/assets/stylesheets/application.css.sass index 31e738260..7f6d931c8 100644 --- a/app/assets/stylesheets/application.css.sass +++ b/app/assets/stylesheets/application.css.sass @@ -375,6 +375,14 @@ ul.as-selections img :max-width 100% + .bd + > img + :height 30px + :width 30px + :float left + :margin + :right 10px + .stream_photo :float left :margin diff --git a/app/views/notifications/_notify_popup_item.haml b/app/views/notifications/_notify_popup_item.haml index b1a74de70..b82cedc64 100644 --- a/app/views/notifications/_notify_popup_item.haml +++ b/app/views/notifications/_notify_popup_item.haml @@ -1,6 +1,6 @@ .notification_element{:data=>{:guid => n.id}, :class => (n.unread ? "unread" : "read")} - %img{:src => n.actors.first.image_url(:thumb_medium)} - = notification_message_for(n) + = person_image_tag n.actors.first, :thumb_medium + = notification_message_for(n) %div %time = timeago(n.created_at) diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index c6f57f766..afbacb82c 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -24,6 +24,7 @@ .media .bd + = person_image_tag note.actors.first, :thumb_medium = notification_message_for(note) %div %time diff --git a/spec/controllers/notifications_controller_spec.rb b/spec/controllers/notifications_controller_spec.rb index 34659b84b..256b7f465 100644 --- a/spec/controllers/notifications_controller_spec.rb +++ b/spec/controllers/notifications_controller_spec.rb @@ -75,6 +75,12 @@ describe NotificationsController do FactoryGirl.create(:notification, :recipient => alice, :target => @post) end + it 'succeeds' do + get :index + response.should be_success + assigns[:notifications].count.should == 1 + end + it 'succeeds for notification dropdown' do get :index, :format => :json response.should be_success