diff options
author | Joe Sak <joe@joesak.com> | 2011-02-16 00:13:46 -0600 |
---|---|---|
committer | Joe Sak <joe@joesak.com> | 2011-02-16 00:13:46 -0600 |
commit | a045cc11fe0291ac7e0c14bfce0d3ae12a52d56d (patch) | |
tree | 155f5a469d58360bfe92a14bc6466d86876b03ab /app | |
parent | eac7a05f9340435a1ed5b17a01015559d8a4c3e1 (diff) | |
download | refinerycms-blog-a045cc11fe0291ac7e0c14bfce0d3ae12a52d56d.tar.gz refinerycms-blog-a045cc11fe0291ac7e0c14bfce0d3ae12a52d56d.tar.bz2 refinerycms-blog-a045cc11fe0291ac7e0c14bfce0d3ae12a52d56d.zip |
Add controller action and view template for uncategorized posts
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin/blog/posts_controller.rb | 7 | ||||
-rw-r--r-- | app/views/admin/blog/posts/uncategorized.html.erb | 26 |
2 files changed, 33 insertions, 0 deletions
diff --git a/app/controllers/admin/blog/posts_controller.rb b/app/controllers/admin/blog/posts_controller.rb index bd5dd49..1b6efc3 100644 --- a/app/controllers/admin/blog/posts_controller.rb +++ b/app/controllers/admin/blog/posts_controller.rb @@ -3,6 +3,13 @@ class Admin::Blog::PostsController < Admin::BaseController crudify :blog_post, :title_attribute => :title, :order => 'published_at DESC' + + def uncategorized + @blog_posts = BlogPost.uncategorized.paginate({ + :page => params[:page], + :per_page => BlogPost.per_page + }) + end before_filter :find_all_categories, :only => [:new, :edit, :create, :update] diff --git a/app/views/admin/blog/posts/uncategorized.html.erb b/app/views/admin/blog/posts/uncategorized.html.erb new file mode 100644 index 0000000..888daab --- /dev/null +++ b/app/views/admin/blog/posts/uncategorized.html.erb @@ -0,0 +1,26 @@ +<%= render :partial => '/admin/blog/submenu' %> +<div id='records'> + <% if searching? %> + <h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2> + <% if @blog_posts.any? %> + <%= render :partial => "blog_posts", + :collection => @blog_posts %> + <% else %> + <p><%= t('admin.search_no_results') %></p> + <% end %> + <% else %> + <% if @blog_posts.any? %> + <%= will_paginate @blog_posts %> + + <%= render :partial => "sortable_list" %> + + <%= will_paginate @blog_posts %> + <% else %> + <p> + <strong> + <%= t('.no_items_yet', :create => t('admin.blog.submenu.posts.new')) %> + </strong> + </p> + <% end %> + <% end %> +</div> |