Fixed namespacing for Refinery conventions.

This commit is contained in:
Philip Arndt 2012-01-17 16:56:03 +13:00
parent b3a25c1b68
commit b1e4fd0094
62 changed files with 259 additions and 282 deletions

View file

@ -2,7 +2,13 @@ source "http://rubygems.org"
gemspec 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 group :development, :test do
require 'rbconfig' require 'rbconfig'

View file

@ -14,6 +14,6 @@ end
require "refinerycms-testing" require "refinerycms-testing"
Refinery::Testing::Railtie.load_tasks 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__) load File.expand_path('../tasks/rspec.rake', __FILE__)

View file

@ -10,20 +10,20 @@ module Refinery
:order => 'published_at DESC' :order => 'published_at DESC'
def index def index
@blog_comments = Refinery::Blog::Comment.unmoderated.page(params[:page]) @comments = Refinery::Blog::Comment.unmoderated.page(params[:page])
render :action => 'index' render :action => 'index'
end end
def approved def approved
unless params[:id].present? unless params[:id].present?
@blog_comments = Refinery::Blog::Comment.approved.page(params[:page]) @comments = Refinery::Blog::Comment.approved.page(params[:page])
render :action => 'index' render :action => 'index'
else else
@blog_comment = Refinery::Blog::Comment.find(params[:id]) @comment = Refinery::Blog::Comment.find(params[:id])
@blog_comment.approve! @comment.approve!
flash[:notice] = t('approved', :scope => 'refinery.admin.blog.comments', :author => @blog_comment.name) 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 main_app.url_for(:action => params[:return_to] || 'index')
end end
@ -31,13 +31,13 @@ module Refinery
def rejected def rejected
unless params[:id].present? unless params[:id].present?
@blog_comments = Refinery::Blog::Comment.rejected.page(params[:page]) @comments = Refinery::Blog::Comment.rejected.page(params[:page])
render :action => 'index' render :action => 'index'
else else
@blog_comment = Refinery::Blog::Comment.find(params[:id]) @comment = Refinery::Blog::Comment.find(params[:id])
@blog_comment.reject! @comment.reject!
flash[:notice] = t('rejected', :scope => 'refinery.admin.blog.comments', :author => @blog_comment.name) 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 main_app.url_for(:action => params[:return_to] || 'index')
end end

View file

@ -16,7 +16,7 @@ module Refinery
before_filter :check_category_ids, :only => :update before_filter :check_category_ids, :only => :update
def uncategorized def uncategorized
@blog_posts = Refinery::Blog::Post.uncategorized.page(params[:page]) @posts = Refinery::Blog::Post.uncategorized.page(params[:page])
end end
def tags def tags
@ -35,21 +35,21 @@ module Refinery
end end
def new def new
@blog_post = ::Refinery::Blog::Post.new(:author => current_refinery_user) @post = ::Refinery::Blog::Post.new(:author => current_refinery_user)
end end
def create def create
# if the position field exists, set this object as last object, given the conditions of this class. # 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") if Refinery::Blog::Post.column_names.include?("position")
params[:blog_post].merge!({ params[:post].merge!({
:position => ((Refinery::Blog::Post.maximum(:position, :conditions => "")||-1) + 1) :position => ((Refinery::Blog::Post.maximum(:position, :conditions => "")||-1) + 1)
}) })
end 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( (request.xhr? ? flash.now : flash).notice = t(
'refinery.crudify.created', 'refinery.crudify.created',
:what => "'#{@blog_post.title}'" :what => "'#{@post.title}'"
) )
unless from_dialog? unless from_dialog?
@ -63,7 +63,7 @@ module Refinery
end end
end end
else 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 end
else else
unless request.xhr? unless request.xhr?
@ -71,7 +71,7 @@ module Refinery
else else
render :partial => "/refinery/admin/error_messages", render :partial => "/refinery/admin/error_messages",
:locals => { :locals => {
:object => @blog_post, :object => @post,
:include_object_name => true :include_object_name => true
} }
end end
@ -80,11 +80,11 @@ module Refinery
protected protected
def find_all_categories def find_all_categories
@blog_categories = Refinery::Blog::Category.find(:all) @categories = Refinery::Blog::Category.find(:all)
end end
def check_category_ids def check_category_ids
params[:blog_post][:category_ids] ||= [] params[:post][:category_ids] ||= []
end end
end end
end end

View file

@ -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(admin_blog_posts_path) redirect_back_or_default(refinery_blog_admin_posts_path)
else 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 :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(admin_blog_posts_path) redirect_back_or_default(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(admin_blog_posts_path) redirect_back_or_default(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(admin_blog_posts_path) redirect_back_or_default(refinery_blog_admin_posts_path)
else else
render :json => {:enabled => enabled}, render :json => {:enabled => enabled},
:layout => false :layout => false

View file

@ -1,7 +1,7 @@
module Refinery module Refinery
module Blog module Blog
class BaseController < ::ApplicationController class BlogController < ::ApplicationController
include ControllerHelper include ControllerHelper
helper :'refinery/blog/posts' helper :'refinery/blog/posts'

View file

@ -1,10 +1,10 @@
module Refinery module Refinery
module Blog module Blog
class CategoriesController < BaseController class CategoriesController < BlogController
def show def show
@blog_category = Refinery::Blog::Category.find(params[:id]) @category = Refinery::Blog::Category.find(params[:id])
@blog_posts = @blog_category.posts.live.includes(:comments, :categories).page(params[:page]) @posts = @category.posts.live.includes(:comments, :categories).page(params[:page])
end end
end end

View file

@ -1,6 +1,6 @@
module Refinery module Refinery
module Blog module Blog
class PostsController < BaseController class PostsController < BlogController
caches_page :index caches_page :index
@ -12,41 +12,41 @@ module Refinery
def index def index
# Rss feeders are greedy. Let's give them every blog post instead of paginating. # 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? (@posts = Post.live.includes(:comments, :categories).all) if request.format.rss?
respond_with (@blog_posts) do |format| respond_with (@posts) do |format|
format.html format.html
format.rss format.rss
end end
end end
def show def show
@blog_comment = Refinery::Blog::Comment.new @comment = Comment.new
@canonical = url_for(:locale => ::Refinery::I18n.default_frontend_locale) if canonical? @canonical = url_for(:locale => ::Refinery::I18n.default_frontend_locale) if canonical?
respond_with (@blog_post) do |format| respond_with (@post) do |format|
format.html { present(@blog_post) } format.html { present(@post) }
format.js { render :partial => 'post', :layout => false } format.js { render :partial => 'post', :layout => false }
end end
end end
def comment def comment
if (@blog_comment = @blog_post.comments.create(params[:blog_comment])).valid? if (@comment = @post.comments.create(params[comment])).valid?
if Refinery::Blog::Comment::Moderation.enabled? or @blog_comment.ham? if Comment::Moderation.enabled? or @comment.ham?
begin begin
Refinery::Blog::CommentMailer.notification(@blog_comment, request).deliver CommentMailer.notification(@comment, request).deliver
rescue rescue
logger.warn "There was an error delivering a blog comment notification.\n#{$!}\n" logger.warn "There was an error delivering a blog comment notification.\n#{$!}\n"
end end
end end
if Refinery::Blog::Comment::Moderation.enabled? if Comment::Moderation.enabled?
flash[:notice] = t('thank_you_moderated', :scope => 'refinery.blog.posts.comments') 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 else
flash[:notice] = t('thank_you', :scope => 'refinery.blog.posts.comments') flash[:notice] = t('thank_you', :scope => 'refinery.blog.posts.comments')
redirect_to main_app.blog_post_url(params[:id], redirect_to main_app.refinery_blog_post_url(params[:id],
:anchor => "comment-#{@blog_comment.to_param}") :anchor => "comment-#{@comment.to_param}")
end end
else else
render :action => 'show' render :action => 'show'
@ -58,20 +58,20 @@ module Refinery
date = "#{params[:month]}/#{params[:year]}" date = "#{params[:month]}/#{params[:year]}"
@archive_date = Time.parse(date) @archive_date = Time.parse(date)
@date_title = @archive_date.strftime('%B %Y') @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 else
date = "01/#{params[:year]}" date = "01/#{params[:year]}"
@archive_date = Time.parse(date) @archive_date = Time.parse(date)
@date_title = @archive_date.strftime('%Y') @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 end
respond_with (@blog_posts) respond_with (@posts)
end end
def tagged def tagged
@tag = ActsAsTaggableOn::Tag.find(params[:tag_id]) @tag = ActsAsTaggableOn::Tag.find(params[:tag_id])
@tag_name = @tag.name @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 end
def canonical? def canonical?

View file

@ -5,9 +5,9 @@ module Refinery
protected protected
def find_blog_post 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") 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 else
error_404 error_404
end end
@ -15,15 +15,14 @@ module Refinery
end end
def find_all_blog_posts 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 end
def find_tags def find_tags
@tags = Refinery::Blog::Post.tag_counts_on(:tags) @tags = Refinery::Blog::Post.tag_counts_on(:tags)
end end
def find_all_blog_categories def find_all_blog_categories
@blog_categories = Refinery::Blog::Category.all @categories = Refinery::Blog::Category.all
end end
end end
end end

View file

@ -3,7 +3,7 @@ module Refinery
class CommentMailer < ActionMailer::Base class CommentMailer < ActionMailer::Base
def notification(comment, request) def notification(comment, request)
@blog_comment = comment @comment = comment
mail :subject => Blog::Comment::Notification.subject, mail :subject => Blog::Comment::Notification.subject,
:recipients => Blog::Comment::Notification.recipients, :recipients => Blog::Comment::Notification.recipients,
:from => "\"#{Refinery::Core.config.site_name}\" <no-reply@#{request.domain}>" :from => "\"#{Refinery::Core.config.site_name}\" <no-reply@#{request.domain}>"

View file

@ -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", <%= render :partial => "/refinery/admin/error_messages",
:locals => { :locals => {
:object => f.object, :object => f.object,
@ -14,6 +14,6 @@
:locals => { :locals => {
:f => f, :f => f,
:continue_editing => false, :continue_editing => false,
:delete_title => t('delete', :scope => 'refinery.admin.blog.categories.category') :delete_title => t('delete', :scope => 'refinery.blog.admin.categories.category')
} %> } %>
<% end %> <% end %>

View file

@ -1,5 +1,5 @@
<ul id='sortable_list'> <ul id='sortable_list'>
<%= render :partial => 'category', :collection => @blog_categories %> <%= render :partial => 'category', :collection => @categories %>
</ul> </ul>
<%= render :partial => "/refinery/admin/sortable_list", <%= render :partial => "/refinery/admin/sortable_list",
:locals => { :locals => {

View file

@ -1,25 +1,25 @@
<%= render :partial => '/refinery/admin/blog/submenu' %> <%= render :partial => '/refinery/blog/admin/submenu' %>
<div id='records'> <div id='records'>
<% if searching? %> <% if searching? %>
<h2><%= t('results_for', :scope => 'refinery.admin.search', <h2><%= t('results_for', :scope => 'refinery.admin.search',
:query => params[:search]) %></h2> :query => params[:search]) %></h2>
<% if @blog_categories.any? %> <% if @categories.any? %>
<%= render :partial => "blog_categories", <%= render :partial => "blog_categories",
:collection => @blog_categories %> :collection => @categories %>
<% else %> <% else %>
<p><%= t('no_results', :scope => 'refinery.admin.search') %></p> <p><%= t('no_results', :scope => 'refinery.admin.search') %></p>
<% end %> <% end %>
<% else %> <% else %>
<% if @blog_categories.any? %> <% if @categories.any? %>
<%= will_paginate @blog_categories %> <%= will_paginate @categories %>
<%= render :partial => "sortable_list" %> <%= render :partial => "sortable_list" %>
<%= will_paginate @blog_categories %> <%= will_paginate @categories %>
<% else %> <% else %>
<p> <p>
<strong> <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> </strong>
</p> </p>
<% end %> <% end %>

View file

@ -5,7 +5,7 @@
</span> </span>
<span class='actions'> <span class='actions'>
<%= link_to refinery_icon_tag("application_go.png"), <%= 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'), :title => t('.view_live_html'),
:target => "_blank" unless comment.unmoderated? %> :target => "_blank" unless comment.unmoderated? %>
<%= link_to refinery_icon_tag('zoom.png'), main_app.refinery_blog_admin_comment_path(comment), <%= link_to refinery_icon_tag('zoom.png'), main_app.refinery_blog_admin_comment_path(comment),

View file

@ -1,5 +1,5 @@
<ul id='sortable_list'> <ul id='sortable_list'>
<%= render :partial => 'comment', :collection => @blog_comments %> <%= render :partial => 'comment', :collection => @comments %>
</ul> </ul>
<%= render :partial => "/refinery/admin/sortable_list", <%= render :partial => "/refinery/admin/sortable_list",
:locals => { :locals => {

View file

@ -1,26 +1,26 @@
<%= render :partial => '/refinery/admin/blog/submenu' %> <%= render :partial => '/refinery/blog/admin/submenu' %>
<div id='records'> <div id='records'>
<% if searching? %> <% if searching? %>
<h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2> <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
<% if @blog_comments.any? %> <% if @comments.any? %>
<%= will_paginate @blog_comments %> <%= will_paginate @comments %>
<ul> <ul>
<%= render :partial => "blog_comments", <%= render :partial => "blog_comments",
:collection => @blog_comments %> :collection => @comments %>
</ul> </ul>
<%= will_paginate @blog_comments %> <%= will_paginate @comments %>
<% else %> <% else %>
<p><%= t('search_no_results', :scope => 'admin') %></p> <p><%= t('search_no_results', :scope => 'admin') %></p>
<% end %> <% end %>
<% else %> <% else %>
<% if @blog_comments.any? %> <% if @comments.any? %>
<%= will_paginate @blog_comments %> <%= will_paginate @comments %>
<%= render :partial => "sortable_list" %> <%= render :partial => "sortable_list" %>
<%= will_paginate @blog_comments %> <%= will_paginate @comments %>
<% else %> <% else %>
<h3> <h3>
<%= t('.no_items_yet', <%= t('.no_items_yet',

View file

@ -1,7 +1,7 @@
<div id='actions'> <div id='actions'>
<h2><%= t('.details')%></h2> <h2><%= t('.details')%></h2>
<p> <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> </p>
<h2><%= t('.actions') %></h2> <h2><%= t('.actions') %></h2>
<ul> <ul>
@ -9,12 +9,12 @@
<%= link_to t('.back'), main_app.refinery_blog_admin_comments_path, :class => "back_icon" %> <%= link_to t('.back'), main_app.refinery_blog_admin_comments_path, :class => "back_icon" %>
</li> </li>
<li> <li>
<%= link_to t('.reject'), main_app.rejected_refinery_blog_admin_comment_path(@blog_comment, :return_to => 'rejected'), <%= link_to t('.reject'), main_app.rejected_refinery_blog_admin_comment_path(@comment, :return_to => 'rejected'),
:class => 'comment_cross_icon' unless @blog_comment.rejected? %> :class => 'comment_cross_icon' unless @comment.rejected? %>
</li> </li>
<li> <li>
<%= link_to t('.approve'), main_app.approved_refinery_blog_admin_comment_path(@blog_comment, :return_to => 'approved'), <%= link_to t('.approve'), main_app.approved_refinery_blog_admin_comment_path(@comment, :return_to => 'approved'),
:class => 'comment_tick_icon' unless @blog_comment.approved? %> :class => 'comment_tick_icon' unless @comment.approved? %>
</li> </li>
</ul> </ul>
</div> </div>
@ -26,8 +26,8 @@
<strong><%= t('.blog_post') %></strong> <strong><%= t('.blog_post') %></strong>
</td> </td>
<td> <td>
<%= link_to @blog_comment.post.title, <%= link_to @comment.post.title,
main_app.blog_post_path(@blog_comment.post, :anchor => "comment-#{@blog_comment.to_param}"), main_app.refinery_blog_post_path(@comment.post, :anchor => "comment-#{@comment.to_param}"),
:target => '_blank' %> :target => '_blank' %>
</td> </td>
</tr> </tr>
@ -36,7 +36,7 @@
<strong><%= t('.from') %></strong> <strong><%= t('.from') %></strong>
</td> </td>
<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> </td>
</tr> </tr>
<tr> <tr>
@ -44,7 +44,7 @@
<strong><%= t('.date') %></strong> <strong><%= t('.date') %></strong>
</td> </td>
<td> <td>
<%= l(Date.parse(@blog_comment.created_at.to_s), :format => :long) %> <%= l(Date.parse(@comment.created_at.to_s), :format => :long) %>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -53,7 +53,7 @@
</td> </td>
<td> <td>
<p style='margin-top: 0px'> <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> </p>
</td> </td>
</tr> </tr>

View file

@ -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", <%= render :partial => "/refinery/admin/error_messages",
:locals => { :locals => {
:object => f.object, :object => f.object,
@ -25,33 +25,25 @@
</li> </li>
<% end %> <% end %>
</ul> </ul>
<div id='page_part_editors'> <div id='page_part_editors'>
<% part_index = -1 %> <% part_index = -1 %>
<%= render :partial => 'form_part', <%= render 'form_part', :f => f, :part_index => (part_index += 1) -%>
:locals => { <%= render 'teaser_part', :f => f, :part_index => (part_index += 1) if f.object.respond_to?(:custom_teaser) -%>
: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) -%>
<% Refinery::Blog.tabs.each_with_index do |tab, tab_index| %> <% Refinery::Blog.tabs.each_with_index do |tab, tab_index| %>
<div class='page_part' id='<%= "custom_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> </div>
<% end %> <% end %>
</div> </div>
</div> </div>
</div> </div>
<div class='field'> <div class='field'>
<%= f.label :tag_list, t('refinery.blog.shared.tags.title') -%> <%= f.label :tag_list, t('refinery.blog.shared.tags.title') -%>
<%= f.text_field :tag_list, :class => 'larger' -%> <%= f.text_field :tag_list, :class => 'larger' -%>
</div> </div>
<div id='more_options_field'> <div id='more_options_field'>
<p> <p>
<%= link_to t('.advanced_options'), "#", <%= link_to t('.advanced_options'), "#",
@ -65,14 +57,14 @@
</div> </div>
<div id='more_options' style="display:none;"> <div id='more_options' style="display:none;">
<div class="hemisquare"> <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'> <ul class='blog_categories'>
<% @blog_categories.each do |category| %> <% @categories.each do |category| %>
<li> <li>
<%= check_box_tag 'blog_post[category_ids][]', category.id, <%= check_box_tag 'post[category_ids][]', category.id,
@blog_post.categories.include?(category), @post.categories.include?(category),
:id => (id="blog_post_category_ids_#{category.id}") %> :id => (id="post_category_ids_#{category.id}") %>
<%= label_tag 'blog_post[category_ids][]', category.title, <%= label_tag 'post[category_ids][]', category.title,
:class => 'stripped', :class => 'stripped',
:for => id %> :for => id %>
</li> </li>
@ -100,14 +92,14 @@
</div> </div>
<div class='hemisquare right_side'> <div class='hemisquare right_side'>
<%= render :partial => '/seo_meta/form', :locals => {:form => f} %> <%= render '/seo_meta/form', :form => f %>
</div> </div>
</div> </div>
<%= render :partial => "/refinery/admin/form_actions", <%= render :partial => "/refinery/admin/form_actions",
:locals => { :locals => {
:f => f, :f => f,
:continue_editing => true, :continue_editing => true,
:delete_title => t('delete', :scope => 'refinery.admin.blog.posts.post') :delete_title => t('delete', :scope => 'refinery.blog.admin.posts.post')
} %> } %>
<% end -%> <% end -%>

View file

@ -7,7 +7,7 @@
</span> </span>
</span> </span>
<span class='actions'> <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'), :title => t('.view_live_html'),
:target => "_blank" %> :target => "_blank" %>
<%= link_to refinery_icon_tag("application_edit.png"), main_app.edit_refinery_blog_admin_post_path(post), <%= link_to refinery_icon_tag("application_edit.png"), main_app.edit_refinery_blog_admin_post_path(post),

View file

@ -1,5 +1,5 @@
<ul id='sortable_list'> <ul id='sortable_list'>
<%= render :partial => 'post', :collection => @blog_posts %> <%= render :partial => 'post', :collection => @posts %>
</ul> </ul>
<%= render :partial => "/refinery/admin/sortable_list", <%= render :partial => "/refinery/admin/sortable_list",
:locals => { :locals => {

View file

@ -2,9 +2,9 @@
<%= f.text_area :custom_teaser, :rows => 20, :class => 'wymeditor widest' -%> <%= f.text_area :custom_teaser, :rows => 20, :class => 'wymeditor widest' -%>
<p> <p>
<span class='clearfix label_inline_with_link'> <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', :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> </span>
</p> </p>
</div> </div>

View file

@ -1,26 +1,26 @@
<%= render :partial => '/refinery/admin/blog/submenu' %> <%= render :partial => '/refinery/blog/admin/submenu' %>
<div id='records'> <div id='records'>
<% if searching? %> <% if searching? %>
<h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2> <h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
<% if @blog_posts.any? %> <% if @posts.any? %>
<ul> <ul>
<%= render :partial => "post", <%= render :partial => "post",
:collection => @blog_posts %> :collection => @posts %>
</ul> </ul>
<% else %> <% else %>
<p><%= t('no_results', :scope => 'refinery.admin.search') %></p> <p><%= t('no_results', :scope => 'refinery.admin.search') %></p>
<% end %> <% end %>
<% else %> <% else %>
<% if @blog_posts.any? %> <% if @posts.any? %>
<%= will_paginate @blog_posts %> <%= will_paginate @posts %>
<%= render :partial => "sortable_list" %> <%= render :partial => "sortable_list" %>
<%= will_paginate @blog_posts %> <%= will_paginate @posts %>
<% else %> <% else %>
<p> <p>
<strong> <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> </strong>
</p> </p>
<% end %> <% end %>

View file

@ -1,21 +1,21 @@
<%= render :partial => '/refinery/admin/blog/submenu' %> <%= render :partial => '/refinery/blog/admin/submenu' %>
<div id='records'> <div id='records'>
<% if searching? %> <% if searching? %>
<h2><%= t('results_for', :scope => 'refinery.admin.search', <h2><%= t('results_for', :scope => 'refinery.admin.search',
:query => params[:search]) %></h2> :query => params[:search]) %></h2>
<% if @blog_posts.any? %> <% if @posts.any? %>
<%= render :partial => "blog_posts", <%= render :partial => "blog_posts",
:collection => @blog_posts %> :collection => @posts %>
<% else %> <% else %>
<p><%= t('no_results', :scope => 'refinery.admin.search') %></p> <p><%= t('no_results', :scope => 'refinery.admin.search') %></p>
<% end %> <% end %>
<% else %> <% else %>
<% if @blog_posts.any? %> <% if @posts.any? %>
<%= will_paginate @blog_posts %> <%= will_paginate @posts %>
<%= render :partial => "sortable_list" %> <%= render :partial => "sortable_list" %>
<%= will_paginate @blog_posts %> <%= will_paginate @posts %>
<% else %> <% else %>
<p> <p>
<strong> <strong>

View file

@ -18,7 +18,7 @@
:locals => { :locals => {
:f => nil, :f => nil,
:continue_editing => false, :continue_editing => false,
:cancel_url => admin_blog_posts_url, :cancel_url => refinery_blog_admin_posts_url,
:hide_delete => true :hide_delete => true
} %> } %>
<% end %> <% end %>

View file

@ -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 %> <% content_for :body_content_left do %>
<% if @blog_posts.any? %> <% if @posts.any? %>
<section id="blog_posts"> <section id="blog_posts">
<%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %> <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %>
<%= will_paginate @blog_posts %> <%= will_paginate @posts %>
</section> </section>
<% else %> <% else %>
<p> <p>

View file

@ -4,10 +4,10 @@
<%=raw t('.comment_starts') %> <%=raw t('.comment_starts') %>
<%=raw t('.from') %>: <%= @blog_comment.name %> <%=raw t('.from') %>: <%= @comment.name %>
<%=raw t('.email') %>: <%= @blog_comment.email %> <%=raw t('.email') %>: <%= @comment.email %>
<%=raw t('.message') %>: <%=raw t('.message') %>:
<%=simple_format strip_tags(@blog_comment.body) %> <%=simple_format strip_tags(@comment.body) %>
<%=raw t('.comment_ends') %> <%=raw t('.comment_ends') %>

View file

@ -1,6 +1,6 @@
<aside id="comments"> <aside id="comments">
<h2><%= t('title', :scope => 'refinery.blog.posts.show.comments') %></h2> <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 %> <%= render :partial => "comment", :collection => comments %>
<% else %> <% else %>
<p> <p>
@ -15,7 +15,7 @@
<% end %> <% end %>
<h2><%= t('add', :scope => 'refinery.blog.posts.show.comments') %></h2> <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", <%= render :partial => "/refinery/admin/error_messages",
:locals => { :locals => {
:object => f.object, :object => f.object,

View file

@ -1,17 +1,17 @@
<nav id="next_prev_article"> <nav id="next_prev_article">
<% if @blog_post.next.present? -%> <% if @post.next.present? -%>
<%= link_to (truncate(@blog_post.next.title) + " &#187;").html_safe, <%= link_to (truncate(@post.next.title) + " &#187;").html_safe,
main_app.url_for(@blog_post.next), main_app.url_for(@post.next),
:class => 'next' %> :class => 'next' %>
<% end -%> <% end -%>
<%= link_to t('blog_home', :scope => 'refinery.blog.posts.show'), <%= link_to t('blog_home', :scope => 'refinery.blog.posts.show'),
main_app.blog_root_path, main_app.refinery_blog_root_path,
:class => 'home' %> :class => 'home' %>
<% if @blog_post.prev.present? -%> <% if @post.prev.present? -%>
<%= link_to ("&#171; " + truncate(@blog_post.prev.title)).html_safe, <%= link_to ("&#171; " + truncate(@post.prev.title)).html_safe,
main_app.url_for(@blog_post.prev), main_app.url_for(@post.prev),
:class => 'prev' %> :class => 'prev' %>
<% end -%> <% end -%>
</nav><!-- /next_prev_article --> </nav><!-- /next_prev_article -->

View file

@ -5,27 +5,27 @@
<% end %> <% end %>
<article id="blog_post"> <article id="blog_post">
<header> <header>
<h1><%= @blog_post.title %></h1> <h1><%= @post.title %></h1>
<section class='details'> <section class='details'>
<time datetime="<%=l @blog_post.published_at.to_date, :format => :default %>" class='posted_at'> <time datetime="<%=l @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)) %> <%= t('created_at', :scope => 'refinery.blog.shared.posts', :when => l(@post.published_at.to_date, :format => :short)) %>
</time> </time>
<%= "#{t('by', :scope => 'refinery.blog.posts.show')} #{@blog_post.author.username}" if @blog_post.author.present? %>. <%= "#{t('by', :scope => 'refinery.blog.posts.show')} #{@post.author.username}" if @post.author.present? %>.
<% if (categories = @blog_post.categories).any? %> <% if (categories = @post.categories).any? %>
<aside class='filed_in'> <aside class='filed_in'>
<%= t('filed_in', :scope => 'refinery.blog.posts.show') %> <%= t('filed_in', :scope => 'refinery.blog.posts.show') %>
<% categories.each_with_index do |category, index| %> <% 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 %> <% end %>
</aside> </aside>
<% end %> <% end %>
</section> </section>
</header> </header>
<%= @blog_post.body.html_safe %> <%= @post.body.html_safe %>
<% if Refinery::Blog::Post::ShareThis.enabled? %> <% if Refinery::Blog::Post::ShareThis.enabled? %>
<span class="st_sharethis" displayText="ShareThis"></span> <span class="st_sharethis" displayText="ShareThis"></span>
<% end %> <% end %>
</article> </article>
<%= render :partial => '/refinery/draft_page_message' unless @blog_post.nil? or @blog_post.live? -%> <%= render :partial => '/refinery/draft_page_message' unless @post.nil? or @post.live? -%>
<%= render 'nav' if next_or_previous?(@blog_post) %> <%= render 'nav' if next_or_previous?(@post) %>

View file

@ -2,9 +2,9 @@
<% content_for :body_content_left do %> <% content_for :body_content_left do %>
<h1><%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %></h1> <h1><%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %></h1>
<% if @blog_posts.any? %> <% if @posts.any? %>
<section id="blog_posts"> <section id="blog_posts">
<%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %> <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %>
</section> </section>
<% else %> <% else %>
<p><%= t('.no_blog_articles_posted', :date => @archive_date.strftime('%B %Y')) %></p> <p><%= t('.no_blog_articles_posted', :date => @archive_date.strftime('%B %Y')) %></p>

View file

@ -1,10 +1,10 @@
<% content_for :body_content_left do %> <% 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? %> <%= 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"> <section id="blog_posts">
<%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %> <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %>
<%= will_paginate @blog_posts %> <%= will_paginate @posts %>
</section> </section>
<% else %> <% else %>
<p><%= t('.no_blog_articles_yet') %></p> <p><%= t('.no_blog_articles_yet') %></p>

View file

@ -3,14 +3,14 @@ xml.rss :version => "2.0" do
xml.channel do xml.channel do
xml.title Refinery::Core.config.site_name xml.title Refinery::Core.config.site_name
xml.description Refinery::Core.config.site_name + " Blog Posts" 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.item do
xml.title post.title xml.title post.title
xml.description post.body xml.description post.body
xml.pubDate post.published_at.to_s(:rfc822) 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 end
end end

View file

@ -3,10 +3,10 @@
<% content_for :body_content_title, "#{t('.posts_tagged')} &#8220;#{@tag_name.titleize}&#8221;".html_safe -%> <% content_for :body_content_title, "#{t('.posts_tagged')} &#8220;#{@tag_name.titleize}&#8221;".html_safe -%>
<% content_for :body_content_left do %> <% content_for :body_content_left do %>
<% if @blog_posts.any? %> <% if @posts.any? %>
<section id="blog_posts"> <section id="blog_posts">
<%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %> <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %>
<%= will_paginate @blog_posts %> <%= will_paginate @posts %>
</section> </section>
<% else %> <% else %>
<p><%= t('.no_blog_articles_yet') %></p> <p><%= t('.no_blog_articles_yet') %></p>

View file

@ -1,9 +1,9 @@
<% if @blog_categories.any? %> <% if @categories.any? %>
<h2><%= t('.title') %></h2> <h2><%= t('.title') %></h2>
<ul id='categories'> <ul id='categories'>
<% @blog_categories.each do |category| %> <% @categories.each do |category| %>
<li<%= " class='selected'" if @blog_category.present? and @blog_category.id == category.id %>> <li<%= " class='selected'" if @category.present? and @category.id == category.id %>>
<%= link_to "#{category.title} (#{category.post_count})", main_app.blog_category_path(category) %> <%= link_to "#{category.title} (#{category.post_count})", main_app.refinery_blog_category_path(category) %>
</li> </li>
<% end %> <% end %>
</ul> </ul>

View file

@ -1,7 +1,7 @@
<% if post.live? %> <% if post.live? %>
<article class="blog_post" id="<%= dom_id(post) %>"> <article class="blog_post" id="<%= dom_id(post) %>">
<header> <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'> <section class='details'>
<time datetime="<%=l post.published_at.to_date, :format => :default %>" class='posted_at'> <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)) %> <%= 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? %> <% if (categories = post.categories).any? %>
<aside class='filed_in'> <aside class='filed_in'>
<%= t('filed_in', :scope => 'refinery.blog.posts.show') %> <%= 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> </aside>
<% end %> <% end %>
<% if (tags = post.tags).any? %> <% if (tags = post.tags).any? %>
<aside class='tagged'> <aside class='tagged'>
<%= t('tagged', :scope => 'refinery.blog.posts.show') %> <%= 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> </aside>
<% end %> <% end %>
</section> </section>
@ -30,7 +30,7 @@
</section> </section>
<footer> <footer>
<p> <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> </p>
<aside class='comment_count'> <aside class='comment_count'>
<% if Refinery::Blog::Post.comments_allowed? %> <% if Refinery::Blog::Post.comments_allowed? %>

View file

@ -1,9 +1,9 @@
<% if @blog_posts.many? %> <% if @posts.many? %>
<h2><%= t('.other') %></h2> <h2><%= t('.other') %></h2>
<ul id="blog_posts"> <ul id="blog_posts">
<% @blog_posts.each do |blog_post| %> <% @posts.each do |blog_post| %>
<li class='clearfix'> <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> </li>
<% end %> <% end %>
</ul> </ul>

View file

@ -1,2 +1,2 @@
<h2><%= t('.title') %></h2> <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"%>

View file

@ -2,7 +2,7 @@
<h2><%= t('.title') %></h2> <h2><%= t('.title') %></h2>
<nav id='tags'> <nav id='tags'>
<% tag_cloud(@tags, %w(tag1 tag2 tag3 tag4)) do |tag, css_class| %> <% 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 %> <% end %>
</nav> </nav>
<% end %> <% end %>

View file

@ -3,8 +3,8 @@ bg:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: Блог title: Блог
admin: blog:
blog: admin:
categories: categories:
category: category:
edit: Редактиране на тази категория edit: Редактиране на тази категория
@ -80,7 +80,6 @@ bg:
moderation: Модерация moderation: Модерация
update_notified: Получатели на уведомления update_notified: Получатели на уведомления
comments: Коментари comments: Коментари
blog:
comment_mailer: comment_mailer:
notification: notification:
greeting: Здравейте greeting: Здравейте

View file

@ -3,8 +3,8 @@ cs:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: Blog title: Blog
admin: blog:
blog: admin:
categories: categories:
category: category:
edit: Upravit kategorii edit: Upravit kategorii
@ -76,7 +76,6 @@ cs:
moderation: Moderování moderation: Moderování
update_notified: Upravit seznam notifikovaných update_notified: Upravit seznam notifikovaných
comments: Komentáře comments: Komentáře
blog:
comment_mailer: comment_mailer:
notification: notification:
greeting: Ahoj greeting: Ahoj

View file

@ -3,8 +3,8 @@ de:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: Blog title: Blog
admin: blog:
blog: admin:
categories: categories:
category: category:
edit: Diese Kategorie bearbeiten edit: Diese Kategorie bearbeiten
@ -76,7 +76,6 @@ de:
moderation: Moderation moderation: Moderation
update_notified: Empfänger für Benachrichtigungen bearbeiten update_notified: Empfänger für Benachrichtigungen bearbeiten
comments: Kommentare comments: Kommentare
blog:
comment_mailer: comment_mailer:
notification: notification:
greeting: Hallo greeting: Hallo

View file

@ -3,8 +3,8 @@ en:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: Blog title: Blog
admin: blog:
blog: admin:
categories: categories:
category: category:
edit: Edit this category edit: Edit this category
@ -83,7 +83,6 @@ en:
update_notified: Update who gets notified update_notified: Update who gets notified
comments: Comments comments: Comments
teasers: Teasers teasers: Teasers
blog:
comment_mailer: comment_mailer:
notification: notification:
greeting: Hi there greeting: Hi there
@ -143,7 +142,7 @@ en:
posts_tagged: Posts tagged posts_tagged: Posts tagged
archive: archive:
blog_archive_for: 'Archive for %{date}' 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: activerecord:
models: models:
refinery/blog_category: Category refinery/blog_category: Category

View file

@ -3,8 +3,8 @@ es:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: Blog title: Blog
admin: blog:
blog: admin:
categories: categories:
category: category:
edit: Editar esta categoría edit: Editar esta categoría
@ -76,7 +76,6 @@ es:
moderation: Moderación moderation: Moderación
update_notified: '¿Quién recibe las notificaciones?' update_notified: '¿Quién recibe las notificaciones?'
comments: Comentarios comments: Comentarios
blog:
comment_mailer: comment_mailer:
notification: notification:
greeting: Hola greeting: Hola

View file

@ -3,8 +3,8 @@ fr:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: Blog title: Blog
admin: blog:
blog: admin:
categories: categories:
category: category:
edit: Modifier cette catégorie edit: Modifier cette catégorie
@ -76,7 +76,6 @@ fr:
moderation: Modération moderation: Modération
update_notified: Mettre à jour les personnes à notifier update_notified: Mettre à jour les personnes à notifier
comments: Commentaires comments: Commentaires
blog:
comment_mailer: comment_mailer:
notification: notification:
greeting: Bonjour greeting: Bonjour

View file

@ -3,8 +3,8 @@ it:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: Blog title: Blog
admin: blog:
blog: admin:
categories: categories:
category: category:
edit: Modifica questa categoria edit: Modifica questa categoria
@ -80,7 +80,6 @@ it:
moderation: Moderazione moderation: Moderazione
update_notified: Aggiornare i destinatari delle notifiche update_notified: Aggiornare i destinatari delle notifiche
comments: Commenti comments: Commenti
blog:
comment_mailer: comment_mailer:
notification: notification:
greeting: Ciao greeting: Ciao

View file

@ -3,8 +3,8 @@ ja:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: ブログ title: ブログ
admin: blog:
blog: admin:
categories: categories:
category: category:
edit: このカテゴリを編集 edit: このカテゴリを編集
@ -80,7 +80,6 @@ ja:
moderation: 管理する moderation: 管理する
update_notified: 通知者を変更・更新する update_notified: 通知者を変更・更新する
comments: コメント comments: コメント
blog:
comment_mailer: comment_mailer:
notification: notification:
greeting: こんにちわ greeting: こんにちわ

View file

@ -3,8 +3,8 @@ nb:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: Blog title: Blog
admin: blog:
blog: admin:
posts: posts:
form: form:
seo_override_title: Nettleser tittel seo_override_title: Nettleser tittel

View file

@ -3,8 +3,8 @@ nl:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: Blog title: Blog
admin: blog:
blog: admin:
categories: categories:
category: category:
edit: Bewerk deze categorie edit: Bewerk deze categorie
@ -77,7 +77,6 @@ nl:
update_notified: Wijzig wie notificaties ontvangt update_notified: Wijzig wie notificaties ontvangt
comments: Reacties comments: Reacties
teasers: Teasers teasers: Teasers
blog:
comment_mailer: comment_mailer:
notification: notification:
greeting: Hallo greeting: Hallo

View file

@ -3,8 +3,8 @@ pl:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: Blog title: Blog
admin: blog:
blog: admin:
categories: categories:
category: category:
edit: Edytuj tą kategorię edit: Edytuj tą kategorię
@ -76,7 +76,6 @@ pl:
moderation: Wł./wył. moderację moderation: Wł./wył. moderację
update_notified: Powiadamianie przez e-mail update_notified: Powiadamianie przez e-mail
comments: Komentarze comments: Komentarze
blog:
comment_mailer: comment_mailer:
notification: notification:
greeting: Witaj:) greeting: Witaj:)

View file

@ -3,8 +3,8 @@ pt-BR:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: Blog title: Blog
admin: blog:
blog: admin:
categories: categories:
category: category:
edit: Editar esta categoria edit: Editar esta categoria
@ -76,7 +76,6 @@ pt-BR:
moderation: Moderação moderation: Moderação
update_notified: Quem receberá a notificação? update_notified: Quem receberá a notificação?
comments: Comentários comments: Comentários
blog:
comment_mailer: comment_mailer:
notification: notification:
greeting: Olá greeting: Olá

View file

@ -3,8 +3,8 @@ ru:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: Блог title: Блог
admin: blog:
blog: admin:
categories: categories:
category: category:
edit: Редактировать эту категорию edit: Редактировать эту категорию
@ -76,7 +76,6 @@ ru:
moderation: Модерирование moderation: Модерирование
update_notified: Настроить уведомления update_notified: Настроить уведомления
comments: Комментарии comments: Комментарии
blog:
comment_mailer: comment_mailer:
notification: notification:
greeting: Здравствуйте greeting: Здравствуйте

View file

@ -3,8 +3,8 @@ sk:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: Blog title: Blog
admin: blog:
blog: admin:
categories: categories:
category: category:
edit: Upraviť kategóriu edit: Upraviť kategóriu
@ -76,7 +76,6 @@ sk:
moderation: Moderovanie moderation: Moderovanie
update_notified: Upraviť zoznam notifikovaných update_notified: Upraviť zoznam notifikovaných
comments: Komentáre comments: Komentáre
blog:
comment_mailer: comment_mailer:
notification: notification:
greeting: Ahoj greeting: Ahoj

View file

@ -3,8 +3,8 @@ zh-CN:
plugins: plugins:
refinerycms_blog: refinerycms_blog:
title: 博客 title: 博客
admin: blog:
blog: admin:
categories: categories:
category: category:
edit: 编辑此类别 edit: 编辑此类别
@ -76,7 +76,6 @@ zh-CN:
moderation: 等待审核 moderation: 等待审核
update_notified: 更新获得通知的人 update_notified: 更新获得通知的人
comments: 评论 comments: 评论
blog:
comment_mailer: comment_mailer:
notification: notification:
greeting: 您好 greeting: 您好

View file

@ -1,16 +1,23 @@
Rails.application.routes.draw do Rails.application.routes.draw do
scope(:module => 'refinery') do namespace :refinery, :path => '' do
scope(:path => 'blog', :module => 'blog') do namespace :blog do
root :to => 'posts#index', :as => 'blog_root' root :to => "posts#index"
match 'feed.rss', :to => 'posts#index', :as => 'blog_rss_feed', :defaults => {:format => "rss"}
match ':id', :to => 'posts#show', :as => 'blog_post' resources :posts, :only => [:show]
match 'categories/:id', :to => 'categories#show', :as => 'blog_category'
match ':id/comments', :to => 'posts#comment', :as => 'blog_post_blog_comments' 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 'archive/:year(/:month)', :to => 'posts#archive', :as => 'archive_blog_posts'
get 'tagged/:tag_id(/:tag_name)' => 'posts#tagged', :as => 'tagged_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 resources :posts do
collection do collection do
get :uncategorized get :uncategorized

View file

@ -10,7 +10,7 @@ module Refinery
Refinery::Plugin.register do |plugin| Refinery::Plugin.register do |plugin|
plugin.pathname = root plugin.pathname = root
plugin.name = "refinerycms_blog" 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.menu_match = /refinery\/blog\/?(posts|comments|categories)?/
plugin.activity = { plugin.activity = {
:class_name => :'refinery/blog/post' :class_name => :'refinery/blog/post'

View file

@ -7,8 +7,8 @@ version = Refinery::Blog::Version.to_s
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = %q{refinerycms-blog} s.name = %q{refinerycms-blog}
s.version = version s.version = version
s.description = %q{A really straightforward open source Ruby on Rails blog engine designed for integration with 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 RefineryCMS.} s.summary = %q{Ruby on Rails blogging engine for Refinery CMS.}
s.email = %q{info@refinerycms.com} s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com/blog} s.homepage = %q{http://refinerycms.com/blog}
s.authors = ['Resolve Digital', 'Neoteric Design'] s.authors = ['Resolve Digital', 'Neoteric Design']

View file

@ -9,14 +9,14 @@ module Refinery
end end
it "sets the correct path for activity entries" do 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
end end
describe ".load_seed" do describe ".load_seed" do
it "is idempotent" do it "is idempotent" do
Refinery::Blog::Engine.load_seed Engine.load_seed
Refinery::Blog::Engine.load_seed Engine.load_seed
Refinery::Page.where(:link_url => '/blog').count.should eq(1) Refinery::Page.where(:link_url => '/blog').count.should eq(1)
end end

View file

@ -55,8 +55,8 @@ module Refinery
describe "by_archive scope" do describe "by_archive scope" do
before do before do
@blog_post1 = FactoryGirl.create(:blog_post, :published_at => Date.new(2011, 3, 11)) @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)) @post2 = FactoryGirl.create(:blog_post, :published_at => Date.new(2011, 3, 12))
#2 months before #2 months before
FactoryGirl.create(:blog_post, :published_at => Date.new(2011, 1, 10)) FactoryGirl.create(:blog_post, :published_at => Date.new(2011, 1, 10))
@ -66,34 +66,34 @@ module Refinery
#check for this month #check for this month
date = "03/2011" date = "03/2011"
subject.class.by_archive(Time.parse(date)).count.should be == 2 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
end end
describe "all_previous scope" do describe "all_previous scope" do
before do before do
@blog_post1 = FactoryGirl.create(:blog_post, :published_at => Time.now - 2.months) @post1 = FactoryGirl.create(:blog_post, :published_at => Time.now - 2.months)
@blog_post2 = FactoryGirl.create(:blog_post, :published_at => Time.now - 1.month) @post2 = FactoryGirl.create(:blog_post, :published_at => Time.now - 1.month)
FactoryGirl.create(:blog_post, :published_at => Time.now) FactoryGirl.create(:blog_post, :published_at => Time.now)
end end
it "returns all posts from previous months" do it "returns all posts from previous months" do
subject.class.all_previous.count.should be == 2 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
end end
describe "live scope" do describe "live scope" do
before do before do
@blog_post1 = FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -2)) @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)) @post2 = FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -1))
FactoryGirl.create(:blog_post, :draft => true) FactoryGirl.create(:blog_post, :draft => true)
FactoryGirl.create(:blog_post, :published_at => Time.now + 1.minute) FactoryGirl.create(:blog_post, :published_at => Time.now + 1.minute)
end end
it "returns all posts which aren't in draft and pub date isn't in future" do 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.count.should be == 2
subject.class.live.should == [@blog_post2, @blog_post1] subject.class.live.should == [@post2, @post1]
end end
end end
@ -128,22 +128,22 @@ module Refinery
describe "#next" do describe "#next" do
before do before do
FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -1)) FactoryGirl.create(:blog_post, :published_at => Time.now.advance(:minutes => -1))
@blog_post = FactoryGirl.create(:blog_post) @post = FactoryGirl.create(:blog_post)
end end
it "returns next article when called on current article" do 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
end end
describe "#prev" do describe "#prev" do
before do before do
FactoryGirl.create(:blog_post) 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 end
it "returns previous article when called on current article" do 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
end end

View file

@ -19,7 +19,6 @@ module Refinery
page.should have_content('there are no new comments') page.should have_content('there are no new comments')
end end
end end
context "when has new unapproved comments" do context "when has new unapproved comments" do
let!(:blog_comment) { FactoryGirl.create(:blog_comment) } let!(:blog_comment) { FactoryGirl.create(:blog_comment) }
before(:each) { visit refinery_blog_admin_comments_path } before(:each) { visit refinery_blog_admin_comments_path }
@ -54,7 +53,6 @@ module Refinery
page.should have_content('there are no approved comments') page.should have_content('there are no approved comments')
end end
end end
context "when has approved comments" do context "when has approved comments" do
let!(:blog_comment) do let!(:blog_comment) do
FactoryGirl.create(:blog_comment, FactoryGirl.create(:blog_comment,
@ -86,7 +84,6 @@ module Refinery
page.should have_content('there are no rejected comments') page.should have_content('there are no rejected comments')
end end
end end
context "when has rejected comments" do context "when has rejected comments" do
let!(:blog_comment) do let!(:blog_comment) do
FactoryGirl.create(:blog_comment, FactoryGirl.create(:blog_comment,
@ -110,12 +107,10 @@ module Refinery
describe "#show" do describe "#show" do
let!(:blog_comment) { FactoryGirl.create(:blog_comment) } let!(:blog_comment) { FactoryGirl.create(:blog_comment) }
before(:each) { visit refinery_blog_admin_comment_path(blog_comment) } before(:each) { visit refinery_blog_admin_comment_path(blog_comment) }
it "should display the comment" do it "should display the comment" do
page.should have_content(blog_comment.body) page.should have_content(blog_comment.body)
page.should have_content(blog_comment.name) page.should have_content(blog_comment.name)
end end
it "should allow me to approve the comment" do it "should allow me to approve the comment" do
click_link "Approve this comment" click_link "Approve this comment"

View file

@ -36,7 +36,7 @@ module Refinery
describe "create blog post" do describe "create blog post" do
before(:each) do before(:each) do
fill_in "Title", :with => "This is my blog post" 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 check blog_category.title
click_button "Save" click_button "Save"
end end
@ -53,7 +53,7 @@ module Refinery
subject.class.first.author.should eq(::Refinery::User.last) subject.class.first.author.should eq(::Refinery::User.last)
end 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.count.should eq(1)
subject.class.last.categories.first.title.should eq(blog_category.title) subject.class.last.categories.first.title.should eq(blog_category.title)
end end
@ -63,7 +63,7 @@ module Refinery
before(:each) do before(:each) do
@tag_list = "chicago, bikes, beers, babes" @tag_list = "chicago, bikes, beers, babes"
fill_in "Title", :with => "This is a tagged blog post" 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 fill_in "Tags", :with => @tag_list
click_button "Save" click_button "Save"
end end
@ -118,7 +118,7 @@ module Refinery
it "redirects to blog post in the frontend" do it "redirects to blog post in the frontend" do
click_link "View this blog post live" 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) page.should have_content(blog_post.title)
end end
end end
@ -151,7 +151,7 @@ module Refinery
click_link "Create new post" click_link "Create new post"
fill_in "Title", :with => "This is some other guy's blog 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" click_link "Advanced Options"

View file

@ -3,18 +3,17 @@ require "spec_helper"
module Refinery module Refinery
describe "BlogCategories" do describe "BlogCategories" do
login_refinery_user login_refinery_user
context "has one category and post" do context "has one category and post" do
before(:each) do before(:each) do
@blog_post = FactoryGirl.create(:blog_post, :title => "Refinery CMS blog post") @post = FactoryGirl.create(:blog_post, :title => "Refinery CMS blog post")
@blog_category = FactoryGirl.create(:blog_category, :title => "Video Games") @category = FactoryGirl.create(:blog_category, :title => "Video Games")
@blog_post.categories << @blog_category @post.categories << @category
@blog_post.save! @post.save!
end end
describe "show categories blog posts" do 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 it "should displays categories blog posts" do
page.should have_content("Refinery CMS blog post") page.should have_content("Refinery CMS blog post")
page.should have_content("Video Games") page.should have_content("Video Games")

View file

@ -8,13 +8,13 @@ module Refinery
let!(:blog_post) { FactoryGirl.create(:blog_post, :title => "Refinery CMS blog post") } let!(:blog_post) { FactoryGirl.create(:blog_post, :title => "Refinery CMS blog post") }
it "should display blog post" do 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) page.should have_content(blog_post.title)
end end
it "should display the blog rss feed" do it "should display the blog rss feed" do
get blog_rss_feed_path get refinery_blog_rss_feed_path
response.should be_success response.should be_success
response.content_type.should eq("application/rss+xml") response.content_type.should eq("application/rss+xml")
@ -25,17 +25,16 @@ module Refinery
context "when has tagged blog posts" do context "when has tagged blog posts" do
before(:each) do before(:each) do
@tag_name = "chicago" @tag_name = "chicago"
@blog_post = FactoryGirl.create(:blog_post, @post = FactoryGirl.create(:blog_post,
:title => "I Love my city", :title => "I Love my city",
:tag_list => @tag_name) :tag_list => @tag_name)
@tag = ::Refinery::Blog::Post.tag_counts_on(:tags).first @tag = ::Refinery::Blog::Post.tag_counts_on(:tags).first
end end
it "should have one tagged post" do 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(@tag_name)
page.should have_content(@blog_post.title) page.should have_content(@post.title)
end end
end end
end end
@ -45,39 +44,35 @@ module Refinery
let(:blog_post) { FactoryGirl.create(:blog_post) } let(:blog_post) { FactoryGirl.create(:blog_post) }
it "should display the blog post" do 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.title)
page.should have_content(blog_post.body) page.should have_content(blog_post.body)
end end
end end
context "when has approved comments" do context "when has approved comments" do
let(:approved_comment) { FactoryGirl.create(:approved_comment) } let(:approved_comment) { FactoryGirl.create(:approved_comment) }
it "should display the comments" do 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(approved_comment.body)
page.should have_content("Posted by #{approved_comment.name}") page.should have_content("Posted by #{approved_comment.name}")
end end
end end
context "when has rejected comments" do context "when has rejected comments" do
let(:rejected_comment) { FactoryGirl.create(:rejected_comment) } let(:rejected_comment) { FactoryGirl.create(:rejected_comment) }
it "should not display the comments" do 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) page.should_not have_content(rejected_comment.body)
end end
end end
context "when has new comments" do context "when has new comments" do
let(:blog_comment) { FactoryGirl.create(:blog_comment) } let(:blog_comment) { FactoryGirl.create(:blog_comment) }
it "should not display the comments" do 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) page.should_not have_content(blog_comment.body)
end end
@ -86,20 +81,18 @@ module Refinery
describe "#show draft preview" do describe "#show draft preview" do
let(:blog_post) { FactoryGirl.create(:blog_post_draft) } let(:blog_post) { FactoryGirl.create(:blog_post_draft) }
context "when logged in as admin" do context "when logged in as admin" do
it "should display the draft notification" 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.') page.should have_content('This page is NOT live for public viewing.')
end end
end end
context "when not logged in as an admin" do context "when not logged in as an admin" do
before(:each) { visit destroy_refinery_user_session_path } before(:each) { visit destroy_refinery_user_session_path }
it "should not display the blog post" do 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)") page.should have_content("The page you were looking for doesn't exist (404)")
end end