diff options
39 files changed, 61 insertions, 61 deletions
diff --git a/app/controllers/blog/categories_controller.rb b/app/controllers/blog/categories_controller.rb index 71ceec1..4795e99 100644 --- a/app/controllers/blog/categories_controller.rb +++ b/app/controllers/blog/categories_controller.rb @@ -3,5 +3,5 @@ class Blog::CategoriesController < BlogController def show @category = BlogCategory.find(params[:id]) end - -end
\ No newline at end of file + +end diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb index 95ccbbe..8dd8ada 100644 --- a/app/controllers/blog/posts_controller.rb +++ b/app/controllers/blog/posts_controller.rb @@ -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) diff --git a/app/controllers/blog_controller.rb b/app/controllers/blog_controller.rb index 2efeaa4..f51d5bb 100644 --- a/app/controllers/blog_controller.rb +++ b/app/controllers/blog_controller.rb @@ -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
\ No newline at end of file +end diff --git a/app/helpers/blog_posts_helper.rb b/app/helpers/blog_posts_helper.rb index a74ec33..e690a51 100644 --- a/app/helpers/blog_posts_helper.rb +++ b/app/helpers/blog_posts_helper.rb @@ -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 diff --git a/app/models/blog/comment_mailer.rb b/app/models/blog/comment_mailer.rb index dac526d..acef313 100644 --- a/app/models/blog/comment_mailer.rb +++ b/app/models/blog/comment_mailer.rb @@ -1 +1 @@ -require File.expand_path('../../../mailers/blog/comment_mailer', __FILE__)
\ No newline at end of file +require File.expand_path('../../../mailers/blog/comment_mailer', __FILE__) diff --git a/app/models/blog_category.rb b/app/models/blog_category.rb index c78a7a4..89bff27 100644 --- a/app/models/blog_category.rb +++ b/app/models/blog_category.rb @@ -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 diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb index 7a4af50..63f9731 100644 --- a/app/models/blog_comment.rb +++ b/app/models/blog_comment.rb @@ -119,4 +119,4 @@ class BlogComment < ActiveRecord::Base end end -end
\ No newline at end of file +end diff --git a/app/views/admin/blog/_submenu.html.erb b/app/views/admin/blog/_submenu.html.erb index 6f27722..dcf2f4e 100644 --- a/app/views/admin/blog/_submenu.html.erb +++ b/app/views/admin/blog/_submenu.html.erb @@ -86,4 +86,4 @@ <% end %> <% else %> <% content_for :stylesheets, stylesheet_link_tag('refinery/refinerycms-blog')%> -<% end %>
\ No newline at end of file +<% end %> diff --git a/app/views/admin/blog/categories/_form.html.erb b/app/views/admin/blog/categories/_form.html.erb index 247f31b..28227ae 100644 --- a/app/views/admin/blog/categories/_form.html.erb +++ b/app/views/admin/blog/categories/_form.html.erb @@ -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 %>
\ No newline at end of file +<% end %> diff --git a/app/views/admin/blog/categories/edit.html.erb b/app/views/admin/blog/categories/edit.html.erb index 42509a2..2872e82 100644 --- a/app/views/admin/blog/categories/edit.html.erb +++ b/app/views/admin/blog/categories/edit.html.erb @@ -1 +1 @@ -<%= render :partial => "form" %>
\ No newline at end of file +<%= render :partial => "form" %> diff --git a/app/views/admin/blog/categories/index.html.erb b/app/views/admin/blog/categories/index.html.erb index 9bd50a8..d9ccae6 100644 --- a/app/views/admin/blog/categories/index.html.erb +++ b/app/views/admin/blog/categories/index.html.erb @@ -27,4 +27,4 @@ </p> <% end %> <% end %> -</div>
\ No newline at end of file +</div> diff --git a/app/views/admin/blog/categories/new.html.erb b/app/views/admin/blog/categories/new.html.erb index 42509a2..2872e82 100644 --- a/app/views/admin/blog/categories/new.html.erb +++ b/app/views/admin/blog/categories/new.html.erb @@ -1 +1 @@ -<%= render :partial => "form" %>
\ No newline at end of file +<%= render :partial => "form" %> diff --git a/app/views/admin/blog/comments/_comment.html.erb b/app/views/admin/blog/comments/_comment.html.erb index 52a8167..1817c48 100644 --- a/app/views/admin/blog/comments/_comment.html.erb +++ b/app/views/admin/blog/comments/_comment.html.erb @@ -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> diff --git a/app/views/admin/blog/comments/index.html.erb b/app/views/admin/blog/comments/index.html.erb index c1596a6..fbf268d 100644 --- a/app/views/admin/blog/comments/index.html.erb +++ b/app/views/admin/blog/comments/index.html.erb @@ -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>
\ No newline at end of file +</div> diff --git a/app/views/admin/blog/comments/show.html.erb b/app/views/admin/blog/comments/show.html.erb index 82a5f6f..4faa2de 100644 --- a/app/views/admin/blog/comments/show.html.erb +++ b/app/views/admin/blog/comments/show.html.erb @@ -63,4 +63,4 @@ <% content_for :head, stylesheet_link_tag('refinery/refinerycms-blog') %> <% else %> <% content_for :stylesheets, stylesheet_link_tag('refinery/refinerycms-blog') %> -<% end %>
\ No newline at end of file +<% end %> diff --git a/app/views/admin/blog/posts/_form.css.erb b/app/views/admin/blog/posts/_form.css.erb index d6f2c20..05c18cf 100644 --- a/app/views/admin/blog/posts/_form.css.erb +++ b/app/views/admin/blog/posts/_form.css.erb @@ -4,4 +4,4 @@ margin: 0px; padding: 0px; } -</style>
\ No newline at end of file +</style> diff --git a/app/views/admin/blog/posts/_form.js.erb b/app/views/admin/blog/posts/_form.js.erb index 394975f..1d65448 100644 --- a/app/views/admin/blog/posts/_form.js.erb +++ b/app/views/admin/blog/posts/_form.js.erb @@ -10,4 +10,4 @@ }, 250); }); }); -</script>
\ No newline at end of file +</script> diff --git a/app/views/admin/blog/posts/index.html.erb b/app/views/admin/blog/posts/index.html.erb index ae825eb..d8c45a9 100644 --- a/app/views/admin/blog/posts/index.html.erb +++ b/app/views/admin/blog/posts/index.html.erb @@ -27,4 +27,4 @@ </p> <% end %> <% end %> -</div>
\ No newline at end of file +</div> diff --git a/app/views/blog/categories/show.html.erb b/app/views/blog/categories/show.html.erb index 54b5169..324c0fe 100644 --- a/app/views/blog/categories/show.html.erb +++ b/app/views/blog/categories/show.html.erb @@ -17,4 +17,4 @@ <% end %> <%= render :partial => "/shared/content_page" %> -<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
\ No newline at end of file +<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> diff --git a/app/views/blog/posts/_nav.html.erb b/app/views/blog/posts/_nav.html.erb index 309cd64..e478ca6 100644 --- a/app/views/blog/posts/_nav.html.erb +++ b/app/views/blog/posts/_nav.html.erb @@ -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 -%>
\ No newline at end of file +<% end -%> diff --git a/app/views/blog/posts/_post.html.erb b/app/views/blog/posts/_post.html.erb index 3af89a8..b3efbe9 100644 --- a/app/views/blog/posts/_post.html.erb +++ b/app/views/blog/posts/_post.html.erb @@ -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 -%>
\ No newline at end of file +<% end -%> diff --git a/app/views/blog/posts/archive.html.erb b/app/views/blog/posts/archive.html.erb index a5354ab..abeb0c1 100644 --- a/app/views/blog/posts/archive.html.erb +++ b/app/views/blog/posts/archive.html.erb @@ -16,4 +16,4 @@ <% end %> <%= render :partial => "/shared/content_page" %> -<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
\ No newline at end of file +<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> diff --git a/app/views/blog/posts/index.html.erb b/app/views/blog/posts/index.html.erb index 1d054e1..ab0abf0 100644 --- a/app/views/blog/posts/index.html.erb +++ b/app/views/blog/posts/index.html.erb @@ -17,4 +17,4 @@ <% end %> <%= render :partial => "/shared/content_page" %> -<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
\ No newline at end of file +<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> diff --git a/app/views/blog/posts/show.html.erb b/app/views/blog/posts/show.html.erb index e6710a2..72916f3 100644 --- a/app/views/blog/posts/show.html.erb +++ b/app/views/blog/posts/show.html.erb @@ -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 %>
\ No newline at end of file +<% end %> diff --git a/app/views/blog/shared/_categories.html.erb b/app/views/blog/shared/_categories.html.erb index 305e731..675271c 100644 --- a/app/views/blog/shared/_categories.html.erb +++ b/app/views/blog/shared/_categories.html.erb @@ -5,4 +5,4 @@ <%= link_to "#{category.title} (#{category.post_count})", blog_category_url(category) %> </li> <% end %> -</ul>
\ No newline at end of file +</ul> diff --git a/app/views/blog/shared/_post.html.erb b/app/views/blog/shared/_post.html.erb index 7ca483a..7b243a0 100644 --- a/app/views/blog/shared/_post.html.erb +++ b/app/views/blog/shared/_post.html.erb @@ -35,4 +35,4 @@ </p> </footer> </article> -<% end %>
\ No newline at end of file +<% end %> diff --git a/app/views/blog/shared/_posts.html.erb b/app/views/blog/shared/_posts.html.erb index d686465..cbf865f 100644 --- a/app/views/blog/shared/_posts.html.erb +++ b/app/views/blog/shared/_posts.html.erb @@ -5,4 +5,4 @@ <%= link_to blog_post.title, blog_post_url(blog_post) %> </li> <% end %> -</ul>
\ No newline at end of file +</ul> diff --git a/app/views/blog/shared/_rss_feed.html.erb b/app/views/blog/shared/_rss_feed.html.erb index 65c5a2a..047298e 100644 --- a/app/views/blog/shared/_rss_feed.html.erb +++ b/app/views/blog/shared/_rss_feed.html.erb @@ -1,2 +1,2 @@ <h2><%= t('.title') %></h2> -<%= link_to "Subscribe", blog_rss_feed_url, :id => "rss_feed_subscribe"%>
\ No newline at end of file +<%= link_to "Subscribe", blog_rss_feed_url, :id => "rss_feed_subscribe"%> diff --git a/config/routes.rb b/config/routes.rb index f3dddd4..df00362 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -73,4 +73,4 @@ else end end end -end
\ No newline at end of file +end diff --git a/features/support/factories/blog_categories.rb b/features/support/factories/blog_categories.rb index be28d88..10b51b5 100644 --- a/features/support/factories/blog_categories.rb +++ b/features/support/factories/blog_categories.rb @@ -1,4 +1,4 @@ Factory.define(:blog_category) do |f| f.title "Shopping" f.posts {|p| [p.association(:post)]} -end
\ No newline at end of file +end diff --git a/features/support/factories/blog_comments.rb b/features/support/factories/blog_comments.rb index 93beaf3..d5c5b1d 100644 --- a/features/support/factories/blog_comments.rb +++ b/features/support/factories/blog_comments.rb @@ -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
\ No newline at end of file +end diff --git a/features/support/factories/blog_posts.rb b/features/support/factories/blog_posts.rb index 6947e81..8dd3f54 100644 --- a/features/support/factories/blog_posts.rb +++ b/features/support/factories/blog_posts.rb @@ -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
\ No newline at end of file +end diff --git a/generators/refinerycms_blog/refinerycms_blog_generator.rb b/generators/refinerycms_blog/refinerycms_blog_generator.rb index 2945823..f967df3 100644 --- a/generators/refinerycms_blog/refinerycms_blog_generator.rb +++ b/generators/refinerycms_blog/refinerycms_blog_generator.rb @@ -66,4 +66,4 @@ class RefinerycmsBlogGenerator < Rails::Generator::NamedBase end end -end if defined?(Rails::Generator::NamedBase)
\ No newline at end of file +end if defined?(Rails::Generator::NamedBase) diff --git a/lib/gemspec.rb b/lib/gemspec.rb index 32b8676..5e3606b 100644 --- a/lib/gemspec.rb +++ b/lib/gemspec.rb @@ -29,4 +29,4 @@ Gem::Specification.new do |s| end EOF -File.open(File.expand_path("../../refinerycms-blog.gemspec", __FILE__), 'w').puts(gemspec)
\ No newline at end of file +File.open(File.expand_path("../../refinerycms-blog.gemspec", __FILE__), 'w').puts(gemspec) diff --git a/lib/generators/refinerycms_blog_generator.rb b/lib/generators/refinerycms_blog_generator.rb index ba21e9f..a801353 100644 --- a/lib/generators/refinerycms_blog_generator.rb +++ b/lib/generators/refinerycms_blog_generator.rb @@ -77,4 +77,4 @@ module ActiveRecord end end end -end
\ No newline at end of file +end diff --git a/lib/refinerycms-blog.rb b/lib/refinerycms-blog.rb index cc59376..41d7093 100644 --- a/lib/refinerycms-blog.rb +++ b/lib/refinerycms-blog.rb @@ -46,4 +46,4 @@ module Refinery end end end -end
\ No newline at end of file +end diff --git a/spec/models/blog_categories_spec.rb b/spec/models/blog_categories_spec.rb index 90d9e22..af10b3a 100644 --- a/spec/models/blog_categories_spec.rb +++ b/spec/models/blog_categories_spec.rb @@ -18,4 +18,4 @@ describe BlogCategory do end -end
\ No newline at end of file +end diff --git a/spec/models/blog_comments_spec.rb b/spec/models/blog_comments_spec.rb index 7966b46..a7c1d33 100644 --- a/spec/models/blog_comments_spec.rb +++ b/spec/models/blog_comments_spec.rb @@ -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
\ No newline at end of file +end diff --git a/spec/models/blog_posts_spec.rb b/spec/models/blog_posts_spec.rb index 3801de8..179197d 100644 --- a/spec/models/blog_posts_spec.rb +++ b/spec/models/blog_posts_spec.rb @@ -13,4 +13,4 @@ describe BlogPost do end end -end
\ No newline at end of file +end |