actionpager 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 876f031e85f180e04e799d237f79330a3cc0eb31a7ffde45778a46c2f1077128
4
- data.tar.gz: 454bc22c406a1e108feb8b3792e187f8a6d72c25d417d7c103a5323b88a8b6f5
3
+ metadata.gz: 38e0877df06a1a5bd9954551d96dc3c7b5f32a935a8e93888b6a6311768668e0
4
+ data.tar.gz: 03d0d6fde869d01816fa1dea918a017013b0d55aecb68b3a781db0c446301446
5
5
  SHA512:
6
- metadata.gz: 0f216700001f0bd47fd43101bca418ab239407d0805159973abe37516d2d315aea19eb53948bc9a71486ed25fb31c9ac2449af5e199fccf7684e324a958611f0
7
- data.tar.gz: 8b60339780300597182e3b8d041315ed8e05d57d3098d220ec5949fb1be3b0defa6167402ab404eb1b930c92fa48195b8fa503264ca5f7640a8ee426cdd00394
6
+ metadata.gz: a0aba54f8db557f1311004c53061c3a848612a88581e2ddcd050444caea3392e4efd32f46cef73737c8f7b9a6f7d08dcb78631d7e411378d179f514cbd1f8e93
7
+ data.tar.gz: c5d47deeee42e130c1bf8d7731187a3195bc55cde1fae6f3d674c4214468c5bae0302602658f6a2d31b250e5eaf3f44282417ef149d99556595d5e5c725651b9
@@ -36,6 +36,9 @@ Railsで使用するには以下のコマンドを実行します
36
36
  - `app/helpers/action_pager/pagination_helper.rb`
37
37
  - `app/views/action_pager/_pager.html.erb`
38
38
 
39
+ 標準では、Bootstrap 4のページネーションのスタイルを使用しています。
40
+ 必要であれば、生成されたファイルをカスタマイズしてください。
41
+
39
42
  ## 使い方
40
43
 
41
44
  シンプルな配列で使う場合
@@ -61,8 +64,6 @@ Railsのビューでページャーを表示するには、以下のようにコ
61
64
  <%= render_pager @pager %>
62
65
  ```
63
66
 
64
-
65
-
66
67
  ## License
67
68
 
68
69
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/README.md CHANGED
@@ -36,6 +36,9 @@ It generates two files and you can customize.
36
36
  - `app/helpers/action_pager/pagination_helper.rb`
37
37
  - `app/views/action_pager/_pager.html.erb`
38
38
 
39
+ By default, it uses Bootstrap 4 pagination for styles.
40
+ If you need, you can easily customize the generated file.
41
+
39
42
  ## Usage
40
43
 
41
44
  Use with a simple array:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionPager
4
- VERSION = "0.0.6"
4
+ VERSION = "0.0.7"
5
5
  end
@@ -1,37 +1,39 @@
1
- <ul class="pagination">
2
- <% unless pager.first_page? -%>
3
- <li>
4
- <%= link_to url_for_page(page: pager.first_page) do %>
5
- &laquo;
6
- <% end -%>
7
- </li>
8
- <li>
9
- <%= link_to url_for_page(page: pager.prev_page), rel: "prev" do %>
10
- &lsaquo;
11
- <% end -%>
12
- </li>
13
- <% end -%>
14
- <% (1..(pager.last_page)).to_a.each do |page| -%>
15
- <% if pager.current_page == page -%>
16
- <li class="active">
17
- <%= link_to page, url_for_page(page: page) -%>
1
+ <nav>
2
+ <ul class="pagination">
3
+ <% unless pager.first_page? -%>
4
+ <li class="page-item">
5
+ <%= link_to url_for_page(page: pager.first_page), class: "page-link" do %>
6
+ &laquo;
7
+ <% end -%>
18
8
  </li>
19
- <% else -%>
20
- <li>
21
- <%= link_to page, url_for_page(page: page) -%>
9
+ <li class="page-item">
10
+ <%= link_to url_for_page(page: pager.prev_page), class: "page-link", rel: "prev" do %>
11
+ &lsaquo;
12
+ <% end -%>
22
13
  </li>
23
14
  <% end -%>
24
- <% end -%>
25
- <% unless pager.last_page? -%>
26
- <li>
27
- <%= link_to url_for_page(page: pager.next_page), rel: "next" do -%>
28
- &rsaquo;
15
+ <% pager.near_pages.each do |page| -%>
16
+ <% if pager.current_page == page -%>
17
+ <li class="page-item active">
18
+ <%= link_to page, url_for_page(page: page), class: "page-link" -%>
19
+ </li>
20
+ <% else -%>
21
+ <li class="page-item">
22
+ <%= link_to page, url_for_page(page: page), class: "page-link" -%>
23
+ </li>
29
24
  <% end -%>
30
- </li>
31
- <li>
32
- <%= link_to url_for_page(page: pager.last_page) do -%>
33
- &raquo;
34
- <% end -%>
35
- </li>
36
- <% end -%>
37
- </ul>
25
+ <% end -%>
26
+ <% unless pager.last_page? -%>
27
+ <li class="page-item">
28
+ <%= link_to url_for_page(page: pager.next_page), rel: "next", class: "page-link" do -%>
29
+ &rsaquo;
30
+ <% end -%>
31
+ </li>
32
+ <li class="page-item">
33
+ <%= link_to url_for_page(page: pager.last_page), class: "page-link" do -%>
34
+ &raquo;
35
+ <% end -%>
36
+ </li>
37
+ <% end -%>
38
+ </ul>
39
+ </nav>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionpager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Hashimoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-20 00:00:00.000000000 Z
11
+ date: 2018-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler