lucene icons added, styling fixed

This commit is contained in:
Christoph Haas 2025-05-09 00:40:15 +02:00
parent 9164e2a636
commit d76bf164f1
1604 changed files with 25511 additions and 105 deletions

View file

@ -1,10 +1,11 @@
module PackagesHelper
# Return the description and/or the version of the package
def screenshot_caption(screenshot)
str = []
str << screenshot.description if screenshot.description.present?
str << "#{screenshot.package.name} version #{screenshot.version}" if screenshot.version.present?
if screenshot.version.present?
str << "#{screenshot.package.name} version #{screenshot.version}"
end
str << "uploaded #{time_ago_in_words(screenshot.created_at)} ago"
str.join(' ∙ ')
end
@ -16,7 +17,7 @@ module PackagesHelper
image.url,
width: image.width,
height: image.height,
alt: screenshot.caption,
alt: screenshot.caption,
class: cls
)
else
@ -39,12 +40,11 @@ module PackagesHelper
# Return a readable status of a screenshot and a matching CSS color class
def status(screenshot)
if screenshot.approved && !screenshot.hidden
return (fa_icon('eye') + ' Public'), 'public'
[(icon('eye', class: 'icon') + ' Public'), 'public']
elsif screenshot.hidden
return (fa_icon('eye-slash') + ' Hidden'), 'hidden'
[(icon('eye-closed', class: 'icon') + ' Hidden'), 'hidden']
elsif !screenshot.approved
return (fa_icon('hourglass') + ' Unapproved'), 'unapproved'
[(icon('hourglass', class: 'icon') + ' Unapproved'), 'unapproved']
end
end
end