mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 17:32:20 +01:00
Merge branch 'marietje-zuid' into 'feature/improve-queueable'
# Conflicts: # marietje/queues/templates/queues/queue.html
This commit is contained in:
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,14 +58,16 @@
|
|||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<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>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="container-lg">
|
<div class="container-lg">
|
||||||
<br><br>
|
<div class="d-none d-lg-block"><br></div>
|
||||||
<div class="alert-location">
|
<div class="alert-location">
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
@ -83,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>
|
||||||
@ -99,7 +101,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<span class="artist">${ song.song.artist }$</span>
|
<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">
|
<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">
|
<template v-if="song.user === null">
|
||||||
Marietje
|
Marietje
|
||||||
</template>
|
</template>
|
||||||
@ -224,7 +226,7 @@
|
|||||||
${ 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">
|
||||||
@ -238,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" style="pointer-events: auto">
|
<button v-on:click="report_song(song.id);" class="btn btn-link p-0" style="pointer-events: auto">
|
||||||
⚑
|
⚑
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
@ -365,7 +367,9 @@
|
|||||||
const current_song = this.queue[i];
|
const current_song = this.queue[i];
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
const current_song_remaining_seconds = current_song.song.duration - this.queue[1].time_until_song_seconds;
|
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_remaining_seconds;
|
||||||
}
|
}
|
||||||
infoBar['length_total_queue'] += current_song.song.duration;
|
infoBar['length_total_queue'] += current_song.song.duration;
|
||||||
@ -373,7 +377,7 @@
|
|||||||
infoBar['length_personal_queue'] += current_song.song.duration;
|
infoBar['length_personal_queue'] += current_song.song.duration;
|
||||||
infoBar['end_personal_queue'] = infoBar['length_total_queue'];
|
infoBar['end_personal_queue'] = infoBar['length_total_queue'];
|
||||||
if (infoBar['start_personal_queue'] === null) {
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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