aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2010-09-02 19:17:23 +1200
committerPhilip Arndt <parndt@gmail.com>2010-09-02 19:17:23 +1200
commit1a9f98217e11c8e3a8b7189f26f45890580160d2 (patch)
tree3c0f359c791e08043ee8dcff0f7c9b23406aaba6
parent0c03044fca70cbbf9bb0be3cc0d957f6591121ea (diff)
downloadrefinerycms-blog-1a9f98217e11c8e3a8b7189f26f45890580160d2.tar.gz
refinerycms-blog-1a9f98217e11c8e3a8b7189f26f45890580160d2.tar.bz2
refinerycms-blog-1a9f98217e11c8e3a8b7189f26f45890580160d2.zip
Redirect properly after saving notification recipients and display a nice friendly message to the user.
-rw-r--r--app/controllers/admin/blog/settings_controller.rb9
-rw-r--r--config/locales/en.yml1
2 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/admin/blog/settings_controller.rb b/app/controllers/admin/blog/settings_controller.rb
index 52a7e83..541fa36 100644
--- a/app/controllers/admin/blog/settings_controller.rb
+++ b/app/controllers/admin/blog/settings_controller.rb
@@ -4,7 +4,14 @@ class Admin::Blog::SettingsController < Admin::BaseController
@recipients = BlogComment::Notification.recipients
if request.post?
- BlogComment::Notification.recipients == params[:recipients]
+ BlogComment::Notification.recipients = params[:recipients]
+ flash[:notice] = t('admin.blog.settings.notification_recipients.updated',
+ :recipients => BlogComment::Notification.recipients)
+ unless request.xhr? or from_dialog?
+ redirect_back_or_default(admin_blog_posts_path)
+ else
+ render :text => "<script type='text/javascript'>parent.window.location = '#{admin_blog_posts_path}';</script>"
+ end
end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 234299b..2cd53dc 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -49,6 +49,7 @@ en:
explanation: Every time someone comments on a blog post, Refinery sends out an email to say there is a new comment.
hint: When a new comment is added, Refinery will send an email notification to you.
example: "Enter your email address(es) like: jack@work.com, jill@office.com"
+ updated: Notification recipients have been set to '{{recipients}}'
submenu:
categories:
title: Categories