switch paging to use kaminari instead of will_paginate
Closed this issue · 3 comments
CODEBASE-335: In the pagination display (next/prev, and direct page links), there are several problems
-
"Previous" is supposed to be greyed out if you are on page 1, and "Next" if you are on last page, they are not.
-
There is a weird ghost link to the left of the '1' link, that if you hover over it you get a highlight, and you can click on it, seems to be a duplicate of the '1' link.
-
The CSS is intended to put the "1 2 3 ... last" links in the middle of the "Next" and "Previous", but it's getting shifted down a line below.
In general, this code is wacky, because we try to use will_paginate, but over-ride some internal will_paginate methods. But the stuff we're over-riding is internal API that changes from release to release (along with some CSS classes we also rely on), making it a moving target hard to work right.
My current inclination is that since we're not using active_record, we ought to just implement this stuff ourselves (copying relevant code from will_paginate if there's something tricky). will_paginate itself is poorly maintained software these days, and was never architected with public API for how we're using it. kaminari is a newer alternative... but it's author also suggests if you aren't using ActiveRecord, just role your own dont' use kaminari.
Other problems with our over-ride of will_paginate is if you're not careful you can mess up will_paginate for NORMAL uses in the local app; and newer versions of will_paginate broke RSolr::Ext's attempts to mock to it, causing a world of trouble on the RSolr::Ext end as Matt tries to fix that, only causing other problems as side effects.
So if we were starting from scratch, I'd like to get rid of will_paginate. But backwarsd compat issues? Not sure.
Original reporter: jrochkind
jrochkind: Change name of ticket so it's clear when people look at 3.0 changes, assign Chris. Chris close when done I guess.
jrochkind: committers call said jrochkind, do what make sense, either fix will_paginate or duplicate internally.