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)
|
pager.replace(result)
|
||||||
end
|
end
|
||||||
@notifications.each do |note|
|
@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
|
end
|
||||||
@group_days = @notifications.group_by{|note| note.created_at.strftime('%Y-%m-%d')}
|
@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
|
expect(Nokogiri(response.body).css('.aspect_membership')).to be_empty
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should provide a contacts menu for start sharing notifications" do
|
it "should provide a contacts menu for start sharing notifications" do
|
||||||
eve.share_with(alice.person, eve.aspects.first)
|
eve.share_with(alice.person, eve.aspects.first)
|
||||||
get :index, "per_page" => 5
|
get :index, "per_page" => 5
|
||||||
|
|
||||||
expect(Nokogiri(response.body).css('.aspect_membership')).not_to be_empty
|
expect(Nokogiri(response.body).css('.aspect_membership')).not_to be_empty
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
describe "filter notifications" do
|
describe "filter notifications" do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue