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