small_img() helper added
This commit is contained in:
parent
c4f5741b0c
commit
f1cff3883d
4 changed files with 45 additions and 29 deletions
|
|
@ -32,6 +32,24 @@ module PackagesHelper
|
|||
str.join(' ∙ ')
|
||||
end
|
||||
|
||||
def small_img(screenshot, cls: 'thumbnail')
|
||||
if screenshot && screenshot.simage(:small)
|
||||
image = screenshot.simage(:small)
|
||||
image_tag(
|
||||
image.url,
|
||||
width: image.width,
|
||||
height: image.height,
|
||||
alt: screenshot.caption,
|
||||
class: cls
|
||||
)
|
||||
else
|
||||
image_tag(
|
||||
'/images/dummy/no-screenshots-available.svg',
|
||||
width: 220,
|
||||
height: 220 * 3 / 4
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
# Show filled/empty star icons from FontAwesome
|
||||
# depending on the rating (1-5)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue