feat: use star ratings in favor of average value
This commit is contained in:
@@ -7,5 +7,5 @@ use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;
|
|||||||
#[AsTwigComponent(template: 'components/rating_stars.html.twig')]
|
#[AsTwigComponent(template: 'components/rating_stars.html.twig')]
|
||||||
class RatingStars
|
class RatingStars
|
||||||
{
|
{
|
||||||
public ?int $averageRating;
|
public ?int $rating;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<span>{{ application.teamer }}</span>
|
<span>{{ application.teamer }}</span>
|
||||||
{{ icon('info', 'w-4 h-4') }}
|
{{ icon('info', 'w-4 h-4') }}
|
||||||
</button>
|
</button>
|
||||||
<twig:RatingStars averageRating="{{ application.teamer.averageRating }}" />
|
<twig:RatingStars rating="{{ application.teamer.averageRating }}" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ application.pickup|bpn_pickup_label|default('-') }}
|
{{ application.pickup|bpn_pickup_label|default('-') }}
|
||||||
@@ -138,7 +138,7 @@
|
|||||||
<span>{{ disposition.teamer }}</span>
|
<span>{{ disposition.teamer }}</span>
|
||||||
{{ icon('info', 'w-4 h-4') }}
|
{{ icon('info', 'w-4 h-4') }}
|
||||||
</button>
|
</button>
|
||||||
<twig:RatingStars averageRating="{{ disposition.teamer.averageRating }}" />
|
<twig:RatingStars rating="{{ disposition.teamer.averageRating }}" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ disposition.remarks|nl2br|default('-') }}
|
{{ disposition.remarks|nl2br|default('-') }}
|
||||||
|
|||||||
@@ -152,7 +152,7 @@
|
|||||||
hx-target="body"
|
hx-target="body"
|
||||||
hx-swap="beforeend">
|
hx-swap="beforeend">
|
||||||
<span class="whitespace-nowrap">{{ disposition.teamer }}</span>
|
<span class="whitespace-nowrap">{{ disposition.teamer }}</span>
|
||||||
<twig:RatingStars averageRating="{{ disposition.teamer.averageRating }}" />
|
<twig:RatingStars rating="{{ disposition.teamer.averageRating }}" />
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -54,11 +54,7 @@
|
|||||||
{{ feedback.hotel|default('-') }}
|
{{ feedback.hotel|default('-') }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if feedback.averageRating %}
|
<twig:RatingStars rating="{{ feedback.averageRating }}" />
|
||||||
{{ feedback.averageRating|format_rating }}
|
|
||||||
{% else %}
|
|
||||||
-
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<button type="button"
|
<button type="button"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
{{ entry.rating }}
|
{{ entry.rating }}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{{ entry.mark }}
|
<twig:RatingStars rating="{{ entry.mark * 100 }}"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
{{ icon('user', 'w-10 h-10 text-gray-200') }}
|
{{ icon('user', 'w-10 h-10 text-gray-200') }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<twig:RatingStars averageRating="{{ teamer.averageRating }}" />
|
<twig:RatingStars rating="{{ teamer.averageRating }}" />
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
{{ icon('user', 'w-32 h-32 text-gray-200') }}
|
{{ icon('user', 'w-32 h-32 text-gray-200') }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<twig:RatingStars averageRating="{{ teamer.averageRating }}"/>
|
<twig:RatingStars rating="{{ teamer.averageRating }}"/>
|
||||||
<ul class="pb-8 divide-y divide-gray-200">
|
<ul class="pb-8 divide-y divide-gray-200">
|
||||||
{% if teamer.communication.phone %}
|
{% if teamer.communication.phone %}
|
||||||
<li class="py-2">
|
<li class="py-2">
|
||||||
|
|||||||
@@ -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) %}
|
{% 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 %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
hx-target="body"
|
hx-target="body"
|
||||||
hx-swap="beforeend">
|
hx-swap="beforeend">
|
||||||
<span class="whitespace-nowrap">{{ disposition.teamer }}</span>
|
<span class="whitespace-nowrap">{{ disposition.teamer }}</span>
|
||||||
<twig:RatingStars averageRating="{{ disposition.teamer.averageRating }}" />
|
<twig:RatingStars rating="{{ disposition.teamer.averageRating }}" />
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -1,20 +1,25 @@
|
|||||||
{% extends 'htmx_modal.html.twig' %}
|
{% extends 'htmx_modal.html.twig' %}
|
||||||
|
|
||||||
{% block title %}{{ feedback.destinationName ~ ' ' ~ feedback.assignmentDate|date('m.Y') }}{% endblock %}
|
{% block title %}Feedback zu {{ feedback.teamer }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2 class=" font-bold text-lg pb-2">
|
<div class="text-lg pb-4">
|
||||||
Durchschnittsnote: {{ feedback.averageRating|format_rating }}
|
Einsatz: {{ feedback.destinationName }}
|
||||||
</h2>
|
<br>
|
||||||
<ul class="divide-y divide-gray-200 pb-4">
|
Einsatzzeitraum: {{ feedback.assignmentDateFrom|date('d.m.Y') }} - {{ feedback.assignmentDateTo|date('d.m.Y') }}
|
||||||
{% for item in feedback.ratings %}
|
<br>
|
||||||
<li class="py-2 first:pt-0 last:pb-0 flex items-start">
|
Feedback von: {{ feedback.author }}
|
||||||
<span class="flex-1">{{ item.rating }}</span>
|
</div>
|
||||||
<strong>Note {{ item.mark }}</strong>
|
<table>
|
||||||
</li>
|
{% for entry in feedback.ratings %}
|
||||||
|
<tr>
|
||||||
|
<td class="border-r border-gray-300">
|
||||||
|
{{ entry.rating }}
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<twig:RatingStars rating="{{ entry.mark * 100 }}"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</table>
|
||||||
<p>
|
|
||||||
abgegeben von {{ feedback.author }} (<a href="mailto:{{ feedback.createdBy }}" class="underline">{{ feedback.createdBy }}</a>)
|
|
||||||
</p>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user