WIP: Implement feedback functionality

This commit is contained in:
Björn Fromme
2023-11-03 09:20:48 +01:00
parent d024e11f8f
commit d016ee043a
12 changed files with 123 additions and 73 deletions
@@ -13,13 +13,13 @@
{{ form_start(form) }}
<div class="flex flex-col space-y-4 pb-8">
{{ form_row(form.name) }}
<div {{ stimulus_controller('form-collection', { 'prototype': _self.collectionRow(form.items.vars.prototype)|json_encode }) }}>
<div {{ stimulus_controller('form-collection', { 'prototype': _self.collectionRow(form.ratings.vars.prototype)|json_encode }) }}>
<h4 class="font-bold pb-2">
Bewertungen
</h4>
<div {{ stimulus_target('form-collection', 'fields')}} class="flex flex-col space-y-4 mb-4">
{% do form.items.setRendered %}
{%- for item in form.items -%}{{- _self.collectionRow(item) -}}{%- endfor -%}
{% do form.ratings.setRendered %}
{%- for item in form.ratings -%}{{- _self.collectionRow(item) -}}{%- endfor -%}
</div>
<div class="flex justify-end">
<button type="button"
@@ -28,7 +28,7 @@
{{ icon('plus', 'w-4 h-4 pointer-events-none') }}
</button>
</div>
{{ form_errors(form.items) }}
{{ form_errors(form.ratings) }}
</div>
</div>
<div class="flex items-center space-x-2">
@@ -27,20 +27,22 @@
{{ feedbackSet.name }}
</td>
<td>
{{ feedbackSet.items|length }}
{{ feedbackSet.ratings|length }}
</td>
<td>
<div class="flex items-center space-x-2 justify-end">
<button type="button"
class="text-red-500"
{{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }}
{{ stimulus_action('modal-button', 'confirmation', null, {
'title': 'Bist du sicher?',
'content': 'Möchtest du das Job-Profil wirklich löschen?',
'target-url': path('app_admin_system_feedback_set_delete', { 'id': feedbackSet.id })
}) }}>
{{ icon('delete') }}
</button>
{% if is_granted('DELETE', feedbackSet) %}
<button type="button"
class="text-red-500"
{{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }}
{{ stimulus_action('modal-button', 'confirmation', null, {
'title': 'Bist du sicher?',
'content': 'Möchtest du das Job-Profil wirklich löschen?',
'target-url': path('app_admin_system_feedback_set_delete', { 'id': feedbackSet.id })
}) }}>
{{ icon('delete') }}
</button>
{% endif %}
<a href="{{ path('app_admin_system_feedback_set_edit', { 'id': feedbackSet.id }) }}">
{{ icon('edit') }}
</a>