Sith/pedagogy/templates/pedagogy/macros.jinja

16 lines
565 B
Django/Jinja

{% macro display_star(grade) -%}
{% if grade >= 0 %}
{% for i in range(5) %}
{% if i <= grade %}
<span class="fa fa-star pedagogy star-checked grade-with-star"></span>
{% else %}
<span class="fa fa-star pedagogy star-not-checked grade-with-star"></span>
{% endif %}
{% endfor %}
<span class="pedagogy grade-without-star">{{ grade }}/5</span>
{% else %}
<span class="grade-text"> {% trans %} not rated {% endtrans %} </span>
{% endif %}
{%- endmacro %}