aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2012-01-17 16:56:03 +1300
committerPhilip Arndt <parndt@gmail.com>2012-01-17 16:56:24 +1300
commitb1e4fd00943a160f3eb6ce242463c0cc07a406fc (patch)
tree07fb750aa580b63d39c23589997956bf3a03594d
parentb3a25c1b686d205fc6b8b409a8f90059ae6b934d (diff)
downloadrefinerycms-blog-b1e4fd00943a160f3eb6ce242463c0cc07a406fc.tar.gz
refinerycms-blog-b1e4fd00943a160f3eb6ce242463c0cc07a406fc.tar.bz2
refinerycms-blog-b1e4fd00943a160f3eb6ce242463c0cc07a406fc.zip
Fixed namespacing for Refinery conventions.
-rw-r--r--Gemfile8
-rw-r--r--Rakefile2
-rw-r--r--app/controllers/refinery/blog/admin/comments_controller.rb18
-rw-r--r--app/controllers/refinery/blog/admin/posts_controller.rb18
-rw-r--r--app/controllers/refinery/blog/admin/settings_controller.rb10
-rw-r--r--app/controllers/refinery/blog/blog_controller.rb (renamed from app/controllers/refinery/blog/base_controller.rb)4
-rw-r--r--app/controllers/refinery/blog/categories_controller.rb6
-rw-r--r--app/controllers/refinery/blog/posts_controller.rb34
-rw-r--r--app/helpers/refinery/blog/controller_helper.rb9
-rw-r--r--app/mailers/refinery/blog/comment_mailer.rb2
-rw-r--r--app/views/refinery/blog/admin/categories/_form.html.erb4
-rw-r--r--app/views/refinery/blog/admin/categories/_sortable_list.html.erb2
-rw-r--r--app/views/refinery/blog/admin/categories/index.html.erb14
-rw-r--r--app/views/refinery/blog/admin/comments/_comment.html.erb2
-rw-r--r--app/views/refinery/blog/admin/comments/_sortable_list.html.erb2
-rw-r--r--app/views/refinery/blog/admin/comments/index.html.erb16
-rw-r--r--app/views/refinery/blog/admin/comments/show.html.erb20
-rw-r--r--app/views/refinery/blog/admin/posts/_form.html.erb38
-rw-r--r--app/views/refinery/blog/admin/posts/_post.html.erb2
-rw-r--r--app/views/refinery/blog/admin/posts/_sortable_list.html.erb2
-rw-r--r--app/views/refinery/blog/admin/posts/_teaser_part.html.erb4
-rw-r--r--app/views/refinery/blog/admin/posts/index.html.erb14
-rw-r--r--app/views/refinery/blog/admin/posts/uncategorized.html.erb12
-rw-r--r--app/views/refinery/blog/admin/settings/notification_recipients.html.erb2
-rw-r--r--app/views/refinery/blog/categories/show.html.erb8
-rw-r--r--app/views/refinery/blog/comment_mailer/notification.html.erb6
-rw-r--r--app/views/refinery/blog/posts/_comments.html.erb4
-rw-r--r--app/views/refinery/blog/posts/_nav.html.erb14
-rw-r--r--app/views/refinery/blog/posts/_post.html.erb18
-rw-r--r--app/views/refinery/blog/posts/archive.html.erb4
-rw-r--r--app/views/refinery/blog/posts/index.html.erb6
-rw-r--r--app/views/refinery/blog/posts/index.rss.builder6
-rw-r--r--app/views/refinery/blog/posts/tagged.html.erb6
-rw-r--r--app/views/refinery/blog/shared/_categories.html.erb8
-rw-r--r--app/views/refinery/blog/shared/_post.html.erb8
-rw-r--r--app/views/refinery/blog/shared/_posts.html.erb6
-rw-r--r--app/views/refinery/blog/shared/_rss_feed.html.erb2
-rw-r--r--app/views/refinery/blog/shared/_tags.html.erb2
-rw-r--r--config/locales/bg.yml5
-rw-r--r--config/locales/cs.yml5
-rw-r--r--config/locales/de.yml5
-rw-r--r--config/locales/en.yml7
-rw-r--r--config/locales/es.yml5
-rw-r--r--config/locales/fr.yml5
-rw-r--r--config/locales/it.yml5
-rw-r--r--config/locales/ja.yml5
-rw-r--r--config/locales/nb.yml4
-rw-r--r--config/locales/nl.yml5
-rw-r--r--config/locales/pl.yml5
-rw-r--r--config/locales/pt-BR.yml5
-rw-r--r--config/locales/ru.yml5
-rw-r--r--config/locales/sk.yml5
-rw-r--r--config/locales/zh-CN.yml5
-rw-r--r--config/routes.rb25
-rw-r--r--lib/refinery/blog/engine.rb2
-rw-r--r--refinerycms-blog.gemspec4
-rw-r--r--spec/lib/refinery/blog/engine_spec.rb6
-rw-r--r--spec/models/refinery/blog/post_spec.rb26
-rw-r--r--spec/requests/refinery/blog/admin/comments_spec.rb5
-rw-r--r--spec/requests/refinery/blog/admin/posts_spec.rb10
-rw-r--r--spec/requests/refinery/blog/categories_spec.rb15
-rw-r--r--spec/requests/refinery/blog/posts_spec.rb29
62 files changed, 259 insertions, 282 deletions
diff --git a/Gemfile b/Gemfile
index 84ec8dc..e55a3f3 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,7 +2,13 @@ source "http://rubygems.org"
gemspec
-gem 'refinerycms', :git => 'git://github.com/resolve/refinerycms.git'
+git 'git://github.com/resolve/refinerycms.git' do
+ gem 'refinerycms'
+
+ group :development, :test do
+ gem 'refinerycms-testing'
+ end
+end
group :development, :test do
require 'rbconfig'
diff --git a/Rakefile b/Rakefile
index de282bd..743f388 100644
--- a/Rakefile
+++ b/Rakefile
@@ -14,6 +14,6 @@ end
require "refinerycms-testing"
Refinery::Testing::Railtie.load_tasks
-#Refinery::Testing::Railtie.load_dummy_tasks(ENGINE_PATH)
+Refinery::Testing::Railtie.load_dummy_tasks(ENGINE_PATH)
load File.expand_path('../tasks/rspec.rake', __FILE__)
diff --git a/app/controllers/refinery/blog/admin/comments_controller.rb b/app/controllers/refinery/blog/admin/comments_controller.rb
index 3128e97..f9addaa 100644
--- a/app/controllers/refinery/blog/admin/comments_controller.rb
+++ b/app/controllers/refinery/blog/admin/comments_controller.rb
@@ -10,20 +10,20 @@ module Refinery
:order => 'published_at DESC'
def index
- @blog_comments = Refinery::Blog::Comment.unmoderated.page(params[:page])
+ @comments = Refinery::Blog::Comment.unmoderated.page(params[:page])
render :action => 'index'
end
def approved
unless params[:id].present?
- @blog_comments = Refinery::Blog::Comment.approved.page(params[:page])
+ @comments = Refinery::Blog::Comment.approved.page(params[:page])
render :action => 'index'
else
- @blog_comment = Refinery::Blog::Comment.find(params[:id])
- @blog_comment.approve!
- flash[:notice] = t('approved', :scope => 'refinery.admin.blog.comments', :author => @blog_comment.name)
+ @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')
end
@@ -31,13 +31,13 @@ module Refinery
def rejected
unless params[:id].present?
- @blog_comments = Refinery::Blog::Comment.rejected.page(params[:page])
+ @comments = Refinery::Blog::Comment.rejected.page(params[:page])
render :action => 'index'
else
- @blog_comment = Refinery::Blog::Comment.find(params[:id])
- @blog_comment.reject!
- flash[:notice] = t('rejected', :scope => 'refinery.admin.blog.comments', :author => @blog_comment.name)
+ @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')
end
diff --git a/app/controllers/refinery/blog/admin/posts_controller.rb b/app/controllers/refinery/blog/admin/posts_controller.rb
index 04ee663..2ed2b98 100644
--- a/app/controllers/refinery/blog/admin/posts_controller.rb
+++ b/app/controllers/refinery/blog/admin/posts_controller.rb
@@ -16,7 +16,7 @@ module Refinery
before_filter :check_category_ids, :only => :update
def uncategorized
- @blog_posts = Refinery::Blog::Post.uncategorized.page(params[:page])
+ @posts = Refinery::Blog::Post.uncategorized.page(params[:page])
end
def tags
@@ -35,21 +35,21 @@ module Refinery
end
def new
- @blog_post = ::Refinery::Blog::Post.new(:author => current_refinery_user)
+ @post = ::Refinery::Blog::Post.new(:author => current_refinery_user)
end
def create
# if the position field exists, set this object as last object, given the conditions of this class.
if Refinery::Blog::Post.column_names.include?("position")
- params[:blog_post].merge!({
+ params[:post].merge!({
:position => ((Refinery::Blog::Post.maximum(:position, :conditions => "")||-1) + 1)
})
end
- if (@blog_post = Refinery::Blog::Post.create(params[:blog_post])).valid?
+ if (@post = Refinery::Blog::Post.create(params[:post])).valid?
(request.xhr? ? flash.now : flash).notice = t(
'refinery.crudify.created',
- :what => "'#{@blog_post.title}'"
+ :what => "'#{@post.title}'"
)
unless from_dialog?
@@ -63,7 +63,7 @@ module Refinery
end
end
else
- render :text => "<script>parent.window.location = '#{admin_blog_posts_url}';</script>"
+ render :text => "<script>parent.window.location = '#{refinery_blog_admin_posts_url}';</script>"
end
else
unless request.xhr?
@@ -71,7 +71,7 @@ module Refinery
else
render :partial => "/refinery/admin/error_messages",
:locals => {
- :object => @blog_post,
+ :object => @post,
:include_object_name => true
}
end
@@ -80,11 +80,11 @@ module Refinery
protected
def find_all_categories
- @blog_categories = Refinery::Blog::Category.find(:all)
+ @categories = Refinery::Blog::Category.find(:all)
end
def check_category_ids
- params[:blog_post][:category_ids] ||= []
+ params[:post][:category_ids] ||= []
end
end
end
diff --git a/app/controllers/refinery/blog/admin/settings_controller.rb b/app/controllers/refinery/blog/admin/settings_controller.rb
index afa6b2b..34a8d00 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(admin_blog_posts_path)
+ redirect_back_or_default(refinery_blog_admin_posts_path)
else
- render :text => "<script type='text/javascript'>parent.window.location = '#{admin_blog_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(admin_blog_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(admin_blog_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(admin_blog_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/base_controller.rb b/app/controllers/refinery/blog/blog_controller.rb
index 919c180..54a8b03 100644
--- a/app/controllers/refinery/blog/base_controller.rb
+++ b/app/controllers/refinery/blog/blog_controller.rb
@@ -1,7 +1,7 @@
module Refinery
module Blog
- class BaseController < ::ApplicationController
-
+ class BlogController < ::ApplicationController
+
include ControllerHelper
helper :'refinery/blog/posts'
diff --git a/app/controllers/refinery/blog/categories_controller.rb b/app/controllers/refinery/blog/categories_controller.rb
index 60c8346..467726e 100644
--- a/app/controllers/refinery/blog/categories_controller.rb
+++ b/app/controllers/refinery/blog/categories_controller.rb
@@ -1,10 +1,10 @@
module Refinery
module Blog
- class CategoriesController < BaseController
+ class CategoriesController < BlogController
def show
- @blog_category = Refinery::Blog::Category.find(params[:id])
- @blog_posts = @blog_category.posts.live.includes(:comments, :categories).page(params[:page])
+ @category = Refinery::Blog::Category.find(params[:id])
+ @posts = @category.posts.live.includes(:comments, :categories).page(params[:page])
end
end
diff --git a/app/controllers/refinery/blog/posts_controller.rb b/app/controllers/refinery/blog/posts_controller.rb
index 1c8cffd..d680150 100644
--- a/app/controllers/refinery/blog/posts_controller.rb
+++ b/app/controllers/refinery/blog/posts_controller.rb
@@ -1,6 +1,6 @@
module Refinery
module Blog
- class PostsController < BaseController
+ class PostsController < BlogController
caches_page :index
@@ -12,41 +12,41 @@ module Refinery
def index
# Rss feeders are greedy. Let's give them every blog post instead of paginating.
- (@blog_posts = Refinery::Blog::Post.live.includes(:comments, :categories).all) if request.format.rss?
- respond_with (@blog_posts) do |format|
+ (@posts = Post.live.includes(:comments, :categories).all) if request.format.rss?
+ respond_with (@posts) do |format|
format.html
format.rss
end
end
def show
- @blog_comment = Refinery::Blog::Comment.new
+ @comment = Comment.new
@canonical = url_for(:locale => ::Refinery::I18n.default_frontend_locale) if canonical?
- respond_with (@blog_post) do |format|
- format.html { present(@blog_post) }
+ respond_with (@post) do |format|
+ format.html { present(@post) }
format.js { render :partial => 'post', :layout => false }
end
end
def comment
- if (@blog_comment = @blog_post.comments.create(params[:blog_comment])).valid?
- if Refinery::Blog::Comment::Moderation.enabled? or @blog_comment.ham?
+ if (@comment = @post.comments.create(params[comment])).valid?
+ if Comment::Moderation.enabled? or @comment.ham?
begin
- Refinery::Blog::CommentMailer.notification(@blog_comment, request).deliver
+ CommentMailer.notification(@comment, request).deliver
rescue
logger.warn "There was an error delivering a blog comment notification.\n#{$!}\n"
end
end
- if Refinery::Blog::Comment::Moderation.enabled?
+ if Comment::Moderation.enabled?
flash[:notice] = t('thank_you_moderated', :scope => 'refinery.blog.posts.comments')
- redirect_to main_app.blog_post_url(params[:id])
+ redirect_to main_app.refinery_blog_post_url(params[:id])
else
flash[:notice] = t('thank_you', :scope => 'refinery.blog.posts.comments')
- redirect_to main_app.blog_post_url(params[:id],
- :anchor => "comment-#{@blog_comment.to_param}")
+ redirect_to main_app.refinery_blog_post_url(params[:id],
+ :anchor => "comment-#{@comment.to_param}")
end
else
render :action => 'show'
@@ -58,20 +58,20 @@ module Refinery
date = "#{params[:month]}/#{params[:year]}"
@archive_date = Time.parse(date)
@date_title = @archive_date.strftime('%B %Y')
- @blog_posts = Refinery::Blog::Post.live.by_archive(@archive_date).page(params[:page])
+ @posts = Post.live.by_archive(@archive_date).page(params[:page])
else
date = "01/#{params[:year]}"
@archive_date = Time.parse(date)
@date_title = @archive_date.strftime('%Y')
- @blog_posts = Refinery::Blog::Post.live.by_year(@archive_date).page(params[:page])
+ @posts = Post.live.by_year(@archive_date).page(params[:page])
end
- respond_with (@blog_posts)
+ respond_with (@posts)
end
def tagged
@tag = ActsAsTaggableOn::Tag.find(params[:tag_id])
@tag_name = @tag.name
- @blog_posts = Refinery::Blog::Post.tagged_with(@tag_name).page(params[:page])
+ @posts = Post.tagged_with(@tag_name).page(params[:page])
end
def canonical?
diff --git a/app/helpers/refinery/blog/controller_helper.rb b/app/helpers/refinery/blog/controller_helper.rb
index 035275c..bf4926b 100644
--- a/app/helpers/refinery/blog/controller_helper.rb
+++ b/app/helpers/refinery/blog/controller_helper.rb
@@ -5,9 +5,9 @@ module Refinery
protected
def find_blog_post
- unless (@blog_post = Refinery::Blog::Post.find(params[:id])).try(:live?)
+ unless (@post = Refinery::Blog::Post.find(params[:id])).try(:live?)
if refinery_user? and current_refinery_user.authorized_plugins.include?("refinerycms_blog")
- @blog_post = Refinery::Blog::Post.find(params[:id])
+ @post = Refinery::Blog::Post.find(params[:id])
else
error_404
end
@@ -15,15 +15,14 @@ module Refinery
end
def find_all_blog_posts
- @blog_posts = Refinery::Blog::Post.live.includes(:comments, :categories).page(params[:page])
+ @posts = Refinery::Blog::Post.live.includes(:comments, :categories).page(params[:page])
end
def find_tags
@tags = Refinery::Blog::Post.tag_counts_on(:tags)
end
-
def find_all_blog_categories
- @blog_categories = Refinery::Blog::Category.all
+ @categories = Refinery::Blog::Category.all
end
end
end
diff --git a/app/mailers/refinery/blog/comment_mailer.rb b/app/mailers/refinery/blog/comment_mailer.rb
index 6f17f81..5b0ce7a 100644
--- a/app/mailers/refinery/blog/comment_mailer.rb
+++ b/app/mailers/refinery/blog/comment_mailer.rb
@@ -3,7 +3,7 @@ module Refinery
class CommentMailer < ActionMailer::Base
def notification(comment, request)
- @blog_comment = comment
+ @comment = comment
mail :subject => Blog::Comment::Notification.subject,
:recipients => Blog::Comment::Notification.recipients,
:from => "\"#{Refinery::Core.config.site_name}\" <no-reply@#{request.domain}>"
diff --git a/app/views/refinery/blog/admin/categories/_form.html.erb b/app/views/refinery/blog/admin/categories/_form.html.erb
index a5d3de3..90eed5d 100644
--- a/app/views/refinery/blog/admin/categories/_form.html.erb
+++ b/app/views/refinery/blog/admin/categories/_form.html.erb
@@ -1,4 +1,4 @@
-<%= form_for [main_app, :refinery_admin, @blog_category] do |f| -%>
+<%= form_for [main_app, :refinery_admin, @category] do |f| -%>
<%= render :partial => "/refinery/admin/error_messages",
:locals => {
:object => f.object,
@@ -14,6 +14,6 @@
:locals => {
:f => f,
:continue_editing => false,
- :delete_title => t('delete', :scope => 'refinery.admin.blog.categories.category')
+ :delete_title => t('delete', :scope => 'refinery.blog.admin.categories.category')
} %>
<% end %>
diff --git a/app/views/refinery/blog/admin/categories/_sortable_list.html.erb b/app/views/refinery/blog/admin/categories/_sortable_list.html.erb
index f4e8641..8040dc0 100644
--- a/app/views/refinery/blog/admin/categories/_sortable_list.html.erb
+++ b/app/views/refinery/blog/admin/categories/_sortable_list.html.erb
@@ -1,5 +1,5 @@
<ul id='sortable_list'>
- <%= render :partial => 'category', :collection => @blog_categories %>
+ <%= render :partial => 'category', :collection => @categories %>
</ul>
<%= render :partial => "/refinery/admin/sortable_list",
:locals => {
diff --git a/app/views/refinery/blog/admin/categories/index.html.erb b/app/views/refinery/blog/admin/categories/index.html.erb
index 4ad59ab..2e4313e 100644
--- a/app/views/refinery/blog/admin/categories/index.html.erb
+++ b/app/views/refinery/blog/admin/categories/index.html.erb
@@ -1,25 +1,25 @@
-<%= render :partial => '/refinery/admin/blog/submenu' %>
+<%= render :partial => '/refinery/blog/admin/submenu' %>
<div id='records'>
<% if searching? %>
<h2><%= t('results_for', :scope => 'refinery.admin.search',
:query => params[:search]) %></h2>
- <% if @blog_categories.any? %>
+ <% if @categories.any? %>
<%= render :partial => "blog_categories",
- :collection => @blog_categories %>
+ :collection => @categories %>
<% else %>
<p><%= t('no_results', :scope => 'refinery.admin.search') %></p>
<% end %>
<% else %>
- <% if @blog_categories.any? %>
- <%= will_paginate @blog_categories %>
+ <% if @categories.any? %>
+ <%= will_paginate @categories %>
<%= render :partial => "sortable_list" %>
- <%= will_paginate @blog_categories %>
+ <%= will_paginate @categories %>
<% else %>
<p>
<strong>
- <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.admin.blog.submenu.categories')) %>
+ <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.blog.admin.submenu.categories')) %>
</strong>
</p>
<% end %>
diff --git a/app/views/refinery/blog/admin/comments/_comment.html.erb b/app/views/refinery/blog/admin/comments/_comment.html.erb
index 51f2996..f4a7a16 100644
--- a/app/views/refinery/blog/admin/comments/_comment.html.erb
+++ b/app/views/refinery/blog/admin/comments/_comment.html.erb
@@ -5,7 +5,7 @@
</span>
<span class='actions'>
<%= link_to refinery_icon_tag("application_go.png"),
- main_app.blog_post_path(comment.post, :anchor => "comment-#{comment.to_param}"),
+ main_app.refinery_blog_post_path(comment.post, :anchor => "comment-#{comment.to_param}"),
:title => t('.view_live_html'),
:target => "_blank" unless comment.unmoderated? %>
<%= link_to refinery_icon_tag('zoom.png'), main_app.refinery_blog_admin_comment_path(comment),
diff --git a/app/views/refinery/blog/admin/comments/_sortable_list.html.erb b/app/views/refinery/blog/admin/comments/_sortable_list.html.erb
index f781ba1..9f8bbbc 100644
--- a/app/views/refinery/blog/admin/comments/_sortable_list.html.erb
+++ b/app/views/refinery/blog/admin/comments/_sortable_list.html.erb
@@ -1,5 +1,5 @@
<ul id='sortable_list'>
- <%= render :partial => 'comment', :collection => @blog_comments %>
+ <%= render :partial => 'comment', :collection => @comments %>
</ul>
<%= render :partial => "/refinery/admin/sortable_list",
:locals => {
diff --git a/app/views/refinery/blog/admin/comments/index.html.erb b/app/views/refinery/blog/admin/comments/index.html.erb
index 059ef59..991980d 100644
--- a/app/views/refinery/blog/admin/comments/index.html.erb
+++ b/app/views/refinery/blog/admin/comments/index.html.erb
@@ -1,26 +1,26 @@
-<%= render :partial => '/refinery/admin/blog/submenu' %>
+<%= render :partial => '/refinery/blog/admin/submenu' %>
<div id='records'>
<% if searching? %>
<h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
- <% if @blog_comments.any? %>
- <%= will_paginate @blog_comments %>
+ <% if @comments.any? %>
+ <%= will_paginate @comments %>
<ul>
<%= render :partial => "blog_comments",
- :collection => @blog_comments %>
+ :collection => @comments %>
</ul>
- <%= will_paginate @blog_comments %>
+ <%= will_paginate @comments %>
<% else %>
<p><%= t('search_no_results', :scope => 'admin') %></p>
<% end %>
<% else %>
- <% if @blog_comments.any? %>
- <%= will_paginate @blog_comments %>
+ <% if @comments.any? %>
+ <%= will_paginate @comments %>
<%= render :partial => "sortable_list" %>
- <%= will_paginate @blog_comments %>
+ <%= will_paginate @comments %>
<% else %>
<h3>
<%= t('.no_items_yet',
diff --git a/app/views/refinery/blog/admin/comments/show.html.erb b/app/views/refinery/blog/admin/comments/show.html.erb
index 2aa75f1..df04b3e 100644
--- a/app/views/refinery/blog/admin/comments/show.html.erb
+++ b/app/views/refinery/blog/admin/comments/show.html.erb
@@ -1,7 +1,7 @@
<div id='actions'>
<h2><%= t('.details')%></h2>
<p>
- <strong><%= t('.age') %>:</strong> <%= time_ago_in_words(@blog_comment.created_at) %>
+ <strong><%= t('.age') %>:</strong> <%= time_ago_in_words(@comment.created_at) %>
</p>
<h2><%= t('.actions') %></h2>
<ul>
@@ -9,12 +9,12 @@
<%= link_to t('.back'), main_app.refinery_blog_admin_comments_path, :class => "back_icon" %>
</li>
<li>
- <%= link_to t('.reject'), main_app.rejected_refinery_blog_admin_comment_path(@blog_comment, :return_to => 'rejected'),
- :class => 'comment_cross_icon' unless @blog_comment.rejected? %>
+ <%= link_to t('.reject'), main_app.rejected_refinery_blog_admin_comment_path(@comment, :return_to => 'rejected'),
+ :class => 'comment_cross_icon' unless @comment.rejected? %>
</li>
<li>
- <%= link_to t('.approve'), main_app.approved_refinery_blog_admin_comment_path(@blog_comment, :return_to => 'approved'),
- :class => 'comment_tick_icon' unless @blog_comment.approved? %>
+ <%= link_to t('.approve'), main_app.approved_refinery_blog_admin_comment_path(@comment, :return_to => 'approved'),
+ :class => 'comment_tick_icon' unless @comment.approved? %>
</li>
</ul>
</div>
@@ -26,8 +26,8 @@
<strong><%= t('.blog_post') %></strong>
</td>
<td>
- <%= link_to @blog_comment.post.title,
- main_app.blog_post_path(@blog_comment.post, :anchor => "comment-#{@blog_comment.to_param}"),
+ <%= link_to @comment.post.title,
+ main_app.refinery_blog_post_path(@comment.post, :anchor => "comment-#{@comment.to_param}"),
:target => '_blank' %>
</td>
</tr>
@@ -36,7 +36,7 @@
<strong><%= t('.from') %></strong>
</td>
<td>
- <%= @blog_comment.name %> [<%= mail_to @blog_comment.email, @blog_comment.email, {:title => t('.click_to_email')} %>]
+ <%= @comment.name %> [<%= mail_to @comment.email, @comment.email, {:title => t('.click_to_email')} %>]
</td>
</tr>
<tr>
@@ -44,7 +44,7 @@
<strong><%= t('.date') %></strong>
</td>
<td>
- <%= l(Date.parse(@blog_comment.created_at.to_s), :format => :long) %>
+ <%= l(Date.parse(@comment.created_at.to_s), :format => :long) %>
</td>
</tr>
<tr>
@@ -53,7 +53,7 @@
</td>
<td>
<p style='margin-top: 0px'>
- <%= @blog_comment.message.gsub("\r\n\r\n", "\r\n").gsub("\r\n", "</p><p>") %>
+ <%= @comment.message.gsub("\r\n\r\n", "\r\n").gsub("\r\n", "</p><p>") %>
</p>
</td>
</tr>
diff --git a/app/views/refinery/blog/admin/posts/_form.html.erb b/app/views/refinery/blog/admin/posts/_form.html.erb
index 656c9c6..a33baeb 100644
--- a/app/views/refinery/blog/admin/posts/_form.html.erb
+++ b/app/views/refinery/blog/admin/posts/_form.html.erb
@@ -1,4 +1,4 @@
-<%= form_for [main_app, :refinery_admin, @blog_post] do |f| -%>
+<%= form_for [main_app, :refinery_blog_admin, @post] do |f| -%>
<%= render :partial => "/refinery/admin/error_messages",
:locals => {
:object => f.object,
@@ -25,33 +25,25 @@
</li>
<% end %>
</ul>
-
+
<div id='page_part_editors'>
<% part_index = -1 %>
- <%= render :partial => 'form_part',
- :locals => {
- :f => f,
- :part_index => (part_index += 1),
- } -%>
- <%= render :partial => 'teaser_part',
- :locals => {
- :f => f,
- :part_index => (part_index += 1),
- } if f.object.respond_to?(:custom_teaser) -%>
+ <%= render 'form_part', :f => f, :part_index => (part_index += 1) -%>
+ <%= render 'teaser_part', :f => f, :part_index => (part_index += 1) if f.object.respond_to?(:custom_teaser) -%>
<% Refinery::Blog.tabs.each_with_index do |tab, tab_index| %>
<div class='page_part' id='<%= "custom_tab_#{tab_index}" %>'>
- <%= render :partial => tab.partial, :locals => {:f => f} %>
+ <%= render tab.partial, :f => f %>
</div>
<% end %>
</div>
</div>
</div>
-
+
<div class='field'>
<%= f.label :tag_list, t('refinery.blog.shared.tags.title') -%>
<%= f.text_field :tag_list, :class => 'larger' -%>
</div>
-
+
<div id='more_options_field'>
<p>
<%= link_to t('.advanced_options'), "#",
@@ -65,14 +57,14 @@
</div>
<div id='more_options' style="display:none;">
<div class="hemisquare">
- <h3><%= t('title', :scope => 'refinery.admin.blog.submenu.categories') %></h3>
+ <h3><%= t('title', :scope => 'refinery.blog.admin.submenu.categories') %></h3>
<ul class='blog_categories'>
- <% @blog_categories.each do |category| %>
+ <% @categories.each do |category| %>
<li>
- <%= check_box_tag 'blog_post[category_ids][]', category.id,
- @blog_post.categories.include?(category),
- :id => (id="blog_post_category_ids_#{category.id}") %>
- <%= label_tag 'blog_post[category_ids][]', category.title,
+ <%= check_box_tag 'post[category_ids][]', category.id,
+ @post.categories.include?(category),
+ :id => (id="post_category_ids_#{category.id}") %>
+ <%= label_tag 'post[category_ids][]', category.title,
:class => 'stripped',
:for => id %>
</li>
@@ -100,14 +92,14 @@
</div>
<div class='hemisquare right_side'>
- <%= render :partial => '/seo_meta/form', :locals => {:form => f} %>
+ <%= render '/seo_meta/form', :form => f %>
</div>
</div>
<%= render :partial => "/refinery/admin/form_actions",
:locals => {
:f => f,
:continue_editing => true,
- :delete_title => t('delete', :scope => 'refinery.admin.blog.posts.post')
+ :delete_title => t('delete', :scope => 'refinery.blog.admin.posts.post')
} %>
<% end -%>
diff --git a/app/views/refinery/blog/admin/posts/_post.html.erb b/app/views/refinery/blog/admin/posts/_post.html.erb
index c8baa80..887c830 100644
--- a/app/views/refinery/blog/admin/posts/_post.html.erb
+++ b/app/views/refinery/blog/admin/posts/_post.html.erb
@@ -7,7 +7,7 @@
</span>
</span>
<span class='actions'>
- <%= link_to refinery_icon_tag("application_go.png"), main_app.blog_post_path(post),
+ <%= link_to refinery_icon_tag("application_go.png"), main_app.refinery_blog_post_path(post),
:title => t('.view_live_html'),
:target => "_blank" %>
<%= link_to refinery_icon_tag("application_edit.png"), main_app.edit_refinery_blog_admin_post_path(post),
diff --git a/app/views/refinery/blog/admin/posts/_sortable_list.html.erb b/app/views/refinery/blog/admin/posts/_sortable_list.html.erb
index 18d12cc..471d4f0 100644
--- a/app/views/refinery/blog/admin/posts/_sortable_list.html.erb
+++ b/app/views/refinery/blog/admin/posts/_sortable_list.html.erb
@@ -1,5 +1,5 @@
<ul id='sortable_list'>
- <%= render :partial => 'post', :collection => @blog_posts %>
+ <%= render :partial => 'post', :collection => @posts %>
</ul>
<%= render :partial => "/refinery/admin/sortable_list",
:locals => {
diff --git a/app/views/refinery/blog/admin/posts/_teaser_part.html.erb b/app/views/refinery/blog/admin/posts/_teaser_part.html.erb
index dc9186a..461a10c 100644
--- a/app/views/refinery/blog/admin/posts/_teaser_part.html.erb
+++ b/app/views/refinery/blog/admin/posts/_teaser_part.html.erb
@@ -2,9 +2,9 @@
<%= f.text_area :custom_teaser, :rows => 20, :class => 'wymeditor widest' -%>
<p>
<span class='clearfix label_inline_with_link'>
- <%= link_to t('copy_body', :scope => 'refinery.admin.blog.posts.form'), "#",
+ <%= link_to t('copy_body', :scope => 'refinery.blog.admin.posts.form'), "#",
:id => 'copy_body_link',
- :title => t('copy_body_help', :scope => 'refinery.admin.blog.posts.form') %>
+ :title => t('copy_body_help', :scope => 'refinery.blog.admin.posts.form') %>
</span>
</p>
</div>
diff --git a/app/views/refinery/blog/admin/posts/index.html.erb b/app/views/refinery/blog/admin/posts/index.html.erb
index 922353c..8db926a 100644
--- a/app/views/refinery/blog/admin/posts/index.html.erb
+++ b/app/views/refinery/blog/admin/posts/index.html.erb
@@ -1,26 +1,26 @@
-<%= render :partial => '/refinery/admin/blog/submenu' %>
+<%= render :partial => '/refinery/blog/admin/submenu' %>
<div id='records'>
<% if searching? %>
<h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
- <% if @blog_posts.any? %>
+ <% if @posts.any? %>
<ul>
<%= render :partial => "post",
- :collection => @blog_posts %>
+ :collection => @posts %>
</ul>
<% else %>
<p><%= t('no_results', :scope => 'refinery.admin.search') %></p>
<% end %>
<% else %>
- <% if @blog_posts.any? %>
- <%= will_paginate @blog_posts %>
+ <% if @posts.any? %>
+ <%= will_paginate @posts %>
<%= render :partial => "sortable_list" %>
- <%= will_paginate @blog_posts %>
+ <%= will_paginate @posts %>
<% else %>
<p>
<strong>
- <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.admin.blog.submenu.posts')) %>
+ <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.blog.admin.submenu.posts')) %>
</strong>
</p>
<% end %>
diff --git a/app/views/refinery/blog/admin/posts/uncategorized.html.erb b/app/views/refinery/blog/admin/posts/uncategorized.html.erb
index 030e789..1b3a512 100644
--- a/app/views/refinery/blog/admin/posts/uncategorized.html.erb
+++ b/app/views/refinery/blog/admin/posts/uncategorized.html.erb
@@ -1,21 +1,21 @@
-<%= render :partial => '/refinery/admin/blog/submenu' %>
+<%= render :partial => '/refinery/blog/admin/submenu' %>
<div id='records'>
<% if searching? %>
<h2><%= t('results_for', :scope => 'refinery.admin.search',
:query => params[:search]) %></h2>
- <% if @blog_posts.any? %>
+ <% if @posts.any? %>
<%= render :partial => "blog_posts",
- :collection => @blog_posts %>
+ :collection => @posts %>
<% else %>
<p><%= t('no_results', :scope => 'refinery.admin.search') %></p>
<% end %>
<% else %>
- <% if @blog_posts.any? %>
- <%= will_paginate @blog_posts %>
+ <% if @posts.any? %>
+ <%= will_paginate @posts %>
<%= render :partial => "sortable_list" %>
- <%= will_paginate @blog_posts %>
+ <%= will_paginate @posts %>
<% else %>
<p>
<strong>
diff --git a/app/views/refinery/blog/admin/settings/notification_recipients.html.erb b/app/views/refinery/blog/admin/settings/notification_recipients.html.erb
index d321ded..af2650d 100644
--- a/app/views/refinery/blog/admin/settings/notification_recipients.html.erb
+++ b/app/views/refinery/blog/admin/settings/notification_recipients.html.erb
@@ -18,7 +18,7 @@
:locals => {
:f => nil,
:continue_editing => false,
- :cancel_url => admin_blog_posts_url,
+ :cancel_url => refinery_blog_admin_posts_url,
:hide_delete => true
} %>
<% end %>
diff --git a/app/views/refinery/blog/categories/show.html.erb b/app/views/refinery/blog/categories/show.html.erb
index 00d9596..aa4abaf 100644
--- a/app/views/refinery/blog/categories/show.html.erb
+++ b/app/views/refinery/blog/categories/show.html.erb
@@ -1,10 +1,10 @@
-<% content_for :body_content_title, @blog_category.title %>
+<% content_for :body_content_title, @category.title %>
<% content_for :body_content_left do %>
- <% if @blog_posts.any? %>
+ <% if @posts.any? %>
<section id="blog_posts">
- <%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %>
- <%= will_paginate @blog_posts %>
+ <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %>
+ <%= will_paginate @posts %>
</section>
<% else %>
<p>
diff --git a/app/views/refinery/blog/comment_mailer/notification.html.erb b/app/views/refinery/blog/comment_mailer/notification.html.erb
index cfadb67..a129d34 100644
--- a/app/views/refinery/blog/comment_mailer/notification.html.erb
+++ b/app/views/refinery/blog/comment_mailer/notification.html.erb
@@ -4,10 +4,10 @@
<%=raw t('.comment_starts') %>
-<%=raw t('.from') %>: <%= @blog_comment.name %>
-<%=raw t('.email') %>: <%= @blog_comment.email %>
+<%=raw t('.from') %>: <%= @comment.name %>
+<%=raw t('.email') %>: <%= @comment.email %>
<%=raw t('.message') %>:
-<%=simple_format strip_tags(@blog_comment.body) %>
+<%=simple_format strip_tags(@comment.body) %>
<%=raw t('.comment_ends') %>
diff --git a/app/views/refinery/blog/posts/_comments.html.erb b/app/views/refinery/blog/posts/_comments.html.erb
index 9bc0a13..a34d106 100644
--- a/app/views/refinery/blog/posts/_comments.html.erb
+++ b/app/views/refinery/blog/posts/_comments.html.erb
@@ -1,6 +1,6 @@
<aside id="comments">
<h2><%= t('title', :scope => 'refinery.blog.posts.show.comments') %></h2>
- <% if (comments = @blog_post.comments.approved).any? %>
+ <% if (comments = @post.comments.approved).any? %>
<%= render :partial => "comment", :collection => comments %>
<% else %>
<p>
@@ -15,7 +15,7 @@
<% end %>
<h2><%= t('add', :scope => 'refinery.blog.posts.show.comments') %></h2>
- <%= form_for [main_app, :blog_post, @blog_comment] do |f| %>
+ <%= form_for [main_app, :refinery_blog, @comment] do |f| %>
<%= render :partial => "/refinery/admin/error_messages",
:locals => {
:object => f.object,
diff --git a/app/views/refinery/blog/posts/_nav.html.erb b/app/views/refinery/blog/posts/_nav.html.erb
index 67aed14..8734638 100644
--- a/app/views/refinery/blog/posts/_nav.html.erb
+++ b/app/views/refinery/blog/posts/_nav.html.erb
@@ -1,17 +1,17 @@
<nav id="next_prev_article">
- <% if @blog_post.next.present? -%>
- <%= link_to (truncate(@blog_post.next.title) + " &#187;").html_safe,
- main_app.url_for(@blog_post.next),
+ <% if @post.next.present? -%>
+ <%= link_to (truncate(@post.next.title) + " &#187;").html_safe,
+ main_app.url_for(@post.next),
:class => 'next' %>
<% end -%>
<%= link_to t('blog_home', :scope => 'refinery.blog.posts.show'),
- main_app.blog_root_path,
+ main_app.refinery_blog_root_path,
:class => 'home' %>
- <% if @blog_post.prev.present? -%>
- <%= link_to ("&#171; " + truncate(@blog_post.prev.title)).html_safe,
- main_app.url_for(@blog_post.prev),
+ <% if @post.prev.present? -%>
+ <%= link_to ("&#171; " + truncate(@post.prev.title)).html_safe,
+ main_app.url_for(@post.prev),
:class => 'prev' %>
<% end -%>
</nav><!-- /next_prev_article -->
diff --git a/app/views/refinery/blog/posts/_post.html.erb b/app/views/refinery/blog/posts/_post.html.erb
index cbecc5f..020ba41 100644
--- a/app/views/refinery/blog/posts/_post.html.erb
+++ b/app/views/refinery/blog/posts/_post.html.erb
@@ -5,27 +5,27 @@
<% end %>
<article id="blog_post">
<header>
- <h1><%= @blog_post.title %></h1>
+ <h1><%= @post.title %></h1>
<section class='details'>
- <time datetime="<%=l @blog_post.published_at.to_date, :format => :default %>" class='posted_at'>
- <%= t('created_at', :scope => 'refinery.blog.shared.posts', :when => l(@blog_post.published_at.to_date, :format => :short)) %>
+ <time datetime="<%=l @post.published_at.to_date, :format => :default %>" class='posted_at'>
+ <%= t('created_at', :scope => 'refinery.blog.shared.posts', :when => l(@post.published_at.to_date, :format => :short)) %>
</time>
- <%= "#{t('by', :scope => 'refinery.blog.posts.show')} #{@blog_post.author.username}" if @blog_post.author.present? %>.
- <% if (categories = @blog_post.categories).any? %>
+ <%= "#{t('by', :scope => 'refinery.blog.posts.show')} #{@post.author.username}" if @post.author.present? %>.
+ <% if (categories = @post.categories).any? %>
<aside class='filed_in'>
<%= t('filed_in', :scope => 'refinery.blog.posts.show') %>
<% categories.each_with_index do |category, index| %>
- <%= link_to category.title, main_app.blog_category_path(category) -%><%= ',' if index < ((categories.length) - 1) %>
+ <%= link_to category.title, main_app.refinery_blog_category_path(category) -%><%= ',' if index < ((categories.length) - 1) %>
<% end %>
</aside>
<% end %>
</section>
</header>
- <%= @blog_post.body.html_safe %>
+ <%= @post.body.html_safe %>
<% if Refinery::Blog::Post::ShareThis.enabled? %>
<span class="st_sharethis" displayText="ShareThis"></span>
<% end %>
</article>
-<%= render :partial => '/refinery/draft_page_message' unless @blog_post.nil? or @blog_post.live? -%>
-<%= render 'nav' if next_or_previous?(@blog_post) %>
+<%= render :partial => '/refinery/draft_page_message' unless @post.nil? or @post.live? -%>
+<%= render 'nav' if next_or_previous?(@post) %>
diff --git a/app/views/refinery/blog/posts/archive.html.erb b/app/views/refinery/blog/posts/archive.html.erb
index 01e3748..bda6c45 100644
--- a/app/views/refinery/blog/posts/archive.html.erb
+++ b/app/views/refinery/blog/posts/archive.html.erb
@@ -2,9 +2,9 @@
<% content_for :body_content_left do %>
<h1><%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %></h1>
- <% if @blog_posts.any? %>
+ <% if @posts.any? %>
<section id="blog_posts">
- <%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %>
+ <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %>
</section>
<% else %>
<p><%= t('.no_blog_articles_posted', :date => @archive_date.strftime('%B %Y')) %></p>
diff --git a/app/views/refinery/blog/posts/index.html.erb b/app/views/refinery/blog/posts/index.html.erb
index f5f12b8..36c007b 100644
--- a/app/views/refinery/blog/posts/index.html.erb
+++ b/app/views/refinery/blog/posts/index.html.erb
@@ -1,10 +1,10 @@
<% content_for :body_content_left do %>
<%= raw @page.content_for(::Refinery::Pages.config.default_parts.first.to_sym) if ::Refinery::Pages.config.default_parts.any? %>
- <% if @blog_posts.any? %>
+ <% if @posts.any? %>
<section id="blog_posts">
- <%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %>
- <%= will_paginate @blog_posts %>
+ <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %>
+ <%= will_paginate @posts %>
</section>
<% else %>
<p><%= t('.no_blog_articles_yet') %></p>
diff --git a/app/views/refinery/blog/posts/index.rss.builder b/app/views/refinery/blog/posts/index.rss.builder
index 609816a..99ae0eb 100644
--- a/app/views/refinery/blog/posts/index.rss.builder
+++ b/app/views/refinery/blog/posts/index.rss.builder
@@ -3,14 +3,14 @@ xml.rss :version => "2.0" do
xml.channel do
xml.title Refinery::Core.config.site_name
xml.description Refinery::Core.config.site_name + " Blog Posts"
- xml.link main_app.blog_root_url
+ xml.link main_app.refinery_blog_root_url
- @blog_posts.each do |post|
+ @posts.each do |post|
xml.item do
xml.title post.title
xml.description post.body
xml.pubDate post.published_at.to_s(:rfc822)
- xml.link main_app.blog_post_url(post)
+ xml.link main_app.refinery_blog_post_url(post)
end
end
end
diff --git a/app/views/refinery/blog/posts/tagged.html.erb b/app/views/refinery/blog/posts/tagged.html.erb
index 468401a..3a3ee75 100644
--- a/app/views/refinery/blog/posts/tagged.html.erb
+++ b/app/views/refinery/blog/posts/tagged.html.erb
@@ -3,10 +3,10 @@
<% content_for :body_content_title, "#{t('.posts_tagged')} &#8220;#{@tag_name.titleize}&#8221;".html_safe -%>
<% content_for :body_content_left do %>
- <% if @blog_posts.any? %>
+ <% if @posts.any? %>
<section id="blog_posts">
- <%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %>
- <%= will_paginate @blog_posts %>
+ <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %>
+ <%= will_paginate @posts %>
</section>
<% else %>
<p><%= t('.no_blog_articles_yet') %></p>
diff --git a/app/views/refinery/blog/shared/_categories.html.erb b/app/views/refinery/blog/shared/_categories.html.erb
index 1280cd2..d7524ef 100644
--- a/app/views/refinery/blog/shared/_categories.html.erb
+++ b/app/views/refinery/blog/shared/_categories.html.erb
@@ -1,9 +1,9 @@
-<% if @blog_categories.any? %>
+<% if @categories.any? %>
<h2><%= t('.title') %></h2>
<ul id='categories'>
- <% @blog_categories.each do |category| %>
- <li<%= " class='selected'" if @blog_category.present? and @blog_category.id == category.id %>>
- <%= link_to "#{category.title} (#{category.post_count})", main_app.blog_category_path(category) %>
+ <% @categories.each do |category| %>
+ <li<%= " class='selected'" if @category.present? and @category.id == category.id %>>
+ <%= link_to "#{category.title} (#{category.post_count})", main_app.refinery_blog_category_path(category) %>
</li>
<% end %>
</ul>
diff --git a/app/views/refinery/blog/shared/_post.html.erb b/app/views/refinery/blog/shared/_post.html.erb
index c384bcb..279de92 100644
--- a/app/views/refinery/blog/shared/_post.html.erb
+++ b/app/views/refinery/blog/shared/_post.html.erb
@@ -1,7 +1,7 @@
<% if post.live? %>
<article class="blog_post" id="<%= dom_id(post) %>">
<header>
- <h1><%= link_to post.title, main_app.blog_post_path(post) %></h1>
+ <h1><%= link_to post.title, main_app.refinery_blog_post_path(post) %></h1>
<section class='details'>
<time datetime="<%=l post.published_at.to_date, :format => :default %>" class='posted_at'>
<%= t('created_at', :scope => 'refinery.blog.shared.posts', :when => l(post.published_at.to_date, :format => :short)) %>
@@ -10,13 +10,13 @@
<% if (categories = post.categories).any? %>
<aside class='filed_in'>
<%= t('filed_in', :scope => 'refinery.blog.posts.show') %>
- <%=raw categories.collect { |category| link_to category.title, main_app.blog_category_path(category) }.to_sentence %>
+ <%=raw categories.collect { |category| link_to category.title, main_app.refinery_blog_category_path(category) }.to_sentence %>
</aside>
<% end %>
<% if (tags = post.tags).any? %>
<aside class='tagged'>
<%= t('tagged', :scope => 'refinery.blog.posts.show') %>
- <%=raw tags.collect { |tag| link_to tag, main_app.tagged_posts_path(tag.id, tag.name.parameterize) }.to_sentence %>
+ <%=raw tags.collect { |tag| link_to tag, main_app.refinery_blog_tagged_posts_path(tag.id, tag.name.parameterize) }.to_sentence %>
</aside>
<% end %>
</section>
@@ -30,7 +30,7 @@
</section>
<footer>
<p>
- <%= link_to t('read_more', :scope => 'refinery.blog.shared.posts'), main_app.blog_post_path(post) if blog_post_teaser_enabled? %>
+ <%= link_to t('read_more', :scope => 'refinery.blog.shared.posts'), main_app.refinery_blog_post_path(post) if blog_post_teaser_enabled? %>
</p>
<aside class='comment_count'>
<% if Refinery::Blog::Post.comments_allowed? %>
diff --git a/app/views/refinery/blog/shared/_posts.html.erb b/app/views/refinery/blog/shared/_posts.html.erb
index 7dc570b..f71cd2a 100644
--- a/app/views/refinery/blog/shared/_posts.html.erb
+++ b/app/views/refinery/blog/shared/_posts.html.erb
@@ -1,9 +1,9 @@
-<% if @blog_posts.many? %>
+<% if @posts.many? %>
<h2><%= t('.other') %></h2>
<ul id="blog_posts">
- <% @blog_posts.each do |blog_post| %>
+ <% @posts.each do |blog_post| %>
<li class='clearfix'>
- <%= link_to blog_post.title, main_app.blog_post_path(blog_post) %>
+ <%= link_to blog_post.title, main_app.refinery_blog_post_path(blog_post) %>
</li>
<% end %>
</ul>
diff --git a/app/views/refinery/blog/shared/_rss_feed.html.erb b/app/views/refinery/blog/shared/_rss_feed.html.erb
index 5ece5ae..5620f85 100644
--- a/app/views/refinery/blog/shared/_rss_feed.html.erb
+++ b/app/views/refinery/blog/shared/_rss_feed.html.erb
@@ -1,2 +1,2 @@
<h2><%= t('.title') %></h2>
-<%= link_to t('.subscribe'), main_app.blog_rss_feed_path, :id => "rss_feed_subscribe"%>
+<%= link_to t('.subscribe'), main_app.refinery_blog_rss_feed_path, :id => "rss_feed_subscribe"%>
diff --git a/app/views/refinery/blog/shared/_tags.html.erb b/app/views/refinery/blog/shared/_tags.html.erb
index 5a72b81..f35900c 100644
--- a/app/views/refinery/blog/shared/_tags.html.erb
+++ b/app/views/refinery/blog/shared/_tags.html.erb
@@ -2,7 +2,7 @@
<h2><%= t('.title') %></h2>
<nav id='tags'>
<% tag_cloud(@tags, %w(tag1 tag2 tag3 tag4)) do |tag, css_class| %>
- <%= link_to tag.name, main_app.tagged_posts_path(tag.id, tag.name.parameterize), :class => css_class %>
+ <%= link_to tag.name, main_app.refinery_blog_tagged_posts_path(tag.id, tag.name.parameterize), :class => css_class %>
<% end %>
</nav>
<% end %> \ No newline at end of file
diff --git a/config/locales/bg.yml b/config/locales/bg.yml
index f7ed37c..400aa8a 100644
--- a/config/locales/bg.yml
+++ b/config/locales/bg.yml
@@ -3,8 +3,8 @@ bg:
plugins:
refinerycms_blog:
title: Блог
- admin:
- blog:
+ blog:
+ admin:
categories:
category:
edit: Редактиране на тази категория
@@ -80,7 +80,6 @@ bg:
moderation: Модерация
update_notified: Получатели на уведомления
comments: Коментари
- blog:
comment_mailer:
notification:
greeting: Здравейте
diff --git a/config/locales/cs.yml b/config/locales/cs.yml
index 10f02b6..28b0fb4 100644
--- a/config/locales/cs.yml
+++ b/config/locales/cs.yml
@@ -3,8 +3,8 @@ cs:
plugins:
refinerycms_blog:
title: Blog
- admin:
- blog:
+ blog:
+ admin:
categories:
category:
edit: Upravit kategorii
@@ -76,7 +76,6 @@ cs:
moderation: Moderování
update_notified: Upravit seznam notifikovaných
comments: Komentáře
- blog:
comment_mailer:
notification:
greeting: Ahoj
diff --git a/config/locales/de.yml b/config/locales/de.yml
index 7b96846..30cdc54 100644
--- a/config/locales/de.yml
+++ b/config/locales/de.yml
@@ -3,8 +3,8 @@ de:
plugins:
refinerycms_blog:
title: Blog
- admin:
- blog:
+ blog:
+ admin:
categories:
category:
edit: Diese Kategorie bearbeiten
@@ -76,7 +76,6 @@ de:
moderation: Moderation
update_notified: Empfänger für Benachrichtigungen bearbeiten
comments: Kommentare
- blog:
comment_mailer:
notification:
greeting: Hallo
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 3aa2b68..64d4064 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -3,8 +3,8 @@ en:
plugins:
refinerycms_blog:
title: Blog
- admin:
- blog:
+ blog:
+ admin:
categories:
category:
edit: Edit this category
@@ -83,7 +83,6 @@ en:
update_notified: Update who gets notified
comments: Comments
teasers: Teasers
- blog:
comment_mailer:
notification:
greeting: Hi there
@@ -143,7 +142,7 @@ en:
posts_tagged: Posts tagged
archive:
blog_archive_for: 'Archive for %{date}'
- no_blog_articles_posted: 'There are no blog articles posted for %{date}. Stay tuned.'
+ no_blog_articles_posted: 'There are no blog articles posted for %{date}. Stay tuned.'
activerecord:
models:
refinery/blog_category: Category
diff --git a/config/locales/es.yml b/config/locales/es.yml
index fb22854..8c275a7 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -3,8 +3,8 @@ es:
plugins:
refinerycms_blog:
title: Blog
- admin:
- blog:
+ blog:
+ admin:
categories:
category:
edit: Editar esta categoría
@@ -76,7 +76,6 @@ es:
moderation: Moderación
update_notified: '¿Quién recibe las notificaciones?'
comments: Comentarios
- blog:
comment_mailer:
notification:
greeting: Hola
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index 33027da..661dd9f 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -3,8 +3,8 @@ fr:
plugins:
refinerycms_blog:
title: Blog
- admin:
- blog:
+ blog:
+ admin:
categories:
category:
edit: Modifier cette catégorie
@@ -76,7 +76,6 @@ fr:
moderation: Modération
update_notified: Mettre à jour les personnes à notifier
comments: Commentaires
- blog:
comment_mailer:
notification:
greeting: Bonjour
diff --git a/config/locales/it.yml b/config/locales/it.yml
index 58cc41c..11fa53a 100644
--- a/config/locales/it.yml
+++ b/config/locales/it.yml
@@ -3,8 +3,8 @@ it:
plugins:
refinerycms_blog:
title: Blog
- admin:
- blog:
+ blog:
+ admin:
categories:
category:
edit: Modifica questa categoria
@@ -80,7 +80,6 @@ it:
moderation: Moderazione
update_notified: Aggiornare i destinatari delle notifiche
comments: Commenti
- blog:
comment_mailer:
notification:
greeting: Ciao
diff --git a/config/locales/ja.yml b/config/locales/ja.yml
index 65508ce..1ffd25f 100644
--- a/config/locales/ja.yml
+++ b/config/locales/ja.yml
@@ -3,8 +3,8 @@ ja:
plugins:
refinerycms_blog:
title: ブログ
- admin:
- blog:
+ blog:
+ admin:
categories:
category:
edit: このカテゴリを編集
@@ -80,7 +80,6 @@ ja:
moderation: 管理する
update_notified: 通知者を変更・更新する
comments: コメント
- blog:
comment_mailer:
notification:
greeting: こんにちわ
diff --git a/config/locales/nb.yml b/config/locales/nb.yml
index 891ea13..5ee8057 100644
--- a/config/locales/nb.yml
+++ b/config/locales/nb.yml
@@ -3,8 +3,8 @@ nb:
plugins:
refinerycms_blog:
title: Blog
- admin:
- blog:
+ blog:
+ admin:
posts:
form:
seo_override_title: Nettleser tittel
diff --git a/config/locales/nl.yml b/config/locales/nl.yml
index ec3edd9..6842d4a 100644
--- a/config/locales/nl.yml
+++ b/config/locales/nl.yml
@@ -3,8 +3,8 @@ nl:
plugins:
refinerycms_blog:
title: Blog
- admin:
- blog:
+ blog:
+ admin:
categories:
category:
edit: Bewerk deze categorie
@@ -77,7 +77,6 @@ nl:
update_notified: Wijzig wie notificaties ontvangt
comments: Reacties
teasers: Teasers
- blog:
comment_mailer:
notification:
greeting: Hallo
diff --git a/config/locales/pl.yml b/config/locales/pl.yml
index 6423d22..ade7e83 100644
--- a/config/locales/pl.yml
+++ b/config/locales/pl.yml
@@ -3,8 +3,8 @@ pl:
plugins:
refinerycms_blog:
title: Blog
- admin:
- blog:
+ blog:
+ admin:
categories:
category:
edit: Edytuj tą kategorię
@@ -76,7 +76,6 @@ pl:
moderation: Wł./wył. moderację
update_notified: Powiadamianie przez e-mail
comments: Komentarze
- blog:
comment_mailer:
notification:
greeting: Witaj:)
diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml
index bf5f914..f5fe701 100644
--- a/config/locales/pt-BR.yml
+++ b/config/locales/pt-BR.yml
@@ -3,8 +3,8 @@ pt-BR:
plugins:
refinerycms_blog:
title: Blog
- admin:
- blog:
+ blog:
+ admin:
categories:
category:
edit: Editar esta categoria
@@ -76,7 +76,6 @@ pt-BR:
moderation: Moderação
update_notified: Quem receberá a notificação?
comments: Comentários
- blog:
comment_mailer:
notification:
greeting: Olá
diff --git a/config/locales/ru.yml b/config/locales/ru.yml
index acde9a9..b6d9d0b 100644
--- a/config/locales/ru.yml
+++ b/config/locales/ru.yml
@@ -3,8 +3,8 @@ ru:
plugins:
refinerycms_blog:
title: Блог
- admin:
- blog:
+ blog:
+ admin:
categories:
category:
edit: Редактировать эту категорию
@@ -76,7 +76,6 @@ ru:
moderation: Модерирование
update_notified: Настроить уведомления
comments: Комментарии
- blog:
comment_mailer:
notification:
greeting: Здравствуйте
diff --git a/config/locales/sk.yml b/config/locales/sk.yml
index d90333f..99888af 100644
--- a/config/locales/sk.yml
+++ b/config/locales/sk.yml
@@ -3,8 +3,8 @@ sk:
plugins:
refinerycms_blog:
title: Blog
- admin:
- blog:
+ blog:
+ admin:
categories:
category:
edit: Upraviť kategóriu
@@ -76,7 +76,6 @@ sk:
moderation: Moderovanie
update_notified: Upraviť zoznam notifikovaných
comments: Komentáre
- blog:
comment_mailer:
notification:
greeting: Ahoj
diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml
index 7d94e4a..894140d 100644
--- a/config/locales/zh-CN.yml
+++ b/config/locales/zh-CN.yml
@@ -3,8 +3,8 @@ zh-CN:
plugins:
refinerycms_blog:
title: 博客
- admin:
- blog:
+ blog:
+ admin:
categories:
category:
edit: 编辑此类别
@@ -76,7 +76,6 @@ zh-CN:
moderation: 等待审核
update_notified: 更新获得通知的人
comments: 评论
- blog:
comment_mailer:
notification:
greeting: 您好
diff --git a/config/routes.rb b/config/routes.rb
index 353d0b8..aa8151e 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,16 +1,23 @@
Rails.application.routes.draw do
- scope(:module => 'refinery') do
- scope(:path => 'blog', :module => 'blog') do
- root :to => 'posts#index', :as => 'blog_root'
- match 'feed.rss', :to => 'posts#index', :as => 'blog_rss_feed', :defaults => {:format => "rss"}
- match ':id', :to => 'posts#show', :as => 'blog_post'
- match 'categories/:id', :to => 'categories#show', :as => 'blog_category'
- match ':id/comments', :to => 'posts#comment', :as => 'blog_post_blog_comments'
+ namespace :refinery, :path => '' do
+ namespace :blog do
+ root :to => "posts#index"
+
+ resources :posts, :only => [:show]
+
+ match 'feed.rss', :to => 'posts#index', :as => 'rss_feed', :defaults => {:format => "rss"}
+ match 'categories/:id', :to => 'categories#show', :as => 'category'
+ match ':id/comments', :to => 'posts#comment', :as => 'comments'
get 'archive/:year(/:month)', :to => 'posts#archive', :as => 'archive_blog_posts'
get 'tagged/:tag_id(/:tag_name)' => 'posts#tagged', :as => 'tagged_posts'
+ end
+ end
+
+ namespace :refinery do
+ namespace :blog do
+ namespace :admin, :path =>'' do
+ root :to => "posts#index"
- scope(:path => 'refinery', :as => 'refinery_admin', :module => 'admin') do
- root :to => 'posts#index'
resources :posts do
collection do
get :uncategorized
diff --git a/lib/refinery/blog/engine.rb b/lib/refinery/blog/engine.rb
index 47ac497..697f048 100644
--- a/lib/refinery/blog/engine.rb
+++ b/lib/refinery/blog/engine.rb
@@ -10,7 +10,7 @@ module Refinery
Refinery::Plugin.register do |plugin|
plugin.pathname = root
plugin.name = "refinerycms_blog"
- plugin.url = app.routes.url_helpers.refinery_blog_admin_posts_path
+ plugin.url = {:controller => 'refinery/blog/admin/posts'}
plugin.menu_match = /refinery\/blog\/?(posts|comments|categories)?/
plugin.activity = {
:class_name => :'refinery/blog/post'
diff --git a/refinerycms-blog.gemspec b/refinerycms-blog.gemspec
index 285f5d4..2473561 100644
--- a/refinerycms-blog.gemspec
+++ b/refinerycms-blog.gemspec
@@ -7,8 +7,8 @@ version = Refinery::Blog::Version.to_s
Gem::Specification.new do |s|
s.name = %q{refinerycms-blog}
s.version = version
- s.description = %q{A really straightforward open source Ruby on Rails blog engine designed for integration with RefineryCMS.}
- s.summary = %q{Ruby on Rails blogging engine for RefineryCMS.}
+ s.description = %q{A really straightforward open source Ruby on Rails blog engine designed for integration with Refinery CMS.}
+ s.summary = %q{Ruby on Rails blogging engine for Refinery CMS.}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com/blog}
s.authors = ['Resolve Digital', 'Neoteric Design']
diff --git a/spec/lib/refinery/blog/engine_spec.rb b/spec/lib/refinery/blog/engine_spec.rb
index eae2c3c..54a7eb5 100644
--- a/spec/lib/refinery/blog/engine_spec.rb
+++ b/spec/lib/refinery/blog/engine_spec.rb
@@ -9,14 +9,14 @@ module Refinery
end
it "sets the correct path for activity entries" do
- activity.url.should eq("edit_refinery_admin_blog_post_path")
+ activity.url.should eq("edit_refinery_blog_admin_post_path")
end
end
describe ".load_seed" do
it "is idempotent" do
- Refinery::Blog::Engine.load_seed
- Refinery::Blog::Engine.load_seed
+ Engine.load_seed
+ Engine.load_seed
Refinery::Page.where(:link_url => '/blog').count.should eq(1)
end
diff --git a/spec/models/refinery/blog/post_spec.rb b/spec/models/refinery/blog/post_spec.rb
index 7167728..60a04ec 100644
--- a/spec/models/refinery/blog/post_spec.rb
+++ b/spec/models/refinery/blog/post_spec.rb
@@ -55,8 +55,8 @@ module Refinery
describe "by_archive scope" do
before do
- @blog_post1 = FactoryGirl.create(:blog_post, :published_at => Date.new(2011, 3, 11))
- @blog_post2 = FactoryGirl.create(:blog_post, :published_at => Date.new(2011, 3, 12))
+ @post1 = FactoryGirl.create(:blog_post, :published_at => Date.new(2011, 3, 11))
+ @post2 = FactoryGirl.create(:blog_post, :published_at => Date.new(2011, 3, 12))
#2 months before
FactoryGirl.create(:blog_post, :published_at => Date.new(2011, 1, 10))
@@ -66,34 +66,34 @@ module Refinery
#check for this month
date = "03/2011"
subject.class.by_archive(Time.parse(date)).count.should be == 2
- subject.class.by_archive(Time.parse(date)).should == [@blog_post2, @blog_post1]
+ subject.class.by_archive(Time.parse(date)).should == [@post2, @post1]
end
end
describe "all_previous scope" do
before do
- @blog_post1 = FactoryGirl.create(:blog_post, :published_at => Time.now - 2.months)
- @blog_post2 = FactoryGirl.create(:blog_post, :published_at => Time.now - 1.month)
+ @post1 = FactoryGirl.create(:blog_post, :published_at => Time.now - 2.months)
+ @post2 = FactoryGirl.create(:blog_post, :published_at => Time.now - 1.month)
FactoryGirl.create(:blog_post, :published_at => Time.now)
end
it "returns all posts from previous months" do
subject.class.all_previous.count.should be == 2
- subject.class.all_previous.should == [@blog_post2, @blog_post1]
+ subject.class.all_previous.should == [@post2, @post1]
end
end
describe "live scope" do
before do
- @blog_post1 = FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -2))
- @blog_post2 = FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -1))
+ @post1 = FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -2))
+ @post2 = FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -1))
FactoryGirl.create(:blog_post, :draft => true)
FactoryGirl.create(:blog_post, :published_at => Time.now + 1.minute)
end
it "returns all posts which aren't in draft and pub date isn't in future" do
subject.class.live.count.should be == 2
- subject.class.live.should == [@blog_post2, @blog_post1]
+ subject.class.live.should == [@post2, @post1]
end
end
@@ -128,22 +128,22 @@ module Refinery
describe "#next" do
before do
FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -1))
- @blog_post = FactoryGirl.create(:blog_post)
+ @post = FactoryGirl.create(:blog_post)
end
it "returns next article when called on current article" do
- subject.class.last.next.should == @blog_post
+ subject.class.last.next.should == @post
end
end
describe "#prev" do
before do
FactoryGirl.create(:blog_post)
- @blog_post = FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -1))
+ @post = FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -1))
end
it "returns previous article when called on current article" do
- subject.class.first.prev.should == @blog_post
+ subject.class.first.prev.should == @post
end
end
diff --git a/spec/requests/refinery/blog/admin/comments_spec.rb b/spec/requests/refinery/blog/admin/comments_spec.rb
index b1a5afe..d56e1f1 100644
--- a/spec/requests/refinery/blog/admin/comments_spec.rb
+++ b/spec/requests/refinery/blog/admin/comments_spec.rb
@@ -19,7 +19,6 @@ module Refinery
page.should have_content('there are no new comments')
end
end
-
context "when has new unapproved comments" do
let!(:blog_comment) { FactoryGirl.create(:blog_comment) }
before(:each) { visit refinery_blog_admin_comments_path }
@@ -54,7 +53,6 @@ module Refinery
page.should have_content('there are no approved comments')
end
end
-
context "when has approved comments" do
let!(:blog_comment) do
FactoryGirl.create(:blog_comment,
@@ -86,7 +84,6 @@ module Refinery
page.should have_content('there are no rejected comments')
end
end
-
context "when has rejected comments" do
let!(:blog_comment) do
FactoryGirl.create(:blog_comment,
@@ -110,12 +107,10 @@ module Refinery
describe "#show" do
let!(:blog_comment) { FactoryGirl.create(:blog_comment) }
before(:each) { visit refinery_blog_admin_comment_path(blog_comment) }
-
it "should display the comment" do
page.should have_content(blog_comment.body)
page.should have_content(blog_comment.name)
end
-
it "should allow me to approve the comment" do
click_link "Approve this comment"
diff --git a/spec/requests/refinery/blog/admin/posts_spec.rb b/spec/requests/refinery/blog/admin/posts_spec.rb
index 6c50c37..219fd13 100644
--- a/spec/requests/refinery/blog/admin/posts_spec.rb
+++ b/spec/requests/refinery/blog/admin/posts_spec.rb
@@ -36,7 +36,7 @@ module Refinery
describe "create blog post" do
before(:each) do
fill_in "Title", :with => "This is my blog post"
- fill_in "blog_post_body", :with => "And I love it"
+ fill_in "post_body", :with => "And I love it"
check blog_category.title
click_button "Save"
end
@@ -53,7 +53,7 @@ module Refinery
subject.class.first.author.should eq(::Refinery::User.last)
end
- it "should save categories" do
+ it "should save categories", :focus => true do
subject.class.last.categories.count.should eq(1)
subject.class.last.categories.first.title.should eq(blog_category.title)
end
@@ -63,7 +63,7 @@ module Refinery
before(:each) do
@tag_list = "chicago, bikes, beers, babes"
fill_in "Title", :with => "This is a tagged blog post"
- fill_in "blog_post_body", :with => "And I also love it"
+ fill_in "post_body", :with => "And I also love it"
fill_in "Tags", :with => @tag_list
click_button "Save"
end
@@ -118,7 +118,7 @@ module Refinery
it "redirects to blog post in the frontend" do
click_link "View this blog post live"
- current_path.should == blog_post_path(blog_post)
+ current_path.should == refinery_blog_post_path(blog_post)
page.should have_content(blog_post.title)
end
end
@@ -151,7 +151,7 @@ module Refinery
click_link "Create new post"
fill_in "Title", :with => "This is some other guy's blog post"
- fill_in "blog_post_body", :with => "I totally didn't write it."
+ fill_in "post_body", :with => "I totally didn't write it."
click_link "Advanced Options"
diff --git a/spec/requests/refinery/blog/categories_spec.rb b/spec/requests/refinery/blog/categories_spec.rb
index 48a3417..022d251 100644
--- a/spec/requests/refinery/blog/categories_spec.rb
+++ b/spec/requests/refinery/blog/categories_spec.rb
@@ -3,18 +3,17 @@ require "spec_helper"
module Refinery
describe "BlogCategories" do
login_refinery_user
-
+
context "has one category and post" do
before(:each) do
- @blog_post = FactoryGirl.create(:blog_post, :title => "Refinery CMS blog post")
- @blog_category = FactoryGirl.create(:blog_category, :title => "Video Games")
- @blog_post.categories << @blog_category
- @blog_post.save!
+ @post = FactoryGirl.create(:blog_post, :title => "Refinery CMS blog post")
+ @category = FactoryGirl.create(:blog_category, :title => "Video Games")
+ @post.categories << @category
+ @post.save!
end
-
+
describe "show categories blog posts" do
- before(:each) { visit blog_category_path(@blog_category) }
-
+ before(:each) { visit refinery_blog_category_path(@category) }
it "should displays categories blog posts" do
page.should have_content("Refinery CMS blog post")
page.should have_content("Video Games")
diff --git a/spec/requests/refinery/blog/posts_spec.rb b/spec/requests/refinery/blog/posts_spec.rb
index f2c94b0..71a90f7 100644
--- a/spec/requests/refinery/blog/posts_spec.rb
+++ b/spec/requests/refinery/blog/posts_spec.rb
@@ -8,13 +8,13 @@ module Refinery
let!(:blog_post) { FactoryGirl.create(:blog_post, :title => "Refinery CMS blog post") }
it "should display blog post" do
- visit blog_post_path(blog_post)
+ visit refinery_blog_post_path(blog_post)
page.should have_content(blog_post.title)
end
it "should display the blog rss feed" do
- get blog_rss_feed_path
+ get refinery_blog_rss_feed_path
response.should be_success
response.content_type.should eq("application/rss+xml")
@@ -25,17 +25,16 @@ module Refinery
context "when has tagged blog posts" do
before(:each) do
@tag_name = "chicago"
- @blog_post = FactoryGirl.create(:blog_post,
+ @post = FactoryGirl.create(:blog_post,
:title => "I Love my city",
:tag_list => @tag_name)
@tag = ::Refinery::Blog::Post.tag_counts_on(:tags).first
end
-
it "should have one tagged post" do
- visit tagged_posts_path(@tag.id, @tag_name.parameterize)
+ visit refinery_blog_tagged_posts_path(@tag.id, @tag_name.parameterize)
page.should have_content(@tag_name)
- page.should have_content(@blog_post.title)
+ page.should have_content(@post.title)
end
end
end
@@ -45,39 +44,35 @@ module Refinery
let(:blog_post) { FactoryGirl.create(:blog_post) }
it "should display the blog post" do
- visit blog_post_path(blog_post)
-
+ visit refinery_blog_post_path(blog_post)
page.should have_content(blog_post.title)
page.should have_content(blog_post.body)
end
end
-
context "when has approved comments" do
let(:approved_comment) { FactoryGirl.create(:approved_comment) }
it "should display the comments" do
- visit blog_post_path(approved_comment.post)
+ visit refinery_blog_post_path(approved_comment.post)
page.should have_content(approved_comment.body)
page.should have_content("Posted by #{approved_comment.name}")
end
end
-
context "when has rejected comments" do
let(:rejected_comment) { FactoryGirl.create(:rejected_comment) }
it "should not display the comments" do
- visit blog_post_path(rejected_comment.post)
+ visit refinery_blog_post_path(rejected_comment.post)
page.should_not have_content(rejected_comment.body)
end
end
-
context "when has new comments" do
let(:blog_comment) { FactoryGirl.create(:blog_comment) }
it "should not display the comments" do
- visit blog_post_path(blog_comment.post)
+ visit refinery_blog_post_path(blog_comment.post)
page.should_not have_content(blog_comment.body)
end
@@ -86,20 +81,18 @@ module Refinery
describe "#show draft preview" do
let(:blog_post) { FactoryGirl.create(:blog_post_draft) }
-
context "when logged in as admin" do
it "should display the draft notification" do
- visit blog_post_path(blog_post)
+ visit refinery_blog_post_path(blog_post)
page.should have_content('This page is NOT live for public viewing.')
end
end
-
context "when not logged in as an admin" do
before(:each) { visit destroy_refinery_user_session_path }
it "should not display the blog post" do
- visit blog_post_path(blog_post)
+ visit refinery_blog_post_path(blog_post)
page.should have_content("The page you were looking for doesn't exist (404)")
end