{% extends 'user/detail.html.twig' %}

{% block userDetailContent %}
    <div class="reviews">
        {% if reviews|length > 0 %}
            <div class="review-list">
                {% for review in reviews %}
                    <a href="{{ path('song.detail', {songId: review.song.id, tab: 'reviews'}) }}" class="review">
                        <div class="metadata">
                            <div class="avatar" style="background-image: url({{ asset('uploads/avatar/' ~ review.user.coverReference ~ '?t=' ~ date().timestamp) }}), url({{ asset("assets/img/defaultAvatar.jpg") }});"></div>
                            <div class="text">
                                <div class="username">{{ review.user.username }}</div>
                                <div class="subline">
                                    <i class="mdi {{ review.recommended ? 'mdi-thumb-up positive' : 'mdi-thumb-down negative' }}"></i>
                                    <span>{{ review.reviewDate|date("dS F Y") }}</span>
                                </div>
                            </div>
                        </div>
                        {% if review.comment != "" %}
                            <div class="comment">{{ review.comment|nl2br }}</div>
                        {% endif %}
                    </a>
                {% endfor %}
            </div>
        {% else %}
            <div class="list-noresults">
                <div class="noresults-text">This user has no reviews yet.</div>
            </div>
        {% endif %}
    </div>
{% endblock %}