Showing reviews on package's details page from Ubuntu
This commit is contained in:
parent
fc95fc9d9a
commit
339bb0427f
10 changed files with 89 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue