diff --git a/app/views/packages/_grid_thumbnail.slim b/app/views/packages/_grid_small_image.slim similarity index 67% rename from app/views/packages/_grid_thumbnail.slim rename to app/views/packages/_grid_small_image.slim index 6166cd2..3b09aa8 100644 --- a/app/views/packages/_grid_thumbnail.slim +++ b/app/views/packages/_grid_small_image.slim @@ -1,7 +1,3 @@ a.black href=package_path(name: pkg.name) .image = small_img(screenshots_visible_to_user(pkg, session).first, cls: '') - .text.pkgname - = pkg.name - .text - = pkg.description diff --git a/app/views/packages/grid.slim b/app/views/packages/grid.slim index 87d2d4b..43614a2 100644 --- a/app/views/packages/grid.slim +++ b/app/views/packages/grid.slim @@ -8,14 +8,14 @@ // Search form = render 'packages/searchfield' -// Grid view +// Grid view of packages .grid-x .small-9.large-10.cell - if @packages.length>0 .grid-x.grid-margin-x.small-up-1.medium-up-2.large-up-3 data-equalizer=true data-equalize-on="medium" - @packages.all.each do |pkg| .cell.pkgcard data-equalizer-watch=true - = render partial: 'packages/grid_thumbnail', locals: { pkg: pkg } + = render partial: 'packages/grid_small_image', locals: { pkg: pkg } - else = render 'packages/noresults' diff --git a/app/views/packages/list.slim b/app/views/packages/list.slim index a2749c9..54233bb 100644 --- a/app/views/packages/list.slim +++ b/app/views/packages/list.slim @@ -8,24 +8,14 @@ // Search form = render 'packages/searchfield' -// Package list -.grid-x.packagepage +// List view of packages +.grid-x .small-9.medium-10.cell - if @packages.length>0 - @packages.to_a.each do |pkg| .grid-x.listview - .small-12.medium-4.cell - - if pkg.screenshots_approved.any? - // TODO: smarter search for the best screenshot instead of taking the first one - - screenshot = pkg.screenshots.first - a.black title=screenshot.caption href=package_path(name: pkg.name) - = image_tag(screenshot.medium_image, alt: screenshot.caption) - /- if pkg.screenshots.length > 1 - a.black href=package_path(name: pkg.name) - 'and #{pluralize(pkg.screenshots.length-1, 'screenshot')} more… - - else - a href=package_path(name: pkg.name) - img.screenshot src="/images/dummy/no-screenshots-upload-one.svg" width="100%" + .small-12.medium-4.cell.pkgcard + = render partial: 'packages/grid_small_image', locals: { pkg: pkg } .small-12.medium-8.cell h1 a href=package_path(name: pkg.name)