kaminari 0.9.7 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of kaminari might be problematic. Click here for more details.

data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.9.8
2
+
3
+ * I18n for the partials
4
+ [:previous, :next, :truncate] are externalized to the I18n resource.
5
+
1
6
  == 0.9.7
2
7
 
3
8
  * moved template themes to another repo
@@ -89,6 +89,18 @@ This would output something like 1 ...(snip)... 18 19 20 while having 20 pages i
89
89
  This would add data-remote="true" to all the links inside.
90
90
  <%= paginate @users, :remote => true %>
91
91
 
92
+ === I18n and labels
93
+
94
+ The default labels for 'previous', '...' and 'next' are rendered through I18n API.
95
+ So, for example, if you want to change the "prev_label" to '<-', add it to a YAML file in your Rails.root/config/locales directory. Keys and the default values are the following.
96
+
97
+ en:
98
+ views:
99
+ pagination:
100
+ previous: "&laquo; Prev"
101
+ next: "Next &raquo;"
102
+ truncate: "..."
103
+
92
104
  === Customizing the pagination helper
93
105
 
94
106
  Kaminari includes a handy template generator.
@@ -114,7 +126,7 @@ To see the full list of avaliable themes, take a look at the themes repository,
114
126
 
115
127
  == For more information
116
128
 
117
- Check out Kaminari recipes on the GitHub Wiki.
129
+ Check out Kaminari recipes on the GitHub Wiki for more advanced tips and techniques.
118
130
  https://github.com/amatsuda/kaminari/wiki/Kaminari-recipes
119
131
 
120
132
  == Questions, Feedbacks
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.7
1
+ 0.9.8
@@ -7,5 +7,5 @@
7
7
  remote: data-remote
8
8
  -%>
9
9
  <span class="next">
10
- <%= link_to raw('Next &raquo;'), url, :class => 'next', :rel => 'next', :remote => remote %>
10
+ <%= link_to raw(t 'views.pagination.next'), url, :class => 'next', :rel => 'next', :remote => remote %>
11
11
  </span>
@@ -6,4 +6,4 @@
6
6
  per_page: number of items to fetch per page
7
7
  remote: data-remote
8
8
  %span.next
9
- = link_to raw('Next &raquo;'), url, :class => 'next', :rel => 'next', :remote => remote
9
+ = link_to raw(t 'views.pagination.next'), url, :class => 'next', :rel => 'next', :remote => remote
@@ -7,5 +7,5 @@
7
7
  remote: data-remote
8
8
  -%>
9
9
  <span class="prev">
10
- <%= link_to raw('&laquo; Prev'), url, :class => 'prev', :rel => 'prev', :remote => remote %>
10
+ <%= link_to raw(t 'views.pagination.previous'), url, :class => 'prev', :rel => 'prev', :remote => remote %>
11
11
  </span>
@@ -6,4 +6,4 @@
6
6
  per_page: number of items to fetch per page
7
7
  remote: data-remote
8
8
  %span.prev
9
- = link_to raw('&laquo; Prev'), url, :class => 'prev', :rel => 'prev', :remote => remote
9
+ = link_to raw(t 'views.pagination.previous'), url, :class => 'prev', :rel => 'prev', :remote => remote
@@ -5,4 +5,4 @@
5
5
  per_page: number of items to fetch per page
6
6
  remote: data-remote
7
7
  -%>
8
- <span class="page">...</span>
8
+ <span class="page"><%= raw(t 'views.pagination.truncate') %></span>
@@ -5,4 +5,4 @@
5
5
  per_page: number of items to fetch per page
6
6
  remote: data-remote
7
7
  %span.page
8
- \...
8
+ = raw(t 'views.pagination.truncate')
@@ -0,0 +1,8 @@
1
+ # Sample localization file for Kaminari. You can override these values in your app's locales file if you want.
2
+
3
+ en:
4
+ views:
5
+ pagination:
6
+ previous: "&laquo; Prev"
7
+ next: "Next &raquo;"
8
+ truncate: "..."
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{kaminari}
8
- s.version = "0.9.7"
8
+ s.version = "0.9.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Akira Matsuda"]
@@ -25,7 +25,6 @@ Gem::Specification.new do |s|
25
25
  "LICENSE.txt",
26
26
  "README.rdoc",
27
27
  "Rakefile",
28
- "TODO.txt",
29
28
  "VERSION",
30
29
  "app/views/kaminari/_current_page.html.erb",
31
30
  "app/views/kaminari/_current_page.html.haml",
@@ -47,6 +46,7 @@ Gem::Specification.new do |s|
47
46
  "app/views/kaminari/_prev_span.html.haml",
48
47
  "app/views/kaminari/_truncated_span.html.erb",
49
48
  "app/views/kaminari/_truncated_span.html.haml",
49
+ "config/locales/kaminari.yml",
50
50
  "kaminari.gemspec",
51
51
  "lib/generators/kaminari/views_generator.rb",
52
52
  "lib/kaminari.rb",
@@ -36,13 +36,17 @@ BANNER
36
36
 
37
37
  private
38
38
  def self.themes
39
- @themes ||= open ALL_API do |json|
39
+ begin
40
+ @themes ||= open ALL_API do |json|
40
41
  # open File.join File.dirname(__FILE__), '../../../spec/generators/sample.json' do |json|
41
- files = ActiveSupport::JSON.decode(json)['blobs']
42
- hash = files.group_by {|fn, _| fn[0...(fn.index('/') || 0)]}.delete_if {|fn, _| fn.blank?}
43
- hash.map do |name, files|
44
- Theme.new name, files
42
+ files = ActiveSupport::JSON.decode(json)['blobs']
43
+ hash = files.group_by {|fn, _| fn[0...(fn.index('/') || 0)]}.delete_if {|fn, _| fn.blank?}
44
+ hash.map do |name, files|
45
+ Theme.new name, files
46
+ end
45
47
  end
48
+ rescue SocketError
49
+ []
46
50
  end
47
51
  end
48
52
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaminari
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
4
+ hash: 43
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 7
10
- version: 0.9.7
9
+ - 8
10
+ version: 0.9.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Akira Matsuda
@@ -251,7 +251,6 @@ files:
251
251
  - LICENSE.txt
252
252
  - README.rdoc
253
253
  - Rakefile
254
- - TODO.txt
255
254
  - VERSION
256
255
  - app/views/kaminari/_current_page.html.erb
257
256
  - app/views/kaminari/_current_page.html.haml
@@ -273,6 +272,7 @@ files:
273
272
  - app/views/kaminari/_prev_span.html.haml
274
273
  - app/views/kaminari/_truncated_span.html.erb
275
274
  - app/views/kaminari/_truncated_span.html.haml
275
+ - config/locales/kaminari.yml
276
276
  - kaminari.gemspec
277
277
  - lib/generators/kaminari/views_generator.rb
278
278
  - lib/kaminari.rb
data/TODO.txt DELETED
@@ -1,3 +0,0 @@
1
- * add generator option to copy particular template
2
-
3
- * I18n?