Properly show screenshots visible to the user

This commit is contained in:
Christoph Haas 2020-11-23 00:21:40 +01:00
parent 427cdf87d7
commit 7788025cf7

View file

@ -1,27 +1,7 @@
// TODO: Handle packages with multiple screenshots
a.black href=package_path(name: pkg.name)
/ div.grid-thumbnail
/ - if pkg.screenshots_approved.any?
/ // TODO: smarter selection of the most useful screenshot instead of taking the first one
/ - screenshot = pkg.screenshots.first
/ = small_img(screenshot)
/ - else
/ img.screenshot.thumbnail src="/images/dummy/no-screenshots-upload-one.svg"
/ div
/ .pkgname
/ = pkg.name
/ .pkgdescription
/ = pkg.description
.image
= small_img(pkg.screenshots_approved.first, cls: '')
= small_img(screenshots_visible_to_user(pkg, session).first, cls: '')
.text.pkgname
= pkg.name
.text
= pkg.description
/ .card.callout
/ .card-divider = pkg.name
/ = small_img(pkg.screenshots.first, cls: 'float-center')
/ .card-section
/ = pkg.description