diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 5c3c7766e..88e94a30b 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -41,7 +41,7 @@ class NotificationsController < ApplicationController pager.replace(result) end @notifications.each do |note| - note.note_html = render_to_string( :partial => 'notification.html', :locals => { :note => note } ) + note.note_html = render_to_string( :partial => 'notification', :locals => { :note => note } ) end @group_days = @notifications.group_by{|note| note.created_at.strftime('%Y-%m-%d')} diff --git a/app/views/notifications/_notification.html.haml b/app/views/notifications/_notification.haml similarity index 100% rename from app/views/notifications/_notification.html.haml rename to app/views/notifications/_notification.haml diff --git a/app/views/notifications/_notification.mobile.haml b/app/views/notifications/_notification.mobile.haml new file mode 100644 index 000000000..5c18ed6cd --- /dev/null +++ b/app/views/notifications/_notification.mobile.haml @@ -0,0 +1,7 @@ +.notification_element{:data=>{:guid => note.id, :type => (Notification.types.key(note.type) || '')}, :class => (note.unread ? "unread" : "read")} + .pull-right.unread-toggle + %i.entypo.eye{ :title => (note.unread ? t('notifications.index.mark_read') : t('notifications.index.mark_unread')) } + = person_image_tag note.actors.first, :thumb_small + .notification_message + = notification_message_for(note) + %div= timeago(note.created_at) diff --git a/spec/controllers/notifications_controller_spec.rb b/spec/controllers/notifications_controller_spec.rb index b8c553b7c..2302320b0 100644 --- a/spec/controllers/notifications_controller_spec.rb +++ b/spec/controllers/notifications_controller_spec.rb @@ -87,12 +87,19 @@ describe NotificationsController, :type => :controller do expect(Nokogiri(response.body).css('.aspect_membership')).to be_empty end + it "should provide a contacts menu for start sharing notifications" do eve.share_with(alice.person, eve.aspects.first) get :index, "per_page" => 5 expect(Nokogiri(response.body).css('.aspect_membership')).not_to be_empty end + + it 'succeeds on mobile' do + eve.share_with(alice.person, eve.aspects.first) + get :index, :format => :mobile + expect(response).to be_success + end end describe "filter notifications" do