[Git][noosfero/noosfero][master] 2 commits: Improve pagination default

Larissa Reis gitlab at gitlab.com
Fri Oct 2 12:06:34 BRT 2015


Larissa Reis pushed to branch master at Noosfero / noosfero


Commits:
64b98a9e by Daniela Feitosa at 2015-10-01T18:55:05Z
Improve pagination default

Also %s/will_paginate/pagination_links to use the default on forum, blog
and cms

Signed-off-by: Tallys Martins <tallysmartins at yahoo.com.br>
Signed-off-by: Melissa Wen <melissa at colivre.coop.br>

- - - - -
9ecec837 by Larissa Reis at 2015-10-02T15:06:13Z
Merge branch 'pagination-fix' into 'master'

Improve pagination default

Also %s/will_paginate/pagination_links to use the default on forum, blog
and cms

Signed-off-by: Tallys Martins <tallysmartins at yahoo.com.br>
Signed-off-by: Melissa Wen <melissa at colivre.coop.br>

See merge request !685
- - - - -


6 changed files:

- app/helpers/application_helper.rb
- app/helpers/blog_helper.rb
- app/helpers/cms_helper.rb
- app/helpers/forum_helper.rb
- public/stylesheets/content/blog.scss
- public/stylesheets/content/image-gallery.scss


Changes:

=====================================
app/helpers/application_helper.rb
=====================================
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1131,7 +1131,7 @@ module ApplicationHelper
   alias :browse_communities_menu :search_communities_menu
 
   def pagination_links(collection, options={})
-    options = {:previous_label => '« ' + _('Previous'), :next_label => _('Next') + ' »'}.merge(options)
+    options = {:previous_label => content_tag(:span, '« ', :class => 'previous-arrow') + _('Previous'), :next_label => _('Next') + content_tag(:span, ' »', :class => 'next-arrow'), :inner_window => 1, :outer_window => 0 }.merge(options)
     will_paginate(collection, options)
   end
 


=====================================
app/helpers/blog_helper.rb
=====================================
--- a/app/helpers/blog_helper.rb
+++ b/app/helpers/blog_helper.rb
@@ -24,10 +24,8 @@ module BlogHelper
   end
 
   def list_posts(articles, conf = { format: 'full', paginate: true })
-    pagination = will_paginate(articles, {
+    pagination = pagination_links(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"}


=====================================
app/helpers/cms_helper.rb
=====================================
--- a/app/helpers/cms_helper.rb
+++ b/app/helpers/cms_helper.rb
@@ -9,11 +9,6 @@ module CmsHelper
     mime_type.gsub('/', '_').gsub('-', '')
   end
 
-  def pagination_links(collection, options={})
-    options = {:previous_label => '« ', :next_label => ' »', :page_links => false}.merge(options)
-    will_paginate(collection, options)
-  end
-
   attr_reader :environment
 
   def options_for_article(article, tokenized_children=nil)


=====================================
app/helpers/forum_helper.rb
=====================================
--- a/app/helpers/forum_helper.rb
+++ b/app/helpers/forum_helper.rb
@@ -10,10 +10,8 @@ module ForumHelper
   end
 
   def list_forum_posts(articles)
-    pagination = will_paginate(articles, {
-      :param_name => 'npage',
-      :previous_label => _('« Newer posts'),
-      :next_label => _('Older posts »')
+    pagination = pagination_links(articles, {
+      :param_name => 'npage'
     })
     content = [content_tag('tr',
                            content_tag('th', _('Discussion topic')) +


=====================================
public/stylesheets/content/blog.scss
=====================================
--- a/public/stylesheets/content/blog.scss
+++ b/public/stylesheets/content/blog.scss
@@ -34,7 +34,7 @@
 #content .blog-post .publishing-info {
   text-align: left;
 }
-#content #article .pagination .prev_page {
+#content #article .pagination .previous_page {
   position: absolute;
   left: 0;
 }
@@ -42,7 +42,7 @@
   position: absolute;
   right: 0;
 }
-.msie6 #content #article .pagination .prev_page, .msie6 #content #article .pagination .next_page {
+.msie6 #content #article .pagination .previous_page, .msie6 #content #article .pagination .next_page {
   position: relative;
   display: inline;
 }


=====================================
public/stylesheets/content/image-gallery.scss
=====================================
--- a/public/stylesheets/content/image-gallery.scss
+++ b/public/stylesheets/content/image-gallery.scss
@@ -48,7 +48,7 @@
 .image-gallery-item .uploaded-file {
   background: transparent url('../images/icons-mime/empty.png') no-repeat 50% 43%;
 }
-#content #article .image-gallery .pagination .prev_page {
+#content #article .image-gallery .pagination .previous_page {
   position: relative;
   left: auto;
   right: auto;



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/89b2559c511936a51e0c97a692b7d316d1f11a91...9ecec837578161ecf82b6fc542b1bfab332c4f45
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151002/910e5095/attachment.html>


More information about the Noosfero-dev mailing list