Files
tonehaus/templates/review/show.html.twig
boris cd04fa5212
All checks were successful
CI - Build Tonehaus Docker image / tonehaus-ci-build (push) Successful in 2m17s
CRUD Albums + Spotify API requests into DB.
2025-11-20 19:54:31 +00:00

26 lines
1.1 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}{{ review.title }}{% endblock %}
{% block body %}
<p><a href="{{ path('review_index') }}">← Back</a></p>
<h1 class="h4">{{ review.title }} <span class="text-secondary">(Rating {{ review.rating }}/10)</span></h1>
<p class="text-secondary">
{{ review.album.name }}{{ review.album.artists|join(', ') }}
<a class="ms-1" href="{{ path('album_show', {id: review.album.spotifyId}) }}">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 %}