1 Commits

Author SHA1 Message Date
c38aba047c Merge branch 'wkuijltjes/playsinat' into 'marietje-zuid'
Fix toggling of Plays In/Plays At in mobile view

Closes #86

See merge request technicie/MarietjeDjango!93
2024-04-23 18:12:25 +02:00
3 changed files with 9 additions and 19 deletions

View File

@ -117,11 +117,6 @@ footer {
color: red !important; 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> */ /* Bootstrap 3 doesn't support equal height columns, hack via <https://medium.com/wdstack/bootstrap-equal-height-columns-d07bc934eb27#892f> */
.row.display-flex { .row.display-flex {
display: flex; display: flex;

View File

@ -221,7 +221,7 @@
</tfoot> </tfoot>
<tbody> <tbody>
<template v-for="(song, index) in songs"> <template v-for="(song, index) in songs">
<tr v-bind:class="{disabled: is_in_queue(song)}"> <tr>
<td> <td>
${ song.artist }$ ${ song.artist }$
</td> </td>
@ -240,7 +240,7 @@
${ song.duration.secondsToMMSS() }$ ${ song.duration.secondsToMMSS() }$
</td> </td>
<td> <td>
<button v-on:click="report_song(song.id);" class="btn btn-link p-0" style="pointer-events: auto"> <button v-on:click="report_song(song.id);" class="btn btn-link p-0">
</button> </button>
</td> </td>
@ -585,10 +585,6 @@
} }
}); });
}, },
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) { request_song(song_id) {
fetch('/api/v1/queues/current/request/', { fetch('/api/v1/queues/current/request/', {

View File

@ -179,14 +179,13 @@
}).catch(e => { }).catch(e => {
console.log(e); console.log(e);
if (e instanceof Response) { if (e instanceof Response) {
// Intercept an HTTP 413 error (entity too large), as this might try {
// be thrown by a (reverse) proxy server and its payload is not e.json().then(data => {
// nicely formatted as the code below expects. this.fileObjects[i].error_message = data.errorMessage;
if (e.status === 413) { this.fileObjects[i].success = false;
this.fileObjects[i].error_message = "The song you tried to upload is too large in size. (HTTP 413 error)"; });
this.fileObjects[i].success = false; } catch {
} else { this.fileObjects[i].error_message = "An exception occurred while uploading this file, please try again.";
this.fileObjects[i].error_message = `${e.statusText} (${e.status})`;
this.fileObjects[i].success = false; this.fileObjects[i].success = false;
} }
} else { } else {