Commit 347fbb41e0e2a857e27939c922c460061b50d745

Authored by Antonio Terceiro
1 parent 3138ed82

Generate translatable pagination links

Also removed the duplication of pagination links methods

(ActionItem1588)
app/helpers/application_helper.rb
... ... @@ -1110,4 +1110,9 @@ module ApplicationHelper
1110 1110 link_to(content_tag(:span, _('Communities Menu')), '#', :onclick => "toggleSubmenu(this,'',#{links.to_json}); return false", :class => 'menu-submenu-trigger up', :id => 'submenu-communities-trigger')
1111 1111 end
1112 1112  
  1113 + def pagination_links(collection, options={})
  1114 + options = {:prev_label => '« ' + _('Previous'), :next_label => _('Next') + ' »'}.merge(options)
  1115 + will_paginate(collection, options)
  1116 + end
  1117 +
1113 1118 end
... ...
app/helpers/friends_helper.rb
... ... @@ -5,9 +5,4 @@ module FriendsHelper
5 5 link_to text, options
6 6 end
7 7  
8   - def pagination_links(collection, options={})
9   - options = {:prev_label => '« ' + _('Previous'), :next_label => _('Next') + ' »'}.merge(options)
10   - will_paginate(collection, options)
11   - end
12   -
13 8 end
... ...
app/helpers/profile_helper.rb
... ... @@ -15,9 +15,4 @@ module ProfileHelper
15 15 end
16 16 end
17 17  
18   - def pagination_links(collection, options={})
19   - options = {:prev_label => '« ' + _('Previous'), :next_label => _('Next') + ' »'}.merge(options)
20   - will_paginate(collection, options)
21   - end
22   -
23 18 end
... ...
app/helpers/search_helper.rb
... ... @@ -98,11 +98,6 @@ module SearchHelper
98 98 ), :class => 'profile-info')
99 99 end
100 100  
101   - def pagination_links(collection, options={})
102   - options = {:prev_label => '« ' + _('Previous'), :next_label => _('Next') + ' »'}.merge(options)
103   - will_paginate(collection, options)
104   - end
105   -
106 101 def product_categories_menu(asset, product_category, object_ids = nil)
107 102 cats = ProductCategory.menu_categories(@product_category, environment)
108 103 cats += cats.select { |c| c.children_count > 0 }.map(&:children).flatten
... ...
app/views/browse/communities.rhtml
... ... @@ -4,6 +4,6 @@
4 4  
5 5 <%= render :partial => 'display_results' %>
6 6  
7   -<%= will_paginate @results %>
  7 +<%= pagination_links @results %>
8 8  
9 9 <br style="clear:both" />
... ...
app/views/browse/people.rhtml
... ... @@ -4,6 +4,6 @@
4 4  
5 5 <%= render :partial => 'display_results' %>
6 6  
7   -<%= will_paginate @results %>
  7 +<%= pagination_links @results %>
8 8  
9 9 <br style="clear:both" />
... ...