Merge pull request #189 from markstuart/rails-3-1
Fixes for notification settings access in refinery admin area
This commit is contained in:
commit
adcf66751c
3 changed files with 9 additions and 9 deletions
|
@ -63,7 +63,7 @@ module Refinery
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
render :text => "<script>parent.window.location = '#{refinery_blog_admin_posts_url}';</script>"
|
render :text => "<script>parent.window.location = '#{main_app.refinery_blog_admin_posts_url}';</script>"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
unless request.xhr?
|
unless request.xhr?
|
||||||
|
|
|
@ -11,9 +11,9 @@ module Refinery
|
||||||
flash[:notice] = t('updated', :scope => 'admin.blog.settings.notification_recipients',
|
flash[:notice] = t('updated', :scope => 'admin.blog.settings.notification_recipients',
|
||||||
:recipients => Refinery::Blog::Comment::Notification.recipients)
|
:recipients => Refinery::Blog::Comment::Notification.recipients)
|
||||||
unless request.xhr? or from_dialog?
|
unless request.xhr? or from_dialog?
|
||||||
redirect_back_or_default(refinery_blog_admin_posts_path)
|
redirect_back_or_default(main_app.refinery_blog_admin_posts_path)
|
||||||
else
|
else
|
||||||
render :text => "<script type='text/javascript'>parent.window.location = '#{refinery_blog_admin_posts_path}';</script>",
|
render :text => "<script type='text/javascript'>parent.window.location = '#{main_app.refinery_blog_admin_posts_path}';</script>",
|
||||||
:layout => false
|
:layout => false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -22,7 +22,7 @@ module Refinery
|
||||||
def moderation
|
def moderation
|
||||||
enabled = Refinery::Blog::Comment::Moderation.toggle!
|
enabled = Refinery::Blog::Comment::Moderation.toggle!
|
||||||
unless request.xhr?
|
unless request.xhr?
|
||||||
redirect_back_or_default(refinery_blog_admin_posts_path)
|
redirect_back_or_default(main_app.refinery_blog_admin_posts_path)
|
||||||
else
|
else
|
||||||
render :json => {:enabled => enabled},
|
render :json => {:enabled => enabled},
|
||||||
:layout => false
|
:layout => false
|
||||||
|
@ -32,7 +32,7 @@ module Refinery
|
||||||
def comments
|
def comments
|
||||||
enabled = Refinery::Blog::Comment.toggle!
|
enabled = Refinery::Blog::Comment.toggle!
|
||||||
unless request.xhr?
|
unless request.xhr?
|
||||||
redirect_back_or_default(refinery_blog_admin_posts_path)
|
redirect_back_or_default(main_app.refinery_blog_admin_posts_path)
|
||||||
else
|
else
|
||||||
render :json => {:enabled => enabled},
|
render :json => {:enabled => enabled},
|
||||||
:layout => false
|
:layout => false
|
||||||
|
@ -42,7 +42,7 @@ module Refinery
|
||||||
def teasers
|
def teasers
|
||||||
enabled = Refinery::Blog::Post.teaser_enabled_toggle!
|
enabled = Refinery::Blog::Post.teaser_enabled_toggle!
|
||||||
unless request.xhr?
|
unless request.xhr?
|
||||||
redirect_back_or_default(refinery_blog_admin_posts_path)
|
redirect_back_or_default(main_app.refinery_blog_admin_posts_path)
|
||||||
else
|
else
|
||||||
render :json => {:enabled => enabled},
|
render :json => {:enabled => enabled},
|
||||||
:layout => false
|
:layout => false
|
||||||
|
@ -52,4 +52,4 @@ module Refinery
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1,4 +1,4 @@
|
||||||
<%= form_tag do %>
|
<%= form_tag main_app.notification_recipients_refinery_blog_admin_settings_path do %>
|
||||||
|
|
||||||
<div class='field'>
|
<div class='field'>
|
||||||
<span class='label_with_help'>
|
<span class='label_with_help'>
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
:locals => {
|
:locals => {
|
||||||
:f => nil,
|
:f => nil,
|
||||||
:continue_editing => false,
|
:continue_editing => false,
|
||||||
:cancel_url => refinery_blog_admin_posts_url,
|
:cancel_url => main_app.refinery_blog_admin_posts_url,
|
||||||
:hide_delete => true
|
:hide_delete => true
|
||||||
} %>
|
} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue