blob: 469a1dc979f6229c17443c987fa5edbf0077506e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
module Refinery
module Admin
module Blog
class SettingsController < ::Admin::BaseController
def notification_recipients
@recipients = Refinery::BlogComment::Notification.recipients
if request.post?
Refinery::BlogComment::Notification.recipients = params[:recipients]
flash[:notice] = t('updated', :scope => 'admin.blog.settings.notification_recipients',
:recipients => Refinery::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
def moderation
enabled = Refinery::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 = Refinery::BlogComment.toggle!
unless request.xhr?
redirect_back_or_default(admin_blog_posts_path)
else
render :json => {:enabled => enabled},
:layout => false
end
end
def teasers
enabled = Refinery::BlogPost.teaser_enabled_toggle!
unless request.xhr?
redirect_back_or_default(admin_blog_posts_path)
else
render :json => {:enabled => enabled},
:layout => false
end
end
end
end
end
end
|