{# Renders a set of stars for the current dataset or if it has none a string explaining the reason. stars - The number of stars assigned to the dataset. reason - A reason why the dataset doesn't have a rating. {% snippet "qa/stars.html", stars=4 %} #} {%- if stars == None -%} {{ reason }} {%- else -%} {%- for index in range(stars) -%} {%- endfor -%} {%- for index in range(5-stars) -%} {%- endfor -%} {%- if stars == 0 -%} {# 0 stars looks awfully like 5 stars, so be explicit #} {{ _("{0} out of {1}").format(stars, 5) }} {%- endif -%} {%- endif -%}