Make notifications/read_all non-ajax, link back to index page
This commit is contained in:
parent
a2bb8515f9
commit
906de27922
2 changed files with 2 additions and 12 deletions
|
|
@ -26,6 +26,6 @@ class NotificationsController < ApplicationController
|
||||||
|
|
||||||
def read_all
|
def read_all
|
||||||
Notification.where(:recipient_id => current_user.id).update_all(:unread => false)
|
Notification.where(:recipient_id => current_user.id).update_all(:unread => false)
|
||||||
redirect_to :back
|
redirect_to aspects_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,4 @@
|
||||||
:javascript
|
:javascript
|
||||||
$('.mark_all_read').live('click', function(){
|
|
||||||
$.ajax({
|
|
||||||
url: 'notifications/read_all',
|
|
||||||
success: function(data, status, xhr) {
|
|
||||||
$('.stream_element').removeClass('unread');
|
|
||||||
$("#notification_badge_number").addClass("hidden");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.stream_element').live('mousedown', function(evt){
|
$('.stream_element').live('mousedown', function(evt){
|
||||||
var note = $(this).closest('.stream_element'),
|
var note = $(this).closest('.stream_element'),
|
||||||
note_id = note.attr('data-guid'),
|
note_id = note.attr('data-guid'),
|
||||||
|
|
@ -37,7 +27,7 @@
|
||||||
%h2
|
%h2
|
||||||
= t('.notifications')
|
= t('.notifications')
|
||||||
.span-13.last.left
|
.span-13.last.left
|
||||||
= link_to t('.mark_all_as_read'), "#", :class => "button mark_all_read"
|
= link_to t('.mark_all_as_read'), notifications_read_all_path, :class => 'button'
|
||||||
|
|
||||||
.span-24.last
|
.span-24.last
|
||||||
%ul.stream.notifications
|
%ul.stream.notifications
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue