{% extends 'base.html.twig' %} {% block title %}{{ album.name }} — Reviews{% endblock %} {% block body %}
{% set image = (album.images[1] ?? album.images[0] ?? null) %} {% if image %} {{ album.name }} cover {% endif %}
{{ album.name }}
{{ album.artists|map(a => a.name)|join(', ') }}

Released {{ album.release_date }} • {{ album.total_tracks }} tracks

User score: {{ avg }}/10 ({{ count }})

Open in Spotify

Reviews

{% for r in reviews %}
{{ r.title }} (Rating {{ r.rating }}/10)
by {{ r.author.displayName ?? r.author.userIdentifier }} • {{ r.createdAt|date('Y-m-d H:i') }}

{{ r.content|u.truncate(300, '…', false) }}

Read more
{% else %}

No reviews yet for this album.

{% endfor %}
{% if app.user %}

Leave a review

{{ form_start(form, {attr: {class: 'vstack gap-3', novalidate: 'novalidate'}}) }}
{{ form_label(form.title) }}{{ form_widget(form.title, {attr: {class: 'form-control'}}) }}{{ form_errors(form.title) }}
{{ form_label(form.content) }}{{ form_widget(form.content, {attr: {class: 'form-control', rows: 6}}) }}{{ form_errors(form.content) }}
{{ form_label(form.rating) }}
{{ form_widget(form.rating, {attr: {class: 'form-range', min:1, max:10, step:1, list:'rating-ticks', oninput:'document.getElementById("rating-value").textContent=this.value;'}}) }} {{ form.rating.vars.value ?? 5 }}
{% for i in 1..10 %}{% endfor %} {{ form_errors(form.rating) }}
{{ form_end(form) }}
{% else %}
Sign in to leave a review.
{% endif %}
{% endblock %}