Showing reviews on package's details page from Ubuntu

This commit is contained in:
Christoph Haas 2016-08-16 12:50:03 +02:00
parent fc95fc9d9a
commit 339bb0427f
10 changed files with 89 additions and 1 deletions

View file

@ -16,4 +16,11 @@ module PackagesHelper
end
end
# Show filled/empty star icons from FontAwesome
# depending on the rating (1-5)
def star_rating(rating)
filled_stars = fa_icon('star') * rating
empty_stars = fa_icon('star-o') * (5-rating)
(filled_stars+empty_stars).html_safe
end
end