Commit 3b3e024332b41923c8797758d3b0cfbba031e567
Committed by
Fabio Teixeira
1 parent
05d99f0e
Exists in
master
and in
22 other branches
Remove paginate from ArticleBlock blog's presentation
(ActionItem3218) Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com> Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Showing
2 changed files
with
5 additions
and
3 deletions
Show diff stats
app/helpers/blog_helper.rb
| ... | ... | @@ -17,13 +17,13 @@ module BlogHelper |
| 17 | 17 | _('Configure blog') |
| 18 | 18 | end |
| 19 | 19 | |
| 20 | - def list_posts(articles, format = 'full') | |
| 20 | + def list_posts(articles, format = 'full', paginate = true) | |
| 21 | 21 | pagination = will_paginate(articles, { |
| 22 | 22 | :param_name => 'npage', |
| 23 | 23 | :previous_label => _('« Newer posts'), |
| 24 | 24 | :next_label => _('Older posts »'), |
| 25 | 25 | :params => {:action=>"view_page", :page=>articles.first.parent.path.split('/'), :controller=>"content_viewer"} |
| 26 | - }) if articles.present? | |
| 26 | + }) if articles.present? && paginate | |
| 27 | 27 | content = [] |
| 28 | 28 | artic_len = articles.length |
| 29 | 29 | articles.each_with_index{ |art,i| | ... | ... |
app/views/content_viewer/blog_page.html.erb
| ... | ... | @@ -9,13 +9,15 @@ |
| 9 | 9 | </div> |
| 10 | 10 | <hr class="pre-posts"/> |
| 11 | 11 | <div class="blog-posts"> |
| 12 | + <% paginate = true %> | |
| 12 | 13 | <%= |
| 13 | 14 | posts = @posts |
| 14 | 15 | format = blog.visualization_format |
| 15 | 16 | if inside_block |
| 16 | 17 | posts = blog.posts.paginate(:page=>1, :per_page=>inside_block.posts_per_page) |
| 17 | 18 | format = inside_block.visualization_format |
| 19 | + paginate = false | |
| 18 | 20 | end |
| 19 | - (blog.empty? ? content_tag('em', _('(no posts)')) : list_posts(posts, format)) | |
| 21 | + (blog.empty? ? content_tag('em', _('(no posts)')) : list_posts(posts, format, paginate)) | |
| 20 | 22 | %> |
| 21 | 23 | </div> | ... | ... |