diff options
Diffstat (limited to 'app/controllers/refinery/blog')
4 files changed, 18 insertions, 18 deletions
diff --git a/app/controllers/refinery/blog/admin/comments_controller.rb b/app/controllers/refinery/blog/admin/comments_controller.rb index f9addaa..8565b28 100644 --- a/app/controllers/refinery/blog/admin/comments_controller.rb +++ b/app/controllers/refinery/blog/admin/comments_controller.rb @@ -2,7 +2,7 @@ module Refinery module Blog module Admin class CommentsController < ::Refinery::AdminController - + cache_sweeper Refinery::BlogSweeper crudify :'refinery/blog/comment', @@ -11,35 +11,35 @@ module Refinery def index @comments = Refinery::Blog::Comment.unmoderated.page(params[:page]) - + render :action => 'index' end def approved unless params[:id].present? @comments = Refinery::Blog::Comment.approved.page(params[:page]) - + render :action => 'index' else @comment = Refinery::Blog::Comment.find(params[:id]) @comment.approve! flash[:notice] = t('approved', :scope => 'refinery.blog.admin.comments', :author => @comment.name) - - redirect_to main_app.url_for(:action => params[:return_to] || 'index') + + redirect_to refinery.url_for(:action => params[:return_to] || 'index', :id => nil) end end def rejected unless params[:id].present? @comments = Refinery::Blog::Comment.rejected.page(params[:page]) - + render :action => 'index' else @comment = Refinery::Blog::Comment.find(params[:id]) @comment.reject! flash[:notice] = t('rejected', :scope => 'refinery.blog.admin.comments', :author => @comment.name) - - redirect_to main_app.url_for(:action => params[:return_to] || 'index') + + redirect_to refinery.url_for(:action => params[:return_to] || 'index', :id => nil) end end diff --git a/app/controllers/refinery/blog/admin/posts_controller.rb b/app/controllers/refinery/blog/admin/posts_controller.rb index f8d0f8f..5b50c75 100644 --- a/app/controllers/refinery/blog/admin/posts_controller.rb +++ b/app/controllers/refinery/blog/admin/posts_controller.rb @@ -8,7 +8,7 @@ module Refinery crudify :'refinery/blog/post', :title_attribute => :title, :order => 'published_at DESC', - :redirect_to_url => "main_app.refinery_blog_admin_posts_path" + :redirect_to_url => "refinery.blog_admin_posts_path" before_filter :find_all_categories, :only => [:new, :edit, :create, :update] @@ -54,7 +54,7 @@ module Refinery unless from_dialog? unless params[:continue_editing] =~ /true|on|1/ - redirect_back_or_default(main_app.refinery_blog_admin_posts_path) + redirect_back_or_default(refinery.blog_admin_posts_path) else unless request.xhr? redirect_to :back @@ -63,7 +63,7 @@ module Refinery end end else - render :text => "<script>parent.window.location = '#{main_app.refinery_blog_admin_posts_url}';</script>" + render :text => "<script>parent.window.location = '#{refinery.blog_admin_posts_url}';</script>" end else unless request.xhr? diff --git a/app/controllers/refinery/blog/admin/settings_controller.rb b/app/controllers/refinery/blog/admin/settings_controller.rb index e47fe7b..96687ad 100644 --- a/app/controllers/refinery/blog/admin/settings_controller.rb +++ b/app/controllers/refinery/blog/admin/settings_controller.rb @@ -11,9 +11,9 @@ module Refinery flash[:notice] = t('updated', :scope => 'admin.blog.settings.notification_recipients', :recipients => Refinery::Blog::Comment::Notification.recipients) unless request.xhr? or from_dialog? - redirect_back_or_default(main_app.refinery_blog_admin_posts_path) + redirect_back_or_default(refinery.blog_admin_posts_path) else - render :text => "<script type='text/javascript'>parent.window.location = '#{main_app.refinery_blog_admin_posts_path}';</script>", + render :text => "<script type='text/javascript'>parent.window.location = '#{refinery.blog_admin_posts_path}';</script>", :layout => false end end @@ -22,7 +22,7 @@ module Refinery def moderation enabled = Refinery::Blog::Comment::Moderation.toggle! unless request.xhr? - redirect_back_or_default(main_app.refinery_blog_admin_posts_path) + redirect_back_or_default(refinery.blog_admin_posts_path) else render :json => {:enabled => enabled}, :layout => false @@ -32,7 +32,7 @@ module Refinery def comments enabled = Refinery::Blog::Comment.toggle! unless request.xhr? - redirect_back_or_default(main_app.refinery_blog_admin_posts_path) + redirect_back_or_default(refinery.blog_admin_posts_path) else render :json => {:enabled => enabled}, :layout => false @@ -42,7 +42,7 @@ module Refinery def teasers enabled = Refinery::Blog::Post.teaser_enabled_toggle! unless request.xhr? - redirect_back_or_default(main_app.refinery_blog_admin_posts_path) + redirect_back_or_default(refinery.blog_admin_posts_path) else render :json => {:enabled => enabled}, :layout => false diff --git a/app/controllers/refinery/blog/posts_controller.rb b/app/controllers/refinery/blog/posts_controller.rb index 417cf29..abd60f4 100644 --- a/app/controllers/refinery/blog/posts_controller.rb +++ b/app/controllers/refinery/blog/posts_controller.rb @@ -42,10 +42,10 @@ module Refinery if Comment::Moderation.enabled? flash[:notice] = t('thank_you_moderated', :scope => 'refinery.blog.posts.comments') - redirect_to main_app.refinery_blog_post_url(params[:id]) + redirect_to refinery.blog_post_url(params[:id]) else flash[:notice] = t('thank_you', :scope => 'refinery.blog.posts.comments') - redirect_to main_app.refinery_blog_post_url(params[:id], + redirect_to refinery.blog_post_url(params[:id], :anchor => "comment-#{@comment.to_param}") end else |