feat: use star ratings in favor of average value

This commit is contained in:
Björn Fromme
2024-03-13 15:24:28 +01:00
parent cafee11e03
commit 2f5d62c370
10 changed files with 30 additions and 29 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
<div class="inline-flex items-center"{% if averageRating %}{{ stimulus_controller('tooltip', { content: averageRating|format_rating|raw, placement: 'top' }) }}{% endif %}>
<div class="inline-flex items-center">
{% for grade in range(1, 5) %}
{{ icon('star', html_classes('w-4 h-4', { 'text-gray-200': averageRating < grade * 100, 'text-primary': averageRating >= grade * 100 })) }}
{{ icon('star', html_classes('w-4 h-4', { 'text-gray-200': rating < grade * 100, 'text-primary': rating >= grade * 100 })) }}
{% endfor %}
</div>