Pagination replacement

- [x] Remove kaminari
- [x] Paginator with first, last, next, prev and gaps
- [x] Some kind of information about how many things are being displayed
Hm I guess mainly because 7 is the magic number.. But that should probably be made a constant so it’s more obvious.. Like WINDOW_SIZE or something

--  
Jens Ljungblad


On Monday 8 December 2014 at 10:41, Linus Pettersson wrote:

> In lib/godmin/resource/pagination.rb:
> > + > + def pagination_offset > + (params[:page].to_i * self.class.per_page) - self.class.per_page > + end > + > + def pages > + pages = (1..total_pages).to_a > + > + return pages unless total_pages > 7 > + > + if current_page < 7 > + pages.slice(0, 7) > + elsif current_page > (total_pages - 7) > + pages.slice(-7, 7) > + else > + pages.slice(pages.index(current_page) - (7 / 2), 7)  
> (7/2)? Why not just write 3? It is integer division so it will always be 3. Right?
>  
> —
> Reply to this email directly or view it on GitHub (https://github.com/varvet/godmin/pull/37/files#r21442488).
>  
>  
>  
>  
>