From 2564ba298a8351bcf16f55e1ffcb9c485f5e1e23 Mon Sep 17 00:00:00 2001 From: bkfox Date: Mon, 20 Jun 2016 22:44:25 +0200 Subject: [PATCH] one sound, one parent: Diffusion.sounds -> Sound.diffusion; player: playerStore, save pos when time update, single mode --- notes.md | 10 +- programs/admin.py | 2 +- programs/models.py | 13 +- website/templates/aircox/website/player.html | 174 +++++++++++++++---- 4 files changed, 151 insertions(+), 48 deletions(-) diff --git a/notes.md b/notes.md index 6a508a9..83d374b 100644 --- a/notes.md +++ b/notes.md @@ -11,8 +11,11 @@ - (old) schedule.to_string unused? commented - write more tests - sounds: - - inline admin - - one sound, one diffusion? + - check that a sound is available when uploading too + - one sound, one diffusion + -> update admin & inlining + -> sound_monitor + -> liquidsoap - liquidsoap: - update rc's supervisor scripts @@ -34,6 +37,7 @@ - article list with the focus - similar articles (using tags) - calendar + - tags: allow tags_url on all publications - website: - diffusions: @@ -42,10 +46,8 @@ - print program's name in lists - player: - "listen" + "favorite" buttons made easy + automated - - single mode / play next auto - mixcloud - seek bar - - section for schedule as calendar - load complete week for a schedule? - finish that fucking website - list of played diffusions and tracks when non-stop; diff --git a/programs/admin.py b/programs/admin.py index 9837fe0..b85d193 100755 --- a/programs/admin.py +++ b/programs/admin.py @@ -25,7 +25,7 @@ class StreamInline(admin.TabularInline): extra = 1 class SoundDiffInline(admin.TabularInline): - model = Diffusion.sounds.through + model = Sound # from suit.admin import SortableTabularInline, SortableModelAdmin #class TrackInline(SortableTabularInline): diff --git a/programs/models.py b/programs/models.py index f0e903e..a967fc7 100755 --- a/programs/models.py +++ b/programs/models.py @@ -104,15 +104,17 @@ class Sound(Nameable): """ A Sound is the representation of a sound file that can be either an excerpt or a complete archive of the related diffusion. - - The podcasting and public access permissions of a Sound are managed through - the related program info. """ class Type(IntEnum): other = 0x00, archive = 0x01, excerpt = 0x02, + diffusion = models.ForeignKey( + 'Diffusion', + verbose_name = _('diffusion'), + blank = True, null = True, + ) type = models.SmallIntegerField( verbose_name = _('type'), choices = [ (int(y), _(x)) for x,y in Type.__members__.items() ], @@ -550,11 +552,6 @@ class Diffusion(models.Model): 'Program', verbose_name = _('program'), ) - sounds = models.ManyToManyField( - Sound, - blank = True, - verbose_name = _('sounds'), - ) # specific type = models.SmallIntegerField( verbose_name = _('type'), diff --git a/website/templates/aircox/website/player.html b/website/templates/aircox/website/player.html index 7be817e..958aa2d 100644 --- a/website/templates/aircox/website/player.html +++ b/website/templates/aircox/website/player.html @@ -60,13 +60,18 @@ .playlists { } - .playlists ul:not([selected]) { - display: none; - } + .playlists ul:not([selected]) { + display: none; + } - .playlists nav a.close { - float: right; - } + .playlists nav > a.close, + .playlists nav > label { + float: right; + } + + #player-single-mode + label[for="player-single-mode"]::after { + content:"{% trans "single mode" %}"; + } .playlist { margin: 0; @@ -136,9 +141,8 @@
@@ -148,6 +152,46 @@