feat: grey-out already queued songs and make unclickable

This commit is contained in:
Tjibbe
2024-05-06 13:55:19 +02:00
parent cf76861961
commit 6d545dddcc
2 changed files with 11 additions and 2 deletions

View File

@ -113,6 +113,11 @@ footer {
color: red !important;
}
.disabled {
pointer-events: none;
opacity: 0.5;
}
/* Bootstrap 3 doesn't support equal height columns, hack via <https://medium.com/wdstack/bootstrap-equal-height-columns-d07bc934eb27#892f> */
.row.display-flex {
display: flex;

View File

@ -219,7 +219,7 @@
</tfoot>
<tbody>
<template v-for="(song, index) in songs">
<tr>
<tr v-bind:class="{disabled: is_in_queue(song)}">
<td>
${ song.artist }$
</td>
@ -238,7 +238,7 @@
${ song.duration.secondsToMMSS() }$
</td>
<td>
<button v-on:click="report_song(song.id);" class="btn btn-link p-0 text-decoration-none">
<button v-on:click="report_song(song.id);" class="btn btn-link p-0 text-decoration-none" style="pointer-events: auto">
</button>
</td>
@ -581,6 +581,10 @@
}
});
},
is_in_queue(song) {
return queue_vue.queue.filter(queuesong => Boolean(queuesong.user)
).map((queuesong) => queuesong.song.hash).includes(song.hash);
},
request_song(song_id) {
fetch('/api/v1/queues/current/request/', {