feat: reduce number of rating stars to 5

This commit is contained in:
Björn Fromme
2024-01-28 18:01:46 +01:00
parent 64ed782710
commit e742843eb5
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ class FeedbackRatingsType extends AbstractType
foreach ($ratings as $index => $rating) {
$builder->add('rating_'.$index, ChoiceType::class, [
'label' => $rating,
'choices' => array_combine(range(1, 6), range(1,6)),
'choices' => array_combine(range(1, 5), range(1,5)),
]);
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
{% set averageRating = teamer.averageRating %}
<div class="inline-flex items-center"{% if teamer.averageRating %}{{ stimulus_controller('tooltip', { content: averageRating|format_rating|raw, placement: 'top' }) }}{% endif %}>
{% for grade in range(1, 6) %}
{{ icon('star', html_classes('w-3 h-3', { 'text-gray-200': averageRating < grade * 100, 'text-primary': averageRating >= grade * 100 })) }}
{% 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 })) }}
{% endfor %}
</div>