Slight design improvements

This commit is contained in:
Christoph Haas 2020-10-19 21:19:49 +02:00
parent f5f6e4960b
commit 986b42145e
3 changed files with 69 additions and 30 deletions

View file

@ -23,6 +23,17 @@ module PackagesHelper
screenshot.uploaderhash == session.id.to_s
end
# Return the description and/or the version of the package
def screenshot_caption(screenshot)
str = []
str << screenshot.description if screenshot.description
str << "Version #{screenshot.version}" if screenshot.version
str << "from #{time_ago_in_words(screenshot.created_at)} ago"
str.join(' / ')
end
# Show filled/empty star icons from FontAwesome
# depending on the rating (1-5)
# def star_rating(rating)