mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-15 04:22:20 +01:00
Compare commits
10 Commits
f5b4dbdf7a
...
marietje-z
| Author | SHA1 | Date | |
|---|---|---|---|
| 8f698315dc | |||
| 4bc3f38f69 | |||
| 6d545dddcc | |||
| 3f947a934c | |||
| b5aa079254 | |||
| 7ab6bc6c78 | |||
| 3c2df2adfd | |||
| 82dc7c0193 | |||
| 311e13f696 | |||
| 5c32fcb1d1 |
@ -105,6 +105,10 @@ footer {
|
|||||||
transition: 1s transform ease-in-out;
|
transition: 1s transform ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-link {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
.navbar-text {
|
.navbar-text {
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
}
|
}
|
||||||
@ -113,6 +117,11 @@ 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;
|
||||||
|
|||||||
@ -85,8 +85,8 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="col-md-1">
|
<td class="col-md-1">
|
||||||
<span class="control-icons">Control</span>
|
<span class="control-icons">Control</span>
|
||||||
<span v-if="playsIn" class="btn btn-link p-0 d-sm-none" v-on:click="toggle_details(song)">(Plays in)</span>
|
<span v-if="playsIn" class="btn btn-link p-0 d-sm-none" v-on:click="playsIn = false" >(Plays In)</span>
|
||||||
<span v-else class="btn btn-link p-0 d-sm-none" v-on:click="toggle_details(song)">(Plays At)</span>
|
<span v-else class="btn btn-link p-0 d-sm-none" v-on:click="playsIn = true">(Plays At)</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -221,12 +221,12 @@
|
|||||||
</tfoot>
|
</tfoot>
|
||||||
<tbody>
|
<tbody>
|
||||||
<template v-for="(song, index) in songs">
|
<template v-for="(song, index) in songs">
|
||||||
<tr>
|
<tr v-bind:class="{disabled: is_in_queue(song)}">
|
||||||
<td>
|
<td>
|
||||||
${ song.artist }$
|
${ song.artist }$
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<button v-on:click="request_song(song.id);" class="btn btn-link p-0 text-decoration-none" style="text-align: left">${ song.title }$</button>
|
<button v-on:click="request_song(song.id);" class="btn btn-link p-0" style="text-align: left">${ song.title }$</button>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<template v-if="song.user === null">
|
<template v-if="song.user === null">
|
||||||
@ -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 text-decoration-none">
|
<button v-on:click="report_song(song.id);" class="btn btn-link p-0" style="pointer-events: auto">
|
||||||
⚑
|
⚑
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
@ -585,6 +585,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) {
|
request_song(song_id) {
|
||||||
fetch('/api/v1/queues/current/request/', {
|
fetch('/api/v1/queues/current/request/', {
|
||||||
|
|||||||
@ -179,13 +179,14 @@
|
|||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
if (e instanceof Response) {
|
if (e instanceof Response) {
|
||||||
try {
|
// Intercept an HTTP 413 error (entity too large), as this might
|
||||||
e.json().then(data => {
|
// be thrown by a (reverse) proxy server and its payload is not
|
||||||
this.fileObjects[i].error_message = data.errorMessage;
|
// nicely formatted as the code below expects.
|
||||||
this.fileObjects[i].success = false;
|
if (e.status === 413) {
|
||||||
});
|
this.fileObjects[i].error_message = "The song you tried to upload is too large in size. (HTTP 413 error)";
|
||||||
} catch {
|
this.fileObjects[i].success = false;
|
||||||
this.fileObjects[i].error_message = "An exception occurred while uploading this file, please try again.";
|
} else {
|
||||||
|
this.fileObjects[i].error_message = `${e.statusText} (${e.status})`;
|
||||||
this.fileObjects[i].success = false;
|
this.fileObjects[i].success = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user