Class: Refinery::Blog::Admin::SettingsController
- Inherits:
-
AdminController
- Object
- AdminController
- Refinery::Blog::Admin::SettingsController
- Defined in:
- app/controllers/refinery/blog/admin/settings_controller.rb
Instance Method Summary collapse
Instance Method Details
#comments ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/refinery/blog/admin/settings_controller.rb', line 32 def comments enabled = Refinery::Blog::Comment.toggle! unless request.xhr? redirect_back_or_default(refinery.blog_admin_posts_path) else render :json => {:enabled => enabled}, :layout => false end end |
#moderation ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'app/controllers/refinery/blog/admin/settings_controller.rb', line 22 def moderation enabled = Refinery::Blog::Comment::Moderation.toggle! unless request.xhr? redirect_back_or_default(refinery.blog_admin_posts_path) else render :json => {:enabled => enabled}, :layout => false end end |
#notification_recipients ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/refinery/blog/admin/settings_controller.rb', line 6 def notification_recipients @recipients = Refinery::Blog::Comment::Notification.recipients if request.post? Refinery::Blog::Comment::Notification.recipients = params[:recipients] flash[:notice] = t('updated', :scope => 'refinery.blog.admin.settings.notification_recipients', :recipients => Refinery::Blog::Comment::Notification.recipients) unless request.xhr? or from_dialog? redirect_back_or_default(refinery.blog_admin_posts_path) else render :text => "<script type='text/javascript'>parent.window.location = '#{refinery.blog_admin_posts_path}';</script>", :layout => false end end end |
#teasers ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'app/controllers/refinery/blog/admin/settings_controller.rb', line 42 def enabled = Refinery::Blog::Post. unless request.xhr? redirect_back_or_default(refinery.blog_admin_posts_path) else render :json => {:enabled => enabled}, :layout => false end end |