mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-11 09:32:22 +01:00
Compare commits
10 Commits
c38aba047c
...
marietje-z
| Author | SHA1 | Date | |
|---|---|---|---|
| 8f698315dc | |||
| 4bc3f38f69 | |||
| 6d545dddcc | |||
| 3f947a934c | |||
| b5aa079254 | |||
| 82dc7c0193 | |||
| 6901d913c0 | |||
| 0f85727c5d | |||
| 2b2e0a0275 | |||
| 5c32fcb1d1 |
@ -117,6 +117,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;
|
||||
|
||||
@ -58,14 +58,16 @@
|
||||
</p>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<p class="navbar-text mb-0 duration-queue" v-bind:class="{danger: infobar.length_personal_queue > infobar.max_length * 60}">(${ infobar.length_personal_queue.secondsToMMSS() }$)</p>
|
||||
<p class="navbar-text mb-0 duration-queue" v-bind:class="{danger: infobar.length_personal_queue > infobar.max_length * 60}">
|
||||
(${ infobar.length_personal_queue.secondsToMMSS() }$)
|
||||
</p>
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container-lg">
|
||||
<br><br>
|
||||
<div class="d-none d-lg-block"><br></div>
|
||||
<div class="alert-location">
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
@ -99,7 +101,7 @@
|
||||
<td>
|
||||
<span class="artist">${ song.song.artist }$</span>
|
||||
<span v-if="show_details(song)" class="requested-by d-sm-none d-block small mt-3 fw-normal">
|
||||
Requested by:<br>
|
||||
Requested By:<br>
|
||||
<template v-if="song.user === null">
|
||||
Marietje
|
||||
</template>
|
||||
@ -219,7 +221,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 +240,7 @@
|
||||
${ song.duration.secondsToMMSS() }$
|
||||
</td>
|
||||
<td>
|
||||
<button v-on:click="report_song(song.id);" class="btn btn-link p-0">
|
||||
<button v-on:click="report_song(song.id);" class="btn btn-link p-0" style="pointer-events: auto">
|
||||
⚑
|
||||
</button>
|
||||
</td>
|
||||
@ -365,7 +367,9 @@
|
||||
const current_song = this.queue[i];
|
||||
if (i === 0) {
|
||||
const current_song_remaining_seconds = current_song.song.duration - this.queue[1].time_until_song_seconds;
|
||||
infoBar['length_personal_queue'] -= current_song_remaining_seconds;
|
||||
if (current_song.user !== null && current_song.user.id === this.user_data.id) {
|
||||
infoBar['length_personal_queue'] -= current_song_remaining_seconds;
|
||||
}
|
||||
infoBar['length_total_queue'] -= current_song_remaining_seconds;
|
||||
}
|
||||
infoBar['length_total_queue'] += current_song.song.duration;
|
||||
@ -373,7 +377,7 @@
|
||||
infoBar['length_personal_queue'] += current_song.song.duration;
|
||||
infoBar['end_personal_queue'] = infoBar['length_total_queue'];
|
||||
if (infoBar['start_personal_queue'] === null) {
|
||||
infoBar['start_personal_queue'] = infoBar['length_total_queue'] - current_song.song.duration - this.queue[1].time_until_song_seconds;
|
||||
infoBar['start_personal_queue'] = infoBar['length_total_queue'] - current_song.song.duration;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -581,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) {
|
||||
fetch('/api/v1/queues/current/request/', {
|
||||
|
||||
@ -179,13 +179,14 @@
|
||||
}).catch(e => {
|
||||
console.log(e);
|
||||
if (e instanceof Response) {
|
||||
try {
|
||||
e.json().then(data => {
|
||||
this.fileObjects[i].error_message = data.errorMessage;
|
||||
this.fileObjects[i].success = false;
|
||||
});
|
||||
} catch {
|
||||
this.fileObjects[i].error_message = "An exception occurred while uploading this file, please try again.";
|
||||
// Intercept an HTTP 413 error (entity too large), as this might
|
||||
// be thrown by a (reverse) proxy server and its payload is not
|
||||
// nicely formatted as the code below expects.
|
||||
if (e.status === 413) {
|
||||
this.fileObjects[i].error_message = "The song you tried to upload is too large in size. (HTTP 413 error)";
|
||||
this.fileObjects[i].success = false;
|
||||
} else {
|
||||
this.fileObjects[i].error_message = `${e.statusText} (${e.status})`;
|
||||
this.fileObjects[i].success = false;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user