aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/admin/blog/posts_controller.rb7
-rw-r--r--app/views/admin/blog/posts/uncategorized.html.erb26
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>