diff --git a/app/helpers/blog_helper.rb b/app/helpers/blog_helper.rb index 702f496..69e2a2a 100644 --- a/app/helpers/blog_helper.rb +++ b/app/helpers/blog_helper.rb @@ -17,13 +17,13 @@ module BlogHelper _('Configure blog') end - def list_posts(articles, format = 'full') + def list_posts(articles, format = 'full', paginate = true) pagination = will_paginate(articles, { :param_name => 'npage', :previous_label => _('« Newer posts'), :next_label => _('Older posts »'), :params => {:action=>"view_page", :page=>articles.first.parent.path.split('/'), :controller=>"content_viewer"} - }) if articles.present? + }) if articles.present? && paginate content = [] artic_len = articles.length articles.each_with_index{ |art,i| diff --git a/app/views/content_viewer/blog_page.html.erb b/app/views/content_viewer/blog_page.html.erb index d48ec35..8645ec3 100644 --- a/app/views/content_viewer/blog_page.html.erb +++ b/app/views/content_viewer/blog_page.html.erb @@ -9,13 +9,15 @@
+ <% paginate = true %> <%= posts = @posts format = blog.visualization_format if inside_block posts = blog.posts.paginate(:page=>1, :per_page=>inside_block.posts_per_page) format = inside_block.visualization_format + paginate = false end - (blog.empty? ? content_tag('em', _('(no posts)')) : list_posts(posts, format)) + (blog.empty? ? content_tag('em', _('(no posts)')) : list_posts(posts, format, paginate)) %>
-- libgit2 0.21.2