{% macro avatar(user) %}
{% if user is empty %}
{% elseif user is not object %}
{% else %}
{% if user|default({photo: null}).photo %}
{% elseif user and user|trim != 'Unknown User' %}
{% set initials = [] %}
{% for word in user|trim|split(' ') %}
{% set initials = initials|merge([word[:1]|upper]) %}
{% endfor %}
| {{ initials|slice(0, 2)|join('') }} |
| {{ _self.avatar(user) }} | {{ text|raw }} |
|
||
| {% if body is not empty %} {{ body|render_html|raw }} {% else %} <no body> {% endif %} |
|
| {{ _self.displayFile(file) }} | {% if (loop.index0 + 1) is divisible by(3) or loop.last %} {# Close row and pad with empty cells if needed #} {% set remaining = 3 - ((loop.index0 + 1) % 3) %} {% if loop.last and remaining < 3 %} {% for i in 1..remaining %}{% endfor %} {% endif %} |
|
{{ comment.poll }} {% for option in comment.poll.options %}{{ option }}
|