All checks were successful
CI - Build Tonehaus Docker image / tonehaus-ci-build (push) Successful in 1m57s
41 lines
1.9 KiB
Twig
41 lines
1.9 KiB
Twig
{% extends 'base.html.twig' %}
|
|
{% block title %}{{ review.title }}{% endblock %}
|
|
{% block body %}
|
|
<p><a href="{{ path('account_dashboard') }}">← Back to dashboard</a></p>
|
|
<div class="d-flex align-items-center gap-3 mb-3">
|
|
{% set avatar = review.author.profileImagePath %}
|
|
{% if avatar %}
|
|
<img src="{{ avatar }}" alt="Avatar for {{ review.author.displayName ?? review.author.userIdentifier }}" class="rounded-circle border" width="64" height="64" style="object-fit: cover;">
|
|
{% else %}
|
|
<div class="rounded-circle bg-secondary text-white d-flex align-items-center justify-content-center" style="width:64px;height:64px;">
|
|
{{ (review.author.displayName ?? review.author.userIdentifier)|slice(0,1)|upper }}
|
|
</div>
|
|
{% endif %}
|
|
<div>
|
|
<h1 class="h4 mb-1">{{ review.title }} <span class="text-secondary">(Rating {{ review.rating }}/10)</span></h1>
|
|
<div class="text-secondary">
|
|
by {{ review.author.displayName ?? review.author.userIdentifier }} • {{ review.createdAt|date('Y-m-d H:i') }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<p class="text-secondary">
|
|
{{ review.album.name }} — {{ review.album.artists|join(', ') }}
|
|
<a class="ms-1" href="{{ path('album_show', {id: review.album.spotifyId ?? review.album.localId}) }}">View album</a>
|
|
</p>
|
|
<article class="mb-3">
|
|
<p>{{ review.content|nl2br }}</p>
|
|
</article>
|
|
|
|
{% if is_granted('REVIEW_EDIT', review) %}
|
|
<div class="d-flex gap-2">
|
|
<a class="btn btn-outline-secondary" href="{{ path('review_edit', {id: review.id}) }}">Edit</a>
|
|
<form action="{{ path('review_delete', {id: review.id}) }}" method="post" onsubmit="return confirm('Delete this review?')">
|
|
<input type="hidden" name="_token" value="{{ csrf_token('delete_review_' ~ review.id) }}" />
|
|
<button class="btn btn-danger" type="submit">Delete</button>
|
|
</form>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
|