From 906de279227f5f625fd821abe349f91278a08c13 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 31 Jan 2011 12:12:06 -0800 Subject: [PATCH] Make notifications/read_all non-ajax, link back to index page --- app/controllers/notifications_controller.rb | 2 +- app/views/notifications/index.html.haml | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 0f9b02989..053b417dc 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -26,6 +26,6 @@ class NotificationsController < ApplicationController def read_all Notification.where(:recipient_id => current_user.id).update_all(:unread => false) - redirect_to :back + redirect_to aspects_path end end diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index f709cb457..8412a92b5 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -1,14 +1,4 @@ :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){ var note = $(this).closest('.stream_element'), note_id = note.attr('data-guid'), @@ -37,7 +27,7 @@ %h2 = t('.notifications') .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 %ul.stream.notifications