Fix mobile notifications
This commit is contained in:
parent
cc585805ad
commit
1ff644c13e
4 changed files with 15 additions and 1 deletions
|
|
@ -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')}
|
||||
|
||||
|
|
|
|||
7
app/views/notifications/_notification.mobile.haml
Normal file
7
app/views/notifications/_notification.mobile.haml
Normal file
|
|
@ -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)
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue