diff --git a/Changelog.md b/Changelog.md index dc5d0b4370616176f3d6e471c88c7f393b2ddfbc..e0692e54e756572cf96497050c3450d3536eb4bd 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,9 +1,15 @@ # 0.0.2.0pre -Add password_confirmation field to registration page -Fix error with open/close registrations. -Fix javascripts error in invitations facebox. -Fix css overflow problem in aspect dropdown on welcome page. +## Add Features + +* Add password_confirmation field to registration page. [#3647](https://github.com/diaspora/diaspora/pull/3647) + +## Bug Fixes + +* Fix javascripts problem with read/unread notifications. [#3656](https://github.com/diaspora/diaspora/pull/3656) +* Fix error with open/close registrations. [#3649](https://github.com/diaspora/diaspora/pull/3649) +* Fix javascripts error in invitations facebox. [#3638](https://github.com/diaspora/diaspora/pull/3638) +* Fix css overflow problem in aspect dropdown on welcome page. [#3637](https://github.com/diaspora/diaspora/pull/3637) # 0.0.1.1 diff --git a/app/assets/javascripts/widgets/notifications.js b/app/assets/javascripts/widgets/notifications.js index 55e64d0af315e0cbd7d19cc5991b4d08c85d4e6b..797d94588b96a99717c03faef65ce64eb7370647 100644 --- a/app/assets/javascripts/widgets/notifications.js +++ b/app/assets/javascripts/widgets/notifications.js @@ -54,7 +54,7 @@ } this.unreadClick = function() { $.ajax({ - url: "/notifications/" + $(this).closest(".stream_element").data("guid"), + url: "/notifications/" + $(this).closest(".stream_element,.notification_element").data("guid"), data: { set_unread: true }, type: "PUT", success: self.clickSuccess diff --git a/app/views/notifications/_notify_popup_item.haml b/app/views/notifications/_notify_popup_item.haml index e2c30fa272aa4355aad6c667ac69e64dd7edac70..b1a74de70093d5f28acf429fbe39c411bfec3c78 100644 --- a/app/views/notifications/_notify_popup_item.haml +++ b/app/views/notifications/_notify_popup_item.haml @@ -1,7 +1,7 @@ -.notification_element{:data=>{:guid => n.id},:class => (n.unread ? "unread" : "read")} +.notification_element{:data=>{:guid => n.id}, :class => (n.unread ? "unread" : "read")} %img{:src => n.actors.first.image_url(:thumb_medium)} - = notification_message_for(n) - %br/ - %abbr.timeago{:title=>n.created_at.iso8601} - %a{:class => 'unread-setter'} - = t('notifications.index.mark_unread') + = notification_message_for(n) + %div + %time + = timeago(n.created_at) + = link_to t('notifications.index.mark_unread'), "#", :class => "unread-setter" diff --git a/spec/javascripts/widgets/notifications-spec.js b/spec/javascripts/widgets/notifications-spec.js index 787154d4b7a1cf233ad9deb9ffbc725149c30ab4..84ded9b46a7eff1bfaedcd0bfeaa5a0fea6bf94a 100644 --- a/spec/javascripts/widgets/notifications-spec.js +++ b/spec/javascripts/widgets/notifications-spec.js @@ -17,7 +17,7 @@ describe("Diaspora.Widgets.Notifications", function() { }); describe("clickSuccess", function(){ - it("changes the css to a read cell", function() { + it("changes the css to a read cell at stream element", function() { this.view.$(".notifications").html( '<div id="1" class="stream_element read" data-guid=1></div>' + '<div id="2" class="stream_element unread" data-guid=2></div>' @@ -25,7 +25,15 @@ describe("Diaspora.Widgets.Notifications", function() { notifications.clickSuccess({guid:2,unread:false}); expect( this.view.$('.stream_element#2')).toHaveClass("read"); }); - it("changes the css to an unread cell", function() { + it("changes the css to a read cell at notications element", function() { + this.view.$(".notifications").html( + '<div id="1" class="notification_element read" data-guid=1></div>' + + '<div id="2" class="notification_element unread" data-guid=2></div>' + ); + notifications.clickSuccess({guid:2,unread:false}); + expect( this.view.$('.notification_element#2')).toHaveClass("read"); + }); + it("changes the css to an unread cell at stream element", function() { this.view.$(".notifications").html( '<div id="1" class="stream_element read" data-guid=1></div>' + '<div id="2" class="stream_element unread" data-guid=2></div>' @@ -33,13 +41,21 @@ describe("Diaspora.Widgets.Notifications", function() { notifications.clickSuccess({guid:1,unread:true}); expect( this.view.$('.stream_element#1')).toHaveClass("unread"); }); + it("changes the css to an unread cell at notications element", function() { + this.view.$(".notifications").html( + '<div id="1" class="notification_element read" data-guid=1></div>' + + '<div id="2" class="notification_element unread" data-guid=2></div>' + ); + notifications.clickSuccess({guid:1,unread:true}); + expect( this.view.$('.notification_element#1')).toHaveClass("unread"); + }); - it("calls Notifications.decrementCount on a read cell", function() { + it("calls Notifications.decrementCount on a read cell at stream/notification element", function() { notifications.clickSuccess(JSON.stringify({guid:1,unread:false})); expect(notifications.decrementCount).toHaveBeenCalled(); }); - it("calls Notifications.incrementCount on a unread cell", function() { + it("calls Notifications.incrementCount on a unread cell at stream/notification element", function() { notifications.clickSuccess({guid:1,unread:true}); expect(notifications.incrementCount).toHaveBeenCalled(); }); @@ -103,4 +119,4 @@ describe("Diaspora.Widgets.Notifications", function() { }); }); -}); \ No newline at end of file +});