Consistent whitespace.
This commit is contained in:
parent
8b1fd44831
commit
97101633ca
39 changed files with 61 additions and 61 deletions
|
@ -3,5 +3,5 @@ class Blog::CategoriesController < BlogController
|
|||
def show
|
||||
@category = BlogCategory.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
class Blog::PostsController < BlogController
|
||||
|
||||
|
||||
before_filter :find_all_blog_posts, :except => [:archive]
|
||||
before_filter :find_blog_post, :only => [:show, :comment, :update_nav]
|
||||
|
||||
|
||||
respond_to :html, :js, :rss if Rails.version >= '3.0.0'
|
||||
|
||||
def index
|
||||
|
@ -18,7 +18,7 @@ class Blog::PostsController < BlogController
|
|||
|
||||
def show
|
||||
@blog_comment = BlogComment.new
|
||||
|
||||
|
||||
if Rails.version < '3.0.0'
|
||||
# TODO: respond_to block
|
||||
else
|
||||
|
@ -55,7 +55,7 @@ class Blog::PostsController < BlogController
|
|||
render :action => 'show'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def archive
|
||||
date = "#{params[:month]}/#{params[:year]}"
|
||||
@archive_date = Time.parse(date)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class BlogController < ApplicationController
|
||||
|
||||
|
||||
helper :blog_posts
|
||||
before_filter :find_page, :find_all_blog_categories
|
||||
|
||||
|
@ -13,4 +13,4 @@ protected
|
|||
@blog_categories = BlogCategory.all
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,10 +4,10 @@ module BlogPostsHelper
|
|||
return nil if posts.blank?
|
||||
html = '<section id="blog_archive_list"><h1>Archives</h1><nav>'
|
||||
links = []
|
||||
|
||||
|
||||
posts.each do |e|
|
||||
links << e.published_at.strftime('%m/%Y')
|
||||
end
|
||||
end
|
||||
links.uniq!
|
||||
links.each do |l|
|
||||
year = l.split('/')[1]
|
||||
|
@ -19,7 +19,7 @@ module BlogPostsHelper
|
|||
html += '</nav></section>'
|
||||
html.html_safe
|
||||
end
|
||||
|
||||
|
||||
def next_or_previous?(post)
|
||||
post.next.present? or post.prev.present?
|
||||
end
|
||||
|
|
|
@ -1 +1 @@
|
|||
require File.expand_path('../../../mailers/blog/comment_mailer', __FILE__)
|
||||
require File.expand_path('../../../mailers/blog/comment_mailer', __FILE__)
|
||||
|
|
|
@ -8,16 +8,16 @@ class BlogCategory < ActiveRecord::Base
|
|||
validates_uniqueness_of :title
|
||||
|
||||
has_friendly_id :title, :use_slug => true
|
||||
|
||||
|
||||
# this might be able to be optimised a little more
|
||||
def post_count
|
||||
count = 0
|
||||
|
||||
|
||||
self.posts.each do |p|
|
||||
count += 1 if p.live?
|
||||
end
|
||||
|
||||
|
||||
count
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
|
|
@ -119,4 +119,4 @@ class BlogComment < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -86,4 +86,4 @@
|
|||
<% end %>
|
||||
<% else %>
|
||||
<% content_for :stylesheets, stylesheet_link_tag('refinery/refinerycms-blog')%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
:include_object_name => true
|
||||
} %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class='field'>
|
||||
<%= f.label :title -%>
|
||||
<%= f.text_field :title, :class => 'larger widest' -%>
|
||||
|
@ -20,4 +20,4 @@
|
|||
:continue_editing => false,
|
||||
:delete_title => t('admin.blog.categories.category.delete')
|
||||
} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -1 +1 @@
|
|||
<%= render :partial => "form" %>
|
||||
<%= render :partial => "form" %>
|
||||
|
|
|
@ -27,4 +27,4 @@
|
|||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1 +1 @@
|
|||
<%= render :partial => "form" %>
|
||||
<%= render :partial => "form" %>
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
:target => "_blank" unless comment.unmoderated? %>
|
||||
<%= link_to refinery_icon_tag('zoom.png'), admin_blog_comment_path(comment),
|
||||
:title => t('.read') %>
|
||||
<%= link_to refinery_icon_tag("cross.png"),
|
||||
<%= link_to refinery_icon_tag("cross.png"),
|
||||
rejected_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')),
|
||||
:title => t('.reject') unless comment.rejected? %>
|
||||
<%= link_to refinery_icon_tag("tick.png"),
|
||||
<%= link_to refinery_icon_tag("tick.png"),
|
||||
approved_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')),
|
||||
:title => t('.approve') unless comment.approved? %>
|
||||
</span>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<% if searching? %>
|
||||
<h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
|
||||
<% if @blog_comments.any? %>
|
||||
<%=# will_paginate @blog_comments
|
||||
<%=# will_paginate @blog_comments
|
||||
%>
|
||||
|
||||
<ul>
|
||||
|
@ -11,19 +11,19 @@
|
|||
:collection => @blog_comments %>
|
||||
</ul>
|
||||
|
||||
<%=# will_paginate @blog_comments
|
||||
<%=# will_paginate @blog_comments
|
||||
%>
|
||||
<% else %>
|
||||
<p><%= t('admin.search_no_results') %></p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if @blog_comments.any? %>
|
||||
<%=# will_paginate @blog_comments
|
||||
<%=# will_paginate @blog_comments
|
||||
%>
|
||||
|
||||
<%= render :partial => "sortable_list" %>
|
||||
|
||||
<%=# will_paginate @blog_comments
|
||||
<%=# will_paginate @blog_comments
|
||||
%>
|
||||
<% else %>
|
||||
<h3>
|
||||
|
@ -32,4 +32,4 @@
|
|||
</h3>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -63,4 +63,4 @@
|
|||
<% content_for :head, stylesheet_link_tag('refinery/refinerycms-blog') %>
|
||||
<% else %>
|
||||
<% content_for :stylesheets, stylesheet_link_tag('refinery/refinerycms-blog') %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -4,4 +4,4 @@
|
|||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -10,4 +10,4 @@
|
|||
}, 250);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -27,4 +27,4 @@
|
|||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -17,4 +17,4 @@
|
|||
<% end %>
|
||||
|
||||
<%= render :partial => "/shared/content_page" %>
|
||||
<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
|
||||
<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
|
||||
|
|
|
@ -10,4 +10,4 @@
|
|||
<%= link_to "« ".html_safe + truncate(@blog_post.prev.title), @blog_post.prev, :class => 'prev', :"data-nav-url" => update_blog_nav_path(@blog_post.prev) %>
|
||||
<% end -%>
|
||||
</nav><!-- /next_prev_article -->
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<h1><%= @blog_post.title %></h1>
|
||||
<details>
|
||||
<time datetime="<%= @blog_post.published_at.strftime('%Y-%m-%d') %>" class='posted_at'>
|
||||
<%= t('blog.shared.posts.created_at', :when => @blog_post.published_at.strftime('%d %B %Y')) %>.
|
||||
<%= t('blog.shared.posts.created_at', :when => @blog_post.published_at.strftime('%d %B %Y')) %>.
|
||||
</time>
|
||||
<% if (categories = @blog_post.categories).any? %>
|
||||
<aside class='filed_in'>
|
||||
|
@ -30,4 +30,4 @@
|
|||
<nav id="next_prev_article">
|
||||
<%= render 'nav' %>
|
||||
</nav><!-- /next_prev_article -->
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
|
|
@ -16,4 +16,4 @@
|
|||
<% end %>
|
||||
|
||||
<%= render :partial => "/shared/content_page" %>
|
||||
<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
|
||||
<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
|
||||
|
|
|
@ -17,4 +17,4 @@
|
|||
<% end %>
|
||||
|
||||
<%= render :partial => "/shared/content_page" %>
|
||||
<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
|
||||
<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
|
||||
|
|
|
@ -83,4 +83,4 @@
|
|||
<script src="http://w.sharethis.com/button/buttons.js"></script>
|
||||
<script>stLight.options({publisher:'<%= BlogPost::ShareThis.key %>'});</script>
|
||||
<% end if BlogPost::ShareThis.enabled? %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
<%= link_to "#{category.title} (#{category.post_count})", blog_category_url(category) %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</ul>
|
||||
|
|
|
@ -35,4 +35,4 @@
|
|||
</p>
|
||||
</footer>
|
||||
</article>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
<%= link_to blog_post.title, blog_post_url(blog_post) %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</ul>
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
<h2><%= t('.title') %></h2>
|
||||
<%= link_to "Subscribe", blog_rss_feed_url, :id => "rss_feed_subscribe"%>
|
||||
<%= link_to "Subscribe", blog_rss_feed_url, :id => "rss_feed_subscribe"%>
|
||||
|
|
|
@ -73,4 +73,4 @@ else
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Factory.define(:blog_category) do |f|
|
||||
f.title "Shopping"
|
||||
f.posts {|p| [p.association(:post)]}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,4 +7,4 @@ Factory.define(:blog_comment) do |f|
|
|||
f.email { Factory.next(:email) }
|
||||
f.body "Which one is the best for picking up new shoes?"
|
||||
f.association :post
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Factory.define(:post, :class => BlogPost) do |f|
|
||||
f.title "Top Ten Shopping Centers in Chicago"
|
||||
f.body "These are the top ten shopping centers in Chicago. You're going to read a long blog post about them. Come to peace with it."
|
||||
end
|
||||
end
|
||||
|
|
|
@ -66,4 +66,4 @@ class RefinerycmsBlogGenerator < Rails::Generator::NamedBase
|
|||
end
|
||||
end
|
||||
|
||||
end if defined?(Rails::Generator::NamedBase)
|
||||
end if defined?(Rails::Generator::NamedBase)
|
||||
|
|
|
@ -29,4 +29,4 @@ Gem::Specification.new do |s|
|
|||
end
|
||||
EOF
|
||||
|
||||
File.open(File.expand_path("../../refinerycms-blog.gemspec", __FILE__), 'w').puts(gemspec)
|
||||
File.open(File.expand_path("../../refinerycms-blog.gemspec", __FILE__), 'w').puts(gemspec)
|
||||
|
|
|
@ -77,4 +77,4 @@ module ActiveRecord
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -46,4 +46,4 @@ module Refinery
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -18,4 +18,4 @@ describe BlogCategory do
|
|||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,20 +2,20 @@ require 'spec_helper'
|
|||
Dir[File.expand_path('../../../features/support/factories/*.rb', __FILE__)].each{|factory| require factory}
|
||||
|
||||
describe BlogComment do
|
||||
|
||||
|
||||
context "wiring up" do
|
||||
|
||||
|
||||
before(:each) do
|
||||
@comment = Factory(:blog_comment)
|
||||
end
|
||||
|
||||
|
||||
it "saves" do
|
||||
@comment.should_not be_nil
|
||||
end
|
||||
|
||||
|
||||
it "has a blog post" do
|
||||
@comment.post.should_not be_nil
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,4 +13,4 @@ describe BlogPost do
|
|||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue