From 7788025cf7150d3bd0194b75dbd0b5875badccff Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Mon, 23 Nov 2020 00:21:40 +0100 Subject: [PATCH] Properly show screenshots visible to the user --- app/views/packages/_grid_thumbnail.slim | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/app/views/packages/_grid_thumbnail.slim b/app/views/packages/_grid_thumbnail.slim index 854c1c5..6166cd2 100644 --- a/app/views/packages/_grid_thumbnail.slim +++ b/app/views/packages/_grid_thumbnail.slim @@ -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