{# heading string #} {# opinions \App\CatalogBundle\Entity\CompanyOpinion[] #} {# showEvaluated bool #} {# paginator \Pagerfanta\Pagerfanta #} {# css_modifier string #} {% macro opinion(opinion, user, signature, city) %} {% import 'macros.twig' as macros %}
{% if user is not empty and user.image is not empty %} {% set img = vich_uploader_asset(user, 'imageFile') %} {{ signature }} {% else %} {{ macros.img_placeholder('block_list_img', 16) }} {% endif %}
{{- signature -}}
{% if city is not empty %} {{- city -}} {% endif %} {{- opinion.content|default('-') -}} {% include '@Catalog/blocks/opinion_rating.html.twig' with { rating: opinion.rating } %}
{{- opinion.createdDate.format('d-m-Y') -}}
{% endmacro %}

{{ heading }}

{% if opinions|length > 0 %}
{% for opinion in opinions %} {% if showEvaluated == true %} {# user \Notimeo\UserBundle\Entity\User #} {% set user = opinion.company.user %} {% set signature = user.fullName %} {% set city = user.addresses.first.city %} {% elseif opinion.signature is empty %} {% set user = opinion.updatedBy %} {% set signature = user.fullName %} {% set city = user.addresses.first.city %} {% else %} {% set user = null %} {% set signature = opinion.signature %} {% set city = null %} {% endif %} {% if showLink == true %} {{ _self.opinion(opinion, user, signature, city) }} {% else %}
{{ _self.opinion(opinion, user, signature, city) }}
{% endif %} {% endfor %}
{% if paginator|default(false) is not empty %} {% include '@Core/frontend/blocks/paginator_numbers.html.twig' with { route_params: { section: app.request.attributes.get('section'), slug: app.request.attributes.get('slug'), } } %} {% endif %} {% else %}
{{- 'Brak opinii' -}}
{% endif %}