diff options
author | Philip Arndt <parndt@gmail.com> | 2011-07-01 09:14:46 +1200 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2011-07-01 09:14:46 +1200 |
commit | 7028ef3dddd8559c8e5519431d3529c0c99872cc (patch) | |
tree | 6b8aa08e5f8713b85fc1bbf4a2460c001e516822 /app/controllers/admin/blog/settings_controller.rb | |
parent | 47a71b309f4fb364449167ddc6ed978b6969e047 (diff) | |
download | refinerycms-blog-7028ef3dddd8559c8e5519431d3529c0c99872cc.tar.gz refinerycms-blog-7028ef3dddd8559c8e5519431d3529c0c99872cc.tar.bz2 refinerycms-blog-7028ef3dddd8559c8e5519431d3529c0c99872cc.zip |
Making use of modules and putting classes under modules.
Diffstat (limited to 'app/controllers/admin/blog/settings_controller.rb')
-rw-r--r-- | app/controllers/admin/blog/settings_controller.rb | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/app/controllers/admin/blog/settings_controller.rb b/app/controllers/admin/blog/settings_controller.rb index eb1eef9..a9b053e 100644 --- a/app/controllers/admin/blog/settings_controller.rb +++ b/app/controllers/admin/blog/settings_controller.rb @@ -1,39 +1,43 @@ -class Admin::Blog::SettingsController < Admin::BaseController +module Admin + module Blog + class SettingsController < Admin::BaseController - def notification_recipients - @recipients = BlogComment::Notification.recipients + def notification_recipients + @recipients = BlogComment::Notification.recipients - if request.post? - BlogComment::Notification.recipients = params[:recipients] - flash[:notice] = t('updated', :scope => 'admin.blog.settings.notification_recipients' - :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>", - :layout => false + if request.post? + BlogComment::Notification.recipients = params[:recipients] + flash[:notice] = t('updated', :scope => 'admin.blog.settings.notification_recipients' + :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>", + :layout => false + end + end end - end - end - def moderation - enabled = BlogComment::Moderation.toggle! - unless request.xhr? - redirect_back_or_default(admin_blog_posts_path) - else - render :json => {:enabled => enabled}, - :layout => false - end - end + def moderation + enabled = BlogComment::Moderation.toggle! + unless request.xhr? + redirect_back_or_default(admin_blog_posts_path) + else + render :json => {:enabled => enabled}, + :layout => false + end + end + + def comments + enabled = BlogComment.toggle! + unless request.xhr? + redirect_back_or_default(admin_blog_posts_path) + else + render :json => {:enabled => enabled}, + :layout => false + end + end - def comments - enabled = BlogComment.toggle! - unless request.xhr? - redirect_back_or_default(admin_blog_posts_path) - else - render :json => {:enabled => enabled}, - :layout => false end end - -end +end
\ No newline at end of file |