Added admin dashboard, refactored user dashboard. Removed old reviews route.
All checks were successful
CI - Build Tonehaus Docker image / tonehaus-ci-build (push) Successful in 1m53s

This commit is contained in:
2025-11-20 20:40:49 +00:00
parent cd04fa5212
commit f15d9a9cfd
16 changed files with 534 additions and 75 deletions

View File

@@ -13,17 +13,22 @@
<div class="text-secondary mb-2">{{ album.artists|map(a => a.name)|join(', ') }}</div>
<p class="text-secondary mb-2">Released {{ album.release_date }}{{ album.total_tracks }} tracks</p>
<p class="mb-2"><strong>User score:</strong> {{ avg }}/10 ({{ count }})</p>
<a class="btn btn-outline-success btn-sm" href="{{ album.external_urls.spotify }}" target="_blank" rel="noopener">Open in Spotify</a>
{% if album.external_urls.spotify %}
<a class="btn btn-outline-success btn-sm" href="{{ album.external_urls.spotify }}" target="_blank" rel="noopener">Open in Spotify</a>
{% endif %}
{% if album.source is defined and album.source == 'user' %}
<span class="badge text-bg-primary ms-2">User album</span>
{% endif %}
{% if app.user and (isSaved is defined) and (not isSaved) %}
{% if app.user and (album.source is not defined or album.source != 'user') and (isSaved is defined) and (not isSaved) %}
<form class="d-inline ms-2" method="post" action="{{ path('album_save', {id: albumId}) }}">
<input type="hidden" name="_token" value="{{ csrf_token('save-album-' ~ albumId) }}">
<button class="btn btn-primary btn-sm" type="submit">Save album</button>
</form>
{% endif %}
{% if is_granted('ROLE_ADMIN') %}
{% if allowedEdit %}
<a class="btn btn-outline-secondary btn-sm ms-2" href="{{ path('album_edit', {id: albumId}) }}">Edit</a>
{% endif %}
{% if allowedDelete %}
<form class="d-inline ms-2" method="post" action="{{ path('album_delete', {id: albumId}) }}" onsubmit="return confirm('Delete this album from the database?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete-album-' ~ albumId) }}">
<button class="btn btn-outline-danger btn-sm" type="submit">Delete</button>