-
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?
Conversation
…strap to give problems
While making the changes, I was tempted to add some data within the seeds to further test and edit the UI, but realized that is out of scope. So, I wanted to put in a request add more seeds for items, wishlist_items and some tests to fully flesh out functionality. |
@mcshakes That's a good idea; I made an issue (#157), and if we don't get a PR for it shortly, I'll make the change myself. For now, I went onto your review app and added a bunch of items; that'll show you the current state of your PR. You can add items locally too by doing something similar to this in wishlist_item = WishlistItem.last
50.times do |n|
new_item = wishlist_item.dup
new_item.staff_message = "This is newly-added item ##{n+1}."
new_item.save!
end That'll add 50 new corgi plushes to your local app. |
@leesharma Sweet! Taking another look to correct some of the UI before pushing again |
…s' to 'Prev'. I may even get rid of that if need be. Looks busy
@leesharma Ready to be merged, but looking at the conflicts; are those changes ones you wanted to keep? |
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.
Just a couple of minor nits.
Can you push it up to the staging box again? Or include screenshots?
Thanks for your help!
@@ -3,7 +3,7 @@ class WishlistItemsController < ApplicationController | |||
|
|||
def index | |||
skip_authorization | |||
@wishlist_items = WishlistItem.includes(:item, :wishlist).priority_order | |||
@wishlist_items = WishlistItem.includes(:item, :wishlist).page(params[:page]).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.
Will this work if we specify default_per_page = 10
in 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
<%= 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? %> |
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.
This is one of the auto generated files, right?
The indentation looks a little off. Is it possible to fix it?
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.
Yes, it is. It looks to be centered to the content div, but let me check and play around with it.
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.
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.
Sorry, I was referring to code indentation not the alignment.
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.
Gotcha, my mistake. Fixed with latest push
…age method within config.
…/playtime into paginate-wishlist-items
Resolves #141
Description
Adds pagination.
Type of change