aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/refinery/admin/blog/posts_controller.rb5
-rw-r--r--app/models/refinery/blog_category.rb2
-rw-r--r--app/models/refinery/blog_post.rb2
-rw-r--r--app/views/refinery/admin/blog/categories/index.html.erb4
-rw-r--r--app/views/refinery/admin/blog/comments/index.html.erb8
-rw-r--r--app/views/refinery/admin/blog/posts/index.html.erb4
-rw-r--r--app/views/refinery/admin/blog/posts/uncategorized.html.erb4
-rw-r--r--app/views/refinery/blog/categories/show.html.erb2
-rw-r--r--app/views/refinery/blog/posts/index.html.erb2
-rw-r--r--app/views/refinery/blog/posts/tagged.html.erb2
10 files changed, 19 insertions, 16 deletions
diff --git a/app/controllers/refinery/admin/blog/posts_controller.rb b/app/controllers/refinery/admin/blog/posts_controller.rb
index c8c38b2..548f8c9 100644
--- a/app/controllers/refinery/admin/blog/posts_controller.rb
+++ b/app/controllers/refinery/admin/blog/posts_controller.rb
@@ -1,3 +1,5 @@
+require 'will_paginate/array'
+
module Refinery
module Admin
module Blog
@@ -9,7 +11,8 @@ module Refinery
:order => 'published_at DESC'
def uncategorized
- @blog_posts = Kaminari.paginate_array(Refinery::BlogPost.uncategorized).page(params[:page]).per(Refinery::BlogPost.per_page)
+ @blog_posts = Refinery::BlogPost.uncategorized.paginate(:page => params[:page],
+ :per_page => Refinery::BlogPost.per_page)
end
def tags
diff --git a/app/models/refinery/blog_category.rb b/app/models/refinery/blog_category.rb
index c2c8c4c..3f10d92 100644
--- a/app/models/refinery/blog_category.rb
+++ b/app/models/refinery/blog_category.rb
@@ -18,7 +18,7 @@ module Refinery
end
# how many items to show per page
- paginates_per Refinery::Setting.find_or_set(:blog_posts_per_page, 10)
+ self.per_page = Refinery::Setting.find_or_set(:blog_posts_per_page, 10)
end
end
diff --git a/app/models/refinery/blog_post.rb b/app/models/refinery/blog_post.rb
index f4bccf1..4da083c 100644
--- a/app/models/refinery/blog_post.rb
+++ b/app/models/refinery/blog_post.rb
@@ -96,7 +96,7 @@ module Refinery
# how many items to show per page
def per_page
- paginates_per Refinery::Setting.find_or_set(:blog_posts_per_page, 10)
+ Refinery::Setting.find_or_set(:blog_posts_per_page, 10)
end
end
diff --git a/app/views/refinery/admin/blog/categories/index.html.erb b/app/views/refinery/admin/blog/categories/index.html.erb
index 75acb77..4ad59ab 100644
--- a/app/views/refinery/admin/blog/categories/index.html.erb
+++ b/app/views/refinery/admin/blog/categories/index.html.erb
@@ -11,11 +11,11 @@
<% end %>
<% else %>
<% if @blog_categories.any? %>
- <%= paginate @blog_categories %>
+ <%= will_paginate @blog_categories %>
<%= render :partial => "sortable_list" %>
- <%= paginate @blog_categories %>
+ <%= will_paginate @blog_categories %>
<% else %>
<p>
<strong>
diff --git a/app/views/refinery/admin/blog/comments/index.html.erb b/app/views/refinery/admin/blog/comments/index.html.erb
index e644f51..bf2be9c 100644
--- a/app/views/refinery/admin/blog/comments/index.html.erb
+++ b/app/views/refinery/admin/blog/comments/index.html.erb
@@ -3,24 +3,24 @@
<% if searching? %>
<h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
<% if @blog_comments.any? %>
- <%=# paginate @blog_comments %>
+ <%=# will_paginate @blog_comments %>
<ul>
<%= render :partial => "blog_comments",
:collection => @blog_comments %>
</ul>
- <%=# paginate @blog_comments %>
+ <%=# will_paginate @blog_comments %>
<% else %>
<p><%= t('search_no_results', :scope => 'admin') %></p>
<% end %>
<% else %>
<% if @blog_comments.any? %>
- <%=# paginate @blog_comments %>
+ <%=# will_paginate @blog_comments %>
<%= render :partial => "sortable_list" %>
- <%=# paginate @blog_comments %>
+ <%=# will_paginate @blog_comments %>
<% else %>
<h3>
<%= t('.no_items_yet',
diff --git a/app/views/refinery/admin/blog/posts/index.html.erb b/app/views/refinery/admin/blog/posts/index.html.erb
index a351b1b..922353c 100644
--- a/app/views/refinery/admin/blog/posts/index.html.erb
+++ b/app/views/refinery/admin/blog/posts/index.html.erb
@@ -12,11 +12,11 @@
<% end %>
<% else %>
<% if @blog_posts.any? %>
- <%= paginate @blog_posts %>
+ <%= will_paginate @blog_posts %>
<%= render :partial => "sortable_list" %>
- <%= paginate @blog_posts %>
+ <%= will_paginate @blog_posts %>
<% else %>
<p>
<strong>
diff --git a/app/views/refinery/admin/blog/posts/uncategorized.html.erb b/app/views/refinery/admin/blog/posts/uncategorized.html.erb
index 7b2cd2b..030e789 100644
--- a/app/views/refinery/admin/blog/posts/uncategorized.html.erb
+++ b/app/views/refinery/admin/blog/posts/uncategorized.html.erb
@@ -11,11 +11,11 @@
<% end %>
<% else %>
<% if @blog_posts.any? %>
- <%= paginate @blog_posts %>
+ <%= will_paginate @blog_posts %>
<%= render :partial => "sortable_list" %>
- <%= paginate @blog_posts %>
+ <%= will_paginate @blog_posts %>
<% else %>
<p>
<strong>
diff --git a/app/views/refinery/blog/categories/show.html.erb b/app/views/refinery/blog/categories/show.html.erb
index 1ae938f..adcf1aa 100644
--- a/app/views/refinery/blog/categories/show.html.erb
+++ b/app/views/refinery/blog/categories/show.html.erb
@@ -4,7 +4,7 @@
<% if @blog_posts.any? %>
<section id="blog_posts">
<%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %>
- <%= paginate @blog_posts %>
+ <%= will_paginate @blog_posts %>
</section>
<% else %>
<p>
diff --git a/app/views/refinery/blog/posts/index.html.erb b/app/views/refinery/blog/posts/index.html.erb
index f347af1..4eef04f 100644
--- a/app/views/refinery/blog/posts/index.html.erb
+++ b/app/views/refinery/blog/posts/index.html.erb
@@ -4,7 +4,7 @@
<% if @blog_posts.any? %>
<section id="blog_posts">
<%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %>
- <%= paginate @blog_posts %>
+ <%= will_paginate @blog_posts %>
</section>
<% else %>
<p><%= t('.no_blog_articles_yet') %></p>
diff --git a/app/views/refinery/blog/posts/tagged.html.erb b/app/views/refinery/blog/posts/tagged.html.erb
index 860bd72..477d2b7 100644
--- a/app/views/refinery/blog/posts/tagged.html.erb
+++ b/app/views/refinery/blog/posts/tagged.html.erb
@@ -4,7 +4,7 @@
<% if @blog_posts.any? %>
<section id="blog_posts">
<%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %>
- <%= paginate @blog_posts %>
+ <%= will_paginate @blog_posts %>
</section>
<% else %>
<p><%= t('.no_blog_articles_yet') %></p>