diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/blog/posts_controller.rb | 8 | ||||
-rw-r--r-- | app/views/blog/posts/_post.html.erb | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb index 8dd8ada..5de6984 100644 --- a/app/controllers/blog/posts_controller.rb +++ b/app/controllers/blog/posts_controller.rb @@ -73,7 +73,13 @@ class Blog::PostsController < BlogController protected def find_blog_post - @blog_post = BlogPost.live.find(params[:id]) + unless (@blog_post = BlogPost.find(params[:id])).try(:live?) + if refinery_user? and current_user.authorized_plugins.include?("refinerycms_blog") + @blog_post = BlogPost.find(params[:id]) + else + error_404 + end + end end def find_all_blog_posts diff --git a/app/views/blog/posts/_post.html.erb b/app/views/blog/posts/_post.html.erb index b3efbe9..6fb8e64 100644 --- a/app/views/blog/posts/_post.html.erb +++ b/app/views/blog/posts/_post.html.erb @@ -26,6 +26,7 @@ <span class="st_sharethis" displayText="ShareThis"></span> <% end %> </article> +<%= render :partial => '/shared/draft_page_message' unless @blog_post.nil? or @blog_post.live? -%> <% if next_or_previous?(@blog_post) -%> <nav id="next_prev_article"> <%= render 'nav' %> |