Paginator can handle both screenshots and packages now

This commit is contained in:
Christoph Haas 2020-10-25 02:20:49 +02:00
parent 109354dbf6
commit f323f94582
3 changed files with 11 additions and 6 deletions

View file

@ -1,8 +1,8 @@
- if @packages.length>0
- if items.length>0
// Use different pagination navigators depending on the screen width
div.show-for-large
=will_paginate @packages, :renderer => FoundationPagination::Rails, :inner_window => 3
=will_paginate items, :renderer => FoundationPagination::Rails, :inner_window => 3
div.show-for-medium-only
=will_paginate @packages, :renderer => FoundationPagination::Rails, :inner_window => 1
=will_paginate items, :renderer => FoundationPagination::Rails, :inner_window => 1
div.show-for-small-only
=will_paginate @packages, :renderer => FoundationPagination::Rails, :page_links => false
=will_paginate items, :renderer => FoundationPagination::Rails, :page_links => false

View file

@ -15,6 +15,9 @@
- screenshots_visible_to_user(@package).each_with_index do |screenshot, idx|
/ Display the first screenshot as a large image
- if idx==0
/ TODO: paginator at the top looks ugly. maybe more space? or put it into the box on the right?
= render(partial: 'packages/paginator', locals: {items: @screenshots})
.small-12.medium-12.cell
.margin-bottom-3
= render(partial:'medium_image', locals: {screenshot: screenshot})
@ -32,6 +35,8 @@
- unless screenshot.approved
| (but not public yet)
// Second paginator at the bottom so the user does not have to scroll up again
= render(partial: 'packages/paginator', locals: {items: @screenshots})
// Show detailed information about the screenshot object when in dev mode

View file

@ -2,7 +2,7 @@
.grid-x
.small-6.medium-8.large-9.cell
// Paginator
= render 'packages/paginator'
= render(partial: 'packages/paginator', locals: {items: @packages})
.small-6.medium-4.large-3.cell
// Search form
@ -35,7 +35,7 @@
= pkg.long_description_first_paragraph or 'Sorry - no description available.'
// Second paginator at the bottom so the user does not have to scroll up again
= render 'packages/paginator'
= render(partial: 'packages/paginator', locals: {items: @packages})
- else
= render 'packages/noresults'