mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 23:22:20 +01:00
Merge branch 'visual_changes' into 'marietje-zuid'
Visual changes See merge request dsprenkels/MarietjeDjango!36
This commit is contained in:
@ -20,6 +20,7 @@ from prometheus_client import Counter
|
|||||||
from marietje.utils import song_to_dict, playlist_song_to_dict, send_to_bertha
|
from marietje.utils import song_to_dict, playlist_song_to_dict, send_to_bertha
|
||||||
from queues.models import PlaylistSong, QueueCommand
|
from queues.models import PlaylistSong, QueueCommand
|
||||||
from songs.models import Song
|
from songs.models import Song
|
||||||
|
from marietje.settings import MAX_MINUTES_IN_A_ROW
|
||||||
|
|
||||||
request_counter = Counter('marietje_requests', 'Queue requests on marietje', ['queue'])
|
request_counter = Counter('marietje_requests', 'Queue requests on marietje', ['queue'])
|
||||||
upload_counter = Counter('marietje_uploads', 'Songs uploaded to marietje')
|
upload_counter = Counter('marietje_uploads', 'Songs uploaded to marietje')
|
||||||
@ -168,7 +169,7 @@ def managesongs(request):
|
|||||||
@api_auth_required
|
@api_auth_required
|
||||||
def queue(request):
|
def queue(request):
|
||||||
queue = request.user.queue
|
queue = request.user.queue
|
||||||
infobar = {"start_personal_queue": 0, "length_personal_queue": 0, "length_total_queue": 0, "end_personal_queue": 0}
|
infobar = {"start_personal_queue": 0, "length_personal_queue": 0, "length_total_queue": 0, "end_personal_queue": 0, 'max_length': MAX_MINUTES_IN_A_ROW}
|
||||||
for song in queue.queue():
|
for song in queue.queue():
|
||||||
infobar["length_total_queue"] += song.song.duration
|
infobar["length_total_queue"] += song.song.duration
|
||||||
if song.user == request.user:
|
if song.user == request.user:
|
||||||
@ -177,7 +178,6 @@ def queue(request):
|
|||||||
if infobar["start_personal_queue"] == 0:
|
if infobar["start_personal_queue"] == 0:
|
||||||
infobar["start_personal_queue"] = infobar["length_total_queue"] - song.song.duration
|
infobar["start_personal_queue"] = infobar["length_total_queue"] - song.song.duration
|
||||||
|
|
||||||
|
|
||||||
json = {
|
json = {
|
||||||
'current_song': playlist_song_to_dict(queue.current_song()),
|
'current_song': playlist_song_to_dict(queue.current_song()),
|
||||||
'queue': [playlist_song_to_dict(playlist_song, user=request.user) for playlist_song in queue.queue()],
|
'queue': [playlist_song_to_dict(playlist_song, user=request.user) for playlist_song in queue.queue()],
|
||||||
|
|||||||
@ -40,8 +40,8 @@ footer {
|
|||||||
border-bottom: 1px solid #DDDDDD;
|
border-bottom: 1px solid #DDDDDD;
|
||||||
}
|
}
|
||||||
|
|
||||||
.requested_song .plays-at, .requested_song .requested-by {
|
tr.requested_song{
|
||||||
font-weight: bold;
|
border-left: 1px solid #777777;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-header-style td, .table-header-style{
|
.table-header-style td, .table-header-style{
|
||||||
|
|||||||
@ -183,6 +183,11 @@ function updateTime() {
|
|||||||
}
|
}
|
||||||
if (infobar['end_personal_queue'] !== 0){
|
if (infobar['end_personal_queue'] !== 0){
|
||||||
$('.start-queue').text("First song starts " + showExactOrRelative(infobar['start_personal_queue']));
|
$('.start-queue').text("First song starts " + showExactOrRelative(infobar['start_personal_queue']));
|
||||||
|
if (infobar['length_personal_queue'] > infobar['max_length'] * 60) {
|
||||||
|
$('.duration-queue').addClass('text-danger');
|
||||||
|
} else {
|
||||||
|
$('.duration-queue').removeClass('text-danger');
|
||||||
|
}
|
||||||
$('.duration-queue').text( " (" + (infobar['length_personal_queue']).secondsToMMSS() + ")");
|
$('.duration-queue').text( " (" + (infobar['length_personal_queue']).secondsToMMSS() + ")");
|
||||||
$('.end-queue').text("Last song ends " + showExactOrRelative(infobar['end_personal_queue']));
|
$('.end-queue').text("Last song ends " + showExactOrRelative(infobar['end_personal_queue']));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,9 +36,11 @@
|
|||||||
<ul class="nav navbar-nav navbar-right hidden-xs">
|
<ul class="nav navbar-nav navbar-right hidden-xs">
|
||||||
<li>
|
<li>
|
||||||
<div class="infobar">
|
<div class="infobar">
|
||||||
<p class="navbar-text start-queue"></p>
|
<p class="navbar-text start-queue hidden-sm hidden-xs"></p>
|
||||||
<p class="navbar-text end-queue"></p>
|
<p class="navbar-text end-queue"></p>
|
||||||
<p class="navbar-text duration-queue"></p>
|
<div class="navbar-text">
|
||||||
|
<p class="duration-queue"></p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -93,7 +95,9 @@
|
|||||||
<td class="col-md-4">Artist</td>
|
<td class="col-md-4">Artist</td>
|
||||||
<td class="col-md-4">Title</td>
|
<td class="col-md-4">Title</td>
|
||||||
<td class="col-md-2 hidden-xs">Requested By</td>
|
<td class="col-md-2 hidden-xs">Requested By</td>
|
||||||
<td id="timeswitch" class="col-md-1 hidden-xs text-info" >Plays In</td>
|
<td class="col-md-1 hidden-xs text-info" style="cursor: pointer;">
|
||||||
|
<span id="timeswitch" class="btn-link" >Plays In</span>
|
||||||
|
</td>
|
||||||
<td class="col-md-1 control-icons">Control</td>
|
<td class="col-md-1 control-icons">Control</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="currentsong" style="font-weight: bold">
|
<tr class="currentsong" style="font-weight: bold">
|
||||||
|
|||||||
Reference in New Issue
Block a user