-
Notifications
You must be signed in to change notification settings - Fork 49
Paginate wishlist items #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 12 commits
e9b66fa
c9aa3c2
5579697
b0fc2db
cf5e5a6
b6c68dc
575f189
e8416c8
03beb55
2342998
465da0f
7f625a8
88ebcbf
a9c009b
f04e1c5
f10e3a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <li class="page-item"> | ||
| <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote, class: 'page-link' %> | ||
| </li> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <li class='page-item disabled'> | ||
| <%= link_to raw(t 'views.pagination.truncate'), '#', class: 'page-link' %> | ||
| </li> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <li class="page-item"> | ||
| <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, remote: remote, class: 'page-link' %> | ||
| </li> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <li class="page-item"> | ||
| <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote, class: 'page-link' %> | ||
| </li> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <% if page.current? %> | ||
| <li class="page-item active"> | ||
| <%= content_tag :a, page, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)), class: 'page-link' %> | ||
| </li> | ||
| <% else %> | ||
| <li class="page-item"> | ||
| <%= link_to page, url, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)), class: 'page-link' %> | ||
| </li> | ||
| <% end %> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <%= paginator.render do %> | ||
| <nav> | ||
| <ul class="pagination justify-content-center"> | ||
| <%= first_page_tag unless current_page.first? %> | ||
| <%= prev_page_tag unless current_page.first? %> | ||
| <% each_page do |page| %> | ||
| <% if page.left_outer? || page.right_outer? || page.inside_window? %> | ||
|
||
| <%= page_tag page %> | ||
| <% elsif !page.was_truncated? -%> | ||
| <%= gap_tag %> | ||
| <% end %> | ||
| <% end %> | ||
| <%= next_page_tag unless current_page.last? %> | ||
| <%= last_page_tag unless current_page.last? %> | ||
| </ul> | ||
| </nav> | ||
| <% end %> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <li class="page-item"> | ||
| <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote, class: 'page-link' %> | ||
| </li> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,4 +9,7 @@ | |
| </div> | ||
|
|
||
| <%= render @wishlist_items %> | ||
|
|
||
| <%= paginate @wishlist_items%> | ||
|
|
||
| </div> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # frozen_string_literal: true | ||
| Kaminari.configure do |config| | ||
| # config.default_per_page = 5 | ||
| # config.max_per_page = nil | ||
| # config.window = 4 | ||
| # config.outer_window = 0 | ||
| # config.left = 0 | ||
| # config.right = 0 | ||
| # config.page_method_name = :page | ||
| # config.param_name = :page | ||
| # config.params_on_first_page = false | ||
| end |

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work if we specify
default_per_page = 10in the config file and remove.per(10)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the
.per(10)and using the config.yml instead for this