{# Renders a set of stars stars - The number of stars to be displayed. {% snippet "rating/snippets/stars_inactive.html", package=pkg %} #} {% set ratings_count = package.ratings_count%} {% set stars = package.rating %} {% if stars|int < stars %} {% set half_star = 1 %} {% else %} {% set half_star = 0 %} {% endif %} {% block main_star_rating %} {%- for index in range(stars|int) -%} {%- endfor -%} {%- if half_star == 1 -%} {%- endif -%} {%- for index in range(stars|int + half_star, 5) -%} {%- endfor -%} {% block star_rating_description %} ({{ ratings_count }}) {% endblock %} {% endblock %}